Hanzo
OpenapiO11y

Lists gen_ai spans as LLM observations — each an LLM call with its model, token…

Lists gen_ai spans as LLM observations — each an LLM call with its model, token counts, cost and latency projected from gen_ai.* attributes, newest first,…

GET /v1/o11y/llm/observations

Addresshttps://api.hanzo.ai/v1/o11y/llm/observations
MethodGET
OperationListLLMObservations
AuthAuthorization: Bearer $HANZO_API_KEY

Lists gen_ai spans as LLM observations — each an LLM call with its model, token counts, cost and latency projected from gen_ai.* attributes, newest first, over the query window.

Callers need the viewer role; the runtime's own gate enforces it, and scopes the read to the caller's validated tenant.

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.O11yLLMObservationsOutok

200 body — 22 fields.

FieldInTypeAlwaysDescription
databodyo11y.O11yLLMObservationsPage
data.itemsbodyo11y.O11yLLMObservation[]Items are the observations, newest first.
data.items[].completionTokensbodyintegerCompletionTokens is the output token count.
data.items[].idbodystringID is the observation's id (the span id).
data.items[].latencyMsbodynumberLatencyMs is how long it took, in milliseconds.
data.items[].modelbodystringModel is the model that served it.
data.items[].namebodystringName is the observation's name.
data.items[].parentObservationIdbodystringParentID is the parent observation, when the span has one.
data.items[].promptTokensbodyintegerPromptTokens is the input token count.
data.items[].providerbodystringProvider is the model's provider.
data.items[].serviceNamebodystringServiceName is the app that emitted it.
data.items[].sessionIdbodystringSessionID is the conversation the observation belongs to.
data.items[].startTimebodystring (date-time)StartTime is when the observation started.
data.items[].statusCodebodystringStatusCode is the observation's status, e.g.
data.items[].totalCostbodynumberTotalCost is the observation's cost.
data.items[].totalTokensbodyintegerTotalTokens is the sum of prompt and completion tokens.
data.items[].traceIdbodystringTraceID is the trace the observation belongs to.
data.items[].typebodystringType is the observation kind, e.g.
data.items[].userIdbodystringUserID is the end user the observation 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 observations

O11y API · All Hanzo APIs · Interactive reference

How is this guide?

On this page