4e064cf81dae

latestOpenAPI 3.1.02026-08-131831,331960.0 KB
traces

Retrieve a trace

Retrieve a single trace by trace_unique_id, including aggregate metrics and the full span tree. Metadata keys beginning with _ are reserved for platform use and are omitted from customer-facing span and trace responses, so they do not round-trip through read APIs.

get/api/traces/{trace_unique_id}/

Path parameters

trace_unique_idstring required

Unique trace identifier.

Headers

Authorizationstring required

Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer <RESPAN_API_KEY>. 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.

Response

Trace detail with span tree.

idstring

Trace identifier.

trace_unique_idstring

Unique trace identifier.

root_span_unique_idstring

Root span ID for the trace.

unique_organization_idstring

Organization unique ID.

organization_idstring

Alias of unique_organization_id.

organization_namestring

Organization name when available.

organization_key_idstring

API key identifier used to create the trace.

environmentstring

Environment for the trace.

customer_identifierstring

Customer or user identifier.

start_timestring date-time

When the trace started.

end_timestring date-time

When the trace ended.

durationnumber double

Total duration in seconds.

span_countinteger

Total spans in the trace.

llm_call_countinteger

Number of LLM-call spans.

total_costnumber double

Total cost in USD.

total_prompt_tokensinteger

Sum of prompt tokens.

total_completion_tokensinteger

Sum of completion tokens.

total_tokensinteger

Sum of all tokens.

error_countinteger

Number of error spans.

namestring

Root span name.

inputstring

Root span input. API key responses may include full storage-enriched content.

outputstring

Root span output. API key responses may include full storage-enriched content.

metadataApiTracesTraceUniqueIdGetResponsesContentApplicationJsonSchemaMetadata

Customer metadata. Keys beginning with _ are reserved and omitted from customer-facing responses.

trace_group_identifierstring

Workflow or trace-group identifier.

session_identifierstring

Session identifier when present.

modelstring

Primary/root model used.

storage_object_keystring

Storage object key for the root span payload when present.