Hanzo
OpenapiO11y

Lists LLM traces — gen_ai spans grouped by trace_id, with cost, tokens and…

Lists LLM traces — gen_ai spans grouped by trace_id, with cost, tokens and latency rolled up across each trace.

GET /v1/o11y/llm/traces

Addresshttps://api.hanzo.ai/v1/o11y/llm/traces
MethodGET
OperationListLLMTraces
AuthAuthorization: Bearer $HANZO_API_KEY

Lists LLM traces — gen_ai spans grouped by trace_id, with cost, tokens and latency rolled up across each trace.

Callers need the viewer role; the runtime's own gate enforces it.

Request

9 fields.

FieldInTypeRequiredDescription
startqueryintegerStart is the start of the window as a unix-millisecond epoch.
endqueryintegerEnd is the end of the window as a unix-millisecond epoch.
traceIdquerystringTraceID narrows the view to one trace.
sessionIdquerystringSessionID narrows the view to one conversation.
userIdquerystringUserID narrows the view to one end user.
namequerystringName narrows the view to observations of one name.
modelquerystringModel narrows the view to one model.
offsetqueryintegerOffset is how many rows to skip, for paging.
limitqueryintegerLimit caps how many rows come back.

Response

StatusBodyMeaning
200o11y.O11yLLMTracesOutok

200 body — 15 fields.

FieldInTypeAlwaysDescription
databodyo11y.O11yLLMTracesPage
data.itemsbodyo11y.O11yLLMTrace[]Items are the traces, newest first.
data.items[].completionTokensbodyintegerCompletionTokens is the trace's total output tokens.
data.items[].idbodystringID is the trace id.
data.items[].latencyMsbodynumberLatencyMs is the trace's span, in milliseconds.
data.items[].observationsbodyintegerObservations is how many observations the trace holds.
data.items[].promptTokensbodyintegerPromptTokens is the trace's total input tokens.
data.items[].serviceNamebodystringServiceName is the app that emitted it.
data.items[].sessionIdbodystringSessionID is the conversation the trace belongs to.
data.items[].totalCostbodynumberTotalCost is the trace's total cost.
data.items[].totalTokensbodyintegerTotalTokens is the trace's total tokens.
data.items[].userIdbodystringUserID is the end user the trace is attributed to.
data.limitbodyintegerLimit is the page cap the read ran with.
data.offsetbodyintegerOffset is the row offset this page started at.
statusbodystringStatus is "success".

Failure carries the platform error shape — see Errors.

Examples

hanzo o11y llm traces

O11y API · All Hanzo APIs · Interactive reference

How is this guide?

On this page