Every prompt in the session in order: the one that started it, then each follow-up in the
order they ran, then follow-ups still waiting in line (queued). A turn is running until
the session finishes it, then carries that status and its result. A turn that was still open
when the next began ends interrupted; a queued one that could not be delivered ends failed
with its error_code, and one whose message was removed ends cancelled. Cost and tokens are the session's, on GET …/sessions/{session}.
Authenticate with an API key or a signed-in session.
Path parameters
The org's slug or id. A caller with no role in the org gets 404.
A Project's handle (name) or id, resolved inside {org} — OR the
reserved sentinel _ meaning "no Project" (a direct-repo / repo-less
dispatch on POST; "no Project constraint, resolve by session id
alone" everywhere else). A real handle that doesn't match the
session's actual Project is 404.
The session's full id (execution_id).
Responses
200The session's turns.
13 item fields
1 for the prompt that started the session, then one per follow-up in the order they ran. Null for a follow-up waiting in line (queued) or one that failed there: it takes its place when it starts.
queued is a follow-up sent while a turn was running, waiting for its turn.
queuedrunningcompletedneeds_reviewfailedcancelledexpiredinterruptedThe turn's answer, as GET …/sessions/{session}/result returned it when the turn ended.
Why the turn failed: the run's failure code (RUN_FAILED, HARNESS_EXITED, TOKEN_LIMIT_REACHED, …), or for a queued follow-up that never ran, why (ATTACHMENT_EXPIRED, TASK_TERMINAL, DELIVERY_RETRIES_EXHAUSTED or the delivery refusal). A turn that ran and failed spent its run time, so resend only one that never ran. Absent when the turn did not fail, and on turns that ran and ended before migration 408.
When the turn started, or for a queued one when it was sent.
The turn's own tokens, as its harness reported them when it ended. Absent until then, and on a turn that reported none.
What the provider billed for this turn's model calls so far, from the ledger the session's total_cost_usd
is settled from: each call counts toward the turn that had started last when the call was logged,
so once the session has finished its turns add up to its total_cost_usd. 0 for a run on a person's
own model account, which they pay the provider for. Absent on a turn that never started (queued,
or failed or cancelled in the queue).
401No bearer, an unknown, revoked or expired one, or an API key on a route keys cannot call.
A sentence for a person.
Stable machine code, e.g. AUTH_FAILED, NOT_FOUND, VALIDATION_ERROR, RATE_LIMITED, TOKEN_LIMIT_REACHED.
The machine code on routes that name it this way.
404No such resource for the caller, including one in an org the caller is not in or a Project that is private to someone else.
A sentence for a person.
Stable machine code, e.g. AUTH_FAILED, NOT_FOUND, VALIDATION_ERROR, RATE_LIMITED, TOKEN_LIMIT_REACHED.
The machine code on routes that name it this way.
429The account is over its request budget, 1,800 a minute shared by the person's API keys and console on every API host (RATE_LIMITED).
The account is over its request budget, 1,800 a minute shared by the person's API keys and console on every API host (RATE_LIMITED). The error names the limit. Wait Retry-After seconds.
A sentence for a person.
Stable machine code, e.g. AUTH_FAILED, NOT_FOUND, VALIDATION_ERROR, RATE_LIMITED, TOKEN_LIMIT_REACHED.
The machine code on routes that name it this way.