> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://respan.ai/docs/apis/spans/get-span/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://respan.ai/_mcp/server. # Get a span GET https://api.respan.ai/api/request-logs/{unique_id}/ Returns the full span, including evaluation scores and credit and budget information (`limit_info`). Metadata keys beginning with `_` are reserved for platform use and omitted from span and trace read responses. Reference: https://respan.ai/docs/apis/spans/get-span ## Authentication - `Authorization` header (bearer token, required) — Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer \. For /api/responses, provider credentials such as Perplexity, OpenAI, or Azure OpenAI go in Settings -> Providers or respan\_params.credential\_override in the request body, not in this authentication field. - `Authorization` header (bearer token, required) — Use a dashboard JWT only for dashboard-authenticated endpoints. Respan API-key endpoints use the respanApiKey auth field instead. ## Request ### Path parameters - `unique_id` (string, required) — The unique ID of the log to get. ## Response ### 200 Successful response for Retrieve span - `id` (string, required) — Span ID (alias of `unique_id`). - `unique_id` (string, optional) — Stored unique span ID. - `span_unique_id` (string, optional) — Tracing span ID, when supplied. - `trace_unique_id` (string, optional) — Parent trace ID. - `span_name` (string, optional) — Span name. - `span_parent_id` (string, optional) — Parent span ID. - `span_workflow_name` (string, optional) — Workflow name associated with the span. - `timestamp` (datetime, optional) — Completion timestamp. - `start_time` (datetime, optional) — Start timestamp. - `period_start` (datetime, optional) — Billing/aggregation period start. - `period_end` (datetime, optional) — Billing/aggregation period end. - `input` (ApiRequestLogsUniqueIdGetResponsesContentApplicationJsonSchemaInput, optional) — Canonical span input. - `output` (ApiRequestLogsUniqueIdGetResponsesContentApplicationJsonSchemaOutput, optional) — Canonical span output. - `prompt_messages` (list of map from string to any, optional) - `completion_message` (map from string to any, optional) - `completion_messages` (list of any, optional) - `full_request` (map from string to any, optional) — Credential-sanitized full request. - `full_response` (map from string to any, optional) — Credential-sanitized full response. - `model` (string, optional) — Model used by the span. - `provider_id` (string, optional) — Provider route used by the span. - `environment` (string, optional) — API-key environment. - `log_type` (string, optional) — Span/log type. - `log_method` (string, optional) — How this span was ingested. - `status` (string, optional) — Span status. - `status_code` (integer, optional) — HTTP or application status code. - `error_code` (string, optional) — Normalized error code. - `error_message` (string, optional) — Error message, when the span failed. - `warnings` (ApiRequestLogsUniqueIdGetResponsesContentApplicationJsonSchemaWarnings, optional) — Warnings captured for the request. - `prompt_tokens` (integer, optional) — Input token count. - `completion_tokens` (integer, optional) — Output token count. - `total_request_tokens` (integer, optional) — Total token count. - `prompt_cache_hit_tokens` (integer, optional) — Cached input-token count. - `prompt_cache_creation_tokens` (integer, optional) — Cache-creation input-token count. - `reasoning_tokens` (integer, optional) — Reasoning-token count. - `cost` (double, optional) — Cost in USD. - `latency` (double, optional) — End-to-end latency in seconds. - `time_to_first_token` (double, optional) — Time to first token in seconds. - `tokens_per_second` (double, optional) — Output throughput. - `routing_time` (double, optional) — Gateway routing time. - `metadata` (map from string to any, optional) — Customer metadata. Keys beginning with `_` are reserved and omitted from customer-facing responses. - `properties` (ApiRequestLogsUniqueIdGetResponsesContentApplicationJsonSchema, optional) — Typed span properties. - `variables` (map from string to any, optional) - `tools` (list of map from string to any, optional) - `tool_calls` (list of map from string to any, optional) - `scores` (map from string to ApiRequestLogsUniqueIdGetResponsesContentApplicationJsonSchemaScores, optional) — Evaluation scores keyed by evaluator identifier or slug. - `customer_identifier` (string, optional) — End-customer identifier. - `customer_email` (string, optional) — End-customer email. - `customer_name` (string, optional) — End-customer name. - `custom_identifier` (string, optional) — Indexed custom identifier. - `group_identifier` (string, optional) — Group identifier. - `session_identifier` (string, optional) — Session identifier. - `thread_identifier` (string, optional) — Conversation thread identifier. - `organization_id` (string, optional) — Organization UUID. - `unique_organization_id` (string, optional) — Organization UUID. - `organization_key_id` (string, optional) — API-key identifier. - `organization_key_name` (string, optional) — API-key display name. - `prompt_id` (string, optional) — Prompt family ID. - `prompt_name` (string, optional) — Prompt display name. - `prompt_version_number` (integer, optional) — Prompt version number. - `deployment_id` (string, optional) — Deployment ID. - `deployment_name` (string, optional) — Deployment name. - `stream` (boolean, optional) — Whether the response streamed. - `temperature` (double, optional) — Sampling temperature. - `top_p` (double, optional) — Nucleus-sampling parameter. - `max_tokens` (integer, optional) — Configured generation limit. - `response_format` (map from string to any, optional) - `limit_info` (ApiRequestLogsUniqueIdGetResponsesContentApplicationJsonSchemaLimitInfo, optional) - `blurred` (boolean, optional) — When true, usage policy reduced the response to visibility-safe fields. ## Errors ### 400 Bad Request Error Bad Request - `error` (string, optional) — Error message ### 403 Forbidden Error The API key is missing, invalid or expired. - `detail` (string, required) ### 404 Not Found Error Span not found. - `detail` (string, required) ### 429 Too Many Requests Error Rate Limited - `error` (string, optional) — Error message ### 500 Internal Server Error Internal Server Error - `error` (string, optional) — Error message ## Types ### ApiRequestLogsUniqueIdGetResponsesContentApplicationJsonSchemaInput Canonical span input. ### ApiRequestLogsUniqueIdGetResponsesContentApplicationJsonSchemaOutput Canonical span output. ### ApiRequestLogsUniqueIdGetResponsesContentApplicationJsonSchemaWarnings Warnings captured for the request. ### ApiRequestLogsUniqueIdGetResponsesContentApplicationJsonSchema Typed span properties. ### ApiRequestLogsUniqueIdGetResponsesContentApplicationJsonSchemaScores - `id` (string, optional) - `evaluator_id` (string, optional) - `evaluator_slug` (string, optional, nullable) - `evaluator_name` (string, optional, nullable) - `score_value_type` (string, optional, nullable) - `numerical_value` (double, optional, nullable) - `string_value` (string, optional, nullable) - `boolean_value` (boolean, optional, nullable) - `categorical_value` (list of string, optional, nullable) - `json_value` (any, optional, nullable) - `is_passed` (boolean, optional, nullable) - `explanation` (string, optional) ### ApiRequestLogsUniqueIdGetResponsesContentApplicationJsonSchemaLimitInfo - `is_allowed` (boolean, optional) - `limits` (list of ApiRequestLogsUniqueIdGetResponsesContentApplicationJsonSchemaLimitInfoLimitsItems, optional) ### ApiRequestLogsUniqueIdGetResponsesContentApplicationJsonSchemaLimitInfoLimitsItems - `name` (string, optional) - `current_value` (double, optional) - `new_value` (double, optional) - `limit_value` (double, optional) - `is_within_limit` (boolean, optional) ## Examples **Response** ```json { "id": "span_550e8400e29b41d4", "limit_info": { "is_allowed": true, "limits": [ { "name": "org_credits", "current_value": 29.99, "new_value": 29.98, "limit_value": 0, "is_within_limit": true }, { "name": "customer_budget", "current_value": 8.5, "new_value": 8.49, "limit_value": 10, "is_within_limit": true } ] } } ``` **SDK Code** ```python Spans_retrieveSpan_example import requests url = "https://api.respan.ai/api/request-logs/unique_id/" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript Spans_retrieveSpan_example const url = 'https://api.respan.ai/api/request-logs/unique_id/'; const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Spans_retrieveSpan_example package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.respan.ai/api/request-logs/unique_id/" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Spans_retrieveSpan_example require 'uri' require 'net/http' url = URI("https://api.respan.ai/api/request-logs/unique_id/") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` ```java Spans_retrieveSpan_example import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.respan.ai/api/request-logs/unique_id/") .header("Authorization", "Bearer ") .asString(); ``` ```php Spans_retrieveSpan_example request('GET', 'https://api.respan.ai/api/request-logs/unique_id/', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ``` ```csharp Spans_retrieveSpan_example using RestSharp; var client = new RestClient("https://api.respan.ai/api/request-logs/unique_id/"); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` ```swift Spans_retrieveSpan_example import Foundation let headers = ["Authorization": "Bearer "] let request = NSMutableURLRequest(url: NSURL(string: "https://api.respan.ai/api/request-logs/unique_id/")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```