v64

latestOpenAPI 3.1.0raw.githubusercontent.com2026-08-03124241726.5 KB
Traces

Get trace span

Returns one span by id, including the LLM conversation (system instructions, input messages, output messages), tool data (definitions, call id, input, output), and the full OpenTelemetry payload (attributes, resource, events, links) that's excluded from the lighter list shape.

get/v1/projects/{projectSlug}/traces/{traceId}/spans/{spanId}

Path parameters

projectSlugstring required

Project slug (human-readable identifier)

Project slug (human-readable identifier)

traceIdstring required

32-character trace identifier.

32-character trace identifier.

spanIdstring required

16-character span identifier.

16-character span identifier.

Response

Span detail

organizationIdstring required

Organization that owns this span.

projectIdstring required

Project this span belongs to.

traceIdstring required

Identifier of the trace this span belongs to.

spanIdstring required

Stable span identifier within the trace.

parentSpanIdstring nullable required

Identifier of the parent span. null for root spans.

sessionIdstring nullable required

Conversation/session identifier set by the SDK. null when absent.

userIdstring nullable required

End-user identifier set by the SDK. null when absent.

simulationIdstring nullable required

CUID of the simulation that produced this span. null when not a simulation.

apiKeyIdstring nullable required

Latitude API key used to ingest the span. null when ingested without an API key.

startTimestring required

ISO-8601 timestamp at which the span started.

endTimestring required

ISO-8601 timestamp at which the span ended.

namestring required

Span name (e.g. the entry-point function or route).

serviceNamestring required

OpenTelemetry service.name of the emitting service.

kind'unspecified' | 'internal' | 'server' | 'client' | 'producer' | 'consumer' required

OpenTelemetry span kind.

statusCode'unset' | 'ok' | 'error' required

OpenTelemetry span status code.

statusMessagestring required

OpenTelemetry status message. Empty when not set.

traceFlagsnumber required

OpenTelemetry trace flags bitfield.

traceStatestring required

OpenTelemetry trace state (vendor-specific propagation). Empty when not set.

errorTypestring nullable required

Error class/type label when the span errored. null for successful spans.

tagsstring[] required

Free-form tags attached at ingest time.

operationstring required

GenAI operation category (e.g. "chat", "embeddings", "execute_tool", "invoke_agent") or a custom string for non-GenAI spans.

providerstring nullable required

LLM provider id. null for non-LLM spans.

modelstring nullable required

Model id as requested. null for non-LLM spans.

responseModelstring nullable required

Model id reported by the provider's response. null for non-LLM spans.

tokensInputnumber required

Input tokens consumed by this span.

tokensOutputnumber required

Output tokens produced by this span.

tokensCacheReadnumber required

Tokens served from the provider's prompt cache.

tokensCacheCreatenumber required

Tokens written to the provider's prompt cache.

tokensReasoningnumber required

Reasoning tokens reported by the model.

costInputMicrocentsnumber required

Cost of input tokens in microcents (1/1,000,000 USD).

costOutputMicrocentsnumber required

Cost of output tokens in microcents (1/1,000,000 USD).

costTotalMicrocentsnumber required

Total cost in microcents (1/1,000,000 USD).

costIsEstimatedboolean required

true when the cost was derived from public pricing tables instead of the provider's bill.

timeToFirstTokenNsnumber required

Nanoseconds from the start of the span to its first emitted token. 0 if not measured.

isStreamingboolean required

true when the span was produced by a streaming LLM call.

responseIdstring nullable required

Response identifier returned by the LLM. null when the provider didn't return one.

finishReasonsstring[] required

Per-choice finish reasons reported by the LLM provider.

scopeNamestring required

OpenTelemetry instrumentation scope name. Empty when not set.

scopeVersionstring required

OpenTelemetry instrumentation scope version. Empty when not set.

retentionDaysinteger

Per-span retention override in days. Omitted when the project default applies.

ingestedAtstring required

ISO-8601 timestamp at which Latitude received this span.

metadataobject required

Free-form metadata attached at ingest time.

systemInstructionsobject[] required

System instructions in OpenTelemetry GenAI format — an array of part objects.

inputMessagesGenAISpanMessage[] required

Input messages sent into this LLM span, in OpenTelemetry GenAI format.

outputMessagesGenAISpanMessage[] required

Output messages returned by this LLM span, in OpenTelemetry GenAI format.

toolCallIdstring required

Tool-call id this span answers. Empty when the span isn't an execute_tool span.

toolNamestring required

Name of the executed tool. Empty when the span isn't an execute_tool span.

toolInputstring required

Stringified arguments passed to the tool. Empty when the span isn't an execute_tool span.

toolOutputstring required

Stringified tool output. Empty when the span isn't an execute_tool span.

attrStringobject required

OpenTelemetry attributes with string values.

attrIntobject required

OpenTelemetry attributes with integer values.

attrFloatobject required

OpenTelemetry attributes with floating-point values.

attrBoolobject required

OpenTelemetry attributes with boolean values.

resourceStringobject required

OpenTelemetry resource attributes captured at ingest.

eventsJsonstring required

JSON-encoded OpenTelemetry events array. Empty when the span has no events.

linksJsonstring required

JSON-encoded OpenTelemetry span-links array. Empty when the span has no links.