API reference

API reference · Recorder

Read one trace, with its captured bodies

GET/api/traces/{traceId}Signed in session

Scoped to the owning account at the query. Captured bodies are the caller's own prompts: they are never public, never exported to another account, and they disappear once the key's retention window passes.

Parameters

Path and query parameters
FieldTypeWhat it is
traceId (path)requiredstring32 hex characters.

Answer 200

The spans, and the capture when there is one.

Fields of the 200 answer
FieldTypeWhat it is
spansarray of TraceSpan
spans[].spanIdstring
spans[].parentSpanIdstring or null
spans[].namestring
spans[].kindstringOne of "request", "attempt".
spans[].modelstring or null
spans[].upstreamstring or null
spans[].attemptinteger
spans[].retrybooleanTrue when this attempt repeated the previous model and upstream.
spans[].startedAtinteger
spans[].endedAtinteger
spans[].durationMsinteger
spans[].ttftMsinteger or null
spans[].promptTokensinteger
spans[].completionTokensinteger
spans[].costMicrosinteger
spans[].statusinteger or null
spans[].errorstring or null
captureRequestCaptureThe stored request and response. Visible only to the account that made the call, never public, and deleted once expiresAt passes.
capture.traceIdstring
capture.tsinteger
capture.expiresAtintegerWhen this body is deleted.
capture.modelstring
capture.upstreamstring
capture.statusinteger
capture.streamboolean
capture.costMicrosinteger
capture.ttftMsinteger or null
capture.totalMsinteger or null
capture.promptTokensinteger
capture.completionTokensinteger
capture.requestBodystring or nullUntrusted text. Render escaped.
capture.requestBytesintegerThe original size, even when truncated.
capture.requestTruncatedbooleanTrue when the text above is a prefix.
capture.responseBodystring or nullUntrusted text. Render escaped.
capture.responseBytesinteger
capture.responseTruncatedboolean
capture.replayOfstring or null

Errors

  • 400OpenAI shaped error.
  • 401OpenAI shaped error.
  • 404OpenAI shaped error.

Every error answers in one shape, with its type, code and the field it names. The whole list is in the docs' Errors section.

Antimatter