Skip to main content
GET
Get session status
Returns only the live status of a session: current state, step count, token usage, and subagent IDs. It’s the cheapest call for a quick liveness check. To follow a run and read its answer, long-poll changes instead. Returns a status object with the fields below.

Path parameters

id
string
required
The session ID.

Response

status
string
required
Current session state: queued, pending, running, paused, idle, awaiting_tool_results, completed, failed, timed_out, or interrupted.
error
string
Short, stable error message if the session failed or timed out. null otherwise. Branch on error_code, not on this text.
error_code
string
Machine-readable failure category if the session failed or timed out: environment_error, no_answer, answer_validation, timeout, or internal. null otherwise. See Read how the run ended.
outcome
string
The agent’s self-assessed task outcome, reported with its final answer: success, partial, infeasible, or blocked. null until reported. See Read how the run ended.
steps
integer
Number of steps the agent has taken, where each step is one decide-and-act cycle.
usage_per_model
array
Per-model token usage. Each entry is an object with name, input_tokens, output_tokens, and reasoning_tokens. Empty array until the agent calls a model.
subagent_session_ids
array
IDs of the child sessions this session spawned, empty if it ran no subagents. Pull the full roster, each child labeled with its agent, with GET /sessions?parent_session_id={id}.

Examples

Response

Polling pattern

A typical polling loop checks status every few seconds and branches on the result:
For the polling interval, 2 to 5 seconds works well for most use cases. For longer tasks (10+ minutes), back off to 10 to 15 seconds to reduce API calls.