Skip to main content
GET
Get one invocation's trace

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

invocation_key
string
required

The invocation's key — the value sent as its Idempotency-Key, or the one the server returned in that header when it was omitted.

Required string length: 1 - 255

Query Parameters

payloads
boolean
default:true

Whether to include what each span was given and produced. true, the default, returns input and output and the fields that describe them. false returns the same spans without them — everything the span recorded about itself: id, parent_id, type, name, status, started_at, ended_at and usage — which is the cheap way to read an invocation's shape, and it lets limit go up to 500. after carries the mode it was made with, so page with the same payloads you started with and expect a 400 otherwise.

attempts
enum<string>
default:final

Which attempts to return spans for. final, the default, returns only the spans of the latest attempt — the one that produced the invocation's outcome, or the one still in flight; all also returns the spans of the attempts before it, each marked superseded. Either way attempts in the response lists every attempt that ran.

Available options:
final,
all
after
string

Opaque pagination cursor. Return only items positioned after it; pass a value obtained from a previous page to fetch the next one.

limit
integer

Maximum number of spans to return. With payloads at most 25, which is also the default; with payloads=false at most 500, and 500 by default, so one request usually returns a whole trace. A limit above the bound for the mode you asked for is a 400. A page can be shorter, so page while next_cursor is present.

Required range: 1 <= x <= 500

Response

OK

One agent invocation — what it ran, how it ended, and when.

invocation_key
string
required

The invocation's key — the value sent as its Idempotency-Key, or the one the server returned in that header when it was omitted.

session_id
string
required

The session this invocation belongs to.

status
enum<string>
required

How an invocation or one of its attempts ended, or RUNNING while it is still in flight.

Available options:
RUNNING,
SUCCEEDED,
FAILED
spans_expired
boolean
required

Whether the invocation's spans have aged out. Spans are kept for the retention window (currently 90 days) from the invocation's start; the invocation itself is kept, so status and the fields beside it stay readable past it.

started_at
string<date-time>
required

When the invocation was accepted.

session_position
integer
required

Which invocation of its session this is, counting from 1 in the order they were created — the same number as the inv segment of every span's id, so you do not have to read an id to know which invocation you are holding. Invocations are only ever appended, so a position never changes.

Required range: x >= 1
spans
object[]
required

A page of the invocation's spans, oldest first, from its latest attempt unless attempts=all asked for the earlier attempts as well. It can hold fewer than limit, or none at all, while next_cursor is present. Empty once spans_expired is true.

agent_name
string

Name of the agent the invocation ran (e.g. "support-triage"). Absent for an invocation made before agent names were recorded.

agent_revision
string

The agent revision the invocation ran (e.g. "a1b2c3d4"). Absent for an invocation made before revisions were recorded.

ended_at
string<date-time>

When the invocation's outcome was recorded. Absent while it runs.

failure
object

Why the invocation failed. Present only when status is FAILED, and readable past the retention window, since it comes from the invocation rather than its spans. Read it here rather than from GET /traces, which reports only that an invocation failed — listing a page of reasons costs a lookup per invocation on it.

attempts
object[]

Every attempt of the invocation, oldest first, whichever attempts spans came from — so one entry means it ran once, and more than one means the attempts before the last produced nothing that reached its output, while still spending tokens and making any tool calls they made. Read them with attempts=all. Absent once spans_expired is true.

next_cursor
string

Cursor for the next page. Pass it as after to fetch the following spans. Present whenever there may be more spans, however few this page returned; omitted once there are none left, including once spans_expired is true.