List the turns of a session

GET/o/{org}/p/{project}/sessions/{session}/turns
View .md

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

orgstringrequired

The org's slug or id. A caller with no role in the org gets 404.

projectstringrequired

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.

sessionstringrequired

The session's full id (execution_id).

Responses

200The session's turns.
turnsarray of Turnrequired
13 item fields
idstringrequired
Format uuid
ordinalinteger | nullrequired

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.

min 1
statusstringrequired

queued is a follow-up sent while a turn was running, waiting for its turn.

One ofqueuedrunningcompletedneeds_reviewfailedcancelledexpiredinterrupted
promptstring | nullrequired
resultanyrequired

The turn's answer, as GET …/sessions/{session}/result returned it when the turn ended.

error_codestringoptional

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.

started_atstringrequired

When the turn started, or for a queued one when it was sent.

Format date-time
ended_atstring | nullrequired
Format date-time
input_tokensintegeroptional

The turn's own tokens, as its harness reported them when it ended. Absent until then, and on a turn that reported none.

min 0
output_tokensintegeroptional
min 0
cache_read_tokensintegeroptional
min 0
reasoning_tokensintegeroptional
min 0
total_cost_usdnumberoptional

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

min 0
401No bearer, an unknown, revoked or expired one, or an API key on a route keys cannot call.
errorstringoptional

A sentence for a person.

codestringoptional

Stable machine code, e.g. AUTH_FAILED, NOT_FOUND, VALIDATION_ERROR, RATE_LIMITED, TOKEN_LIMIT_REACHED.

error_codestringoptional

The machine code on routes that name it this way.

messagestringoptional
requestIdstringoptional
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.
errorstringoptional

A sentence for a person.

codestringoptional

Stable machine code, e.g. AUTH_FAILED, NOT_FOUND, VALIDATION_ERROR, RATE_LIMITED, TOKEN_LIMIT_REACHED.

error_codestringoptional

The machine code on routes that name it this way.

messagestringoptional
requestIdstringoptional
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.

errorstringoptional

A sentence for a person.

codestringoptional

Stable machine code, e.g. AUTH_FAILED, NOT_FOUND, VALIDATION_ERROR, RATE_LIMITED, TOKEN_LIMIT_REACHED.

error_codestringoptional

The machine code on routes that name it this way.

messagestringoptional
requestIdstringoptional