Turn Object
Unique turn identifier (e.g.,
turn_456)Array of items in this turn
Only populated on
thread/resume or thread/fork responses. For all other responses and notifications, this field is an empty array. Use item/* notifications to track items.Current turn status
inProgress- Turn is actively runningcompleted- Turn finished successfullyinterrupted- Turn was cancelledfailed- Turn encountered an error
Error details (only populated when
status is failed)Start a Turn
Send user input to a thread and begin Codex generation.Method
Parameters
Thread ID to add the turn to
Array of user input items
Override working directory for this turn and subsequent turns
Override approval policy
Override sandbox policy
Override model for this turn and subsequent turns
Override reasoning effort (
low, medium, high)Override reasoning summary mode (
concise, verbose)JSON Schema to constrain the final assistant message (applies only to this turn)
Response
Initial turn object with
status: "inProgress" and empty items arrayNotifications
The server streams JSON-RPC notifications while the turn is running:item/* notifications
See Items for full item lifecycle
item/started- New item beginsitem/agentMessage/delta- Streamed textitem/completed- Item finishes
Example: Basic Turn
Example: Invoke a Skill
Include$<skill-name> in the text input and add a skill input item.
Example: Invoke an App
Include$<app-slug> in text and add a mention input with app://<connector-id>.
Interrupt a Turn
Cancel a running turn.Method
Parameters
Thread ID
Turn ID to interrupt
Response
Empty object on success
Notifications
After interruption, the server emitsturn/completed with status: "interrupted".
Example
Steer a Turn
Append additional user input to a currently active turn without starting a new turn.Method
Parameters
Thread ID
Additional user input to append
Required active turn ID precondition. Fails if no active turn or ID doesn’t match.
Response
The active turn ID that accepted the input
Example
Turn Notifications
turn/started
Emitted when a turn beginsPayload:
{ threadId: string, turn: Turn }turn/completed
Emitted when a turn finishes (completed, interrupted, or failed)Payload:
{ threadId: string, turn: Turn }turn/diff/updated
Emitted after every
fileChange item with turn-level unified diffPayload: { threadId: string, turnId: string, diff: string }turn/plan/updated
Emitted when the agent shares or changes its planPayload:
model/rerouted
Emitted when the backend reroutes to a different modelPayload:
{ threadId: string, turnId: string, fromModel: string, toModel: string, reason: string }error
Emitted on mid-turn errorsPayload:
{ error: TurnError, willRetry: boolean, threadId: string, turnId: string }Next Steps
Items
Understand item types and streaming notifications
Models
List available models and their capabilities