API reference

API reference · Agents

Read a run

GET/v1/agents/{id}/runs/{run}API key

Its status, what it spent, its answer, or the calls it waits on. A 404 while hosted runs are off on the deployment.

Parameters

Path and query parameters
FieldTypeWhat it is
id (path)requiredstringThe agent's id; self on an agent's own key.
run (path)requiredstringThe run's id, run_ and 24 hex digits.

Answer 200

The run.

Fields of the 200 answer
FieldTypeWhat it is
objectstringOne of "agent.run".
idstring
agent_idinteger
statusstringOne of "queued", "in_progress", "requires_action", "cancelling", "completed", "incomplete", "failed", "cancelled", "expired".
modelstring
createdinteger
started_atinteger or null
completed_atinteger or null
expires_atinteger
stepsinteger
max_stepsinteger
max_wall_secondsinteger
cost_microsinteger
max_cost_microsinteger
usageobject
usage.prompt_tokensinteger
usage.completion_tokensinteger
output_textstring or null
required_actionobject or null
required_action.typestringOne of "submit_tool_outputs".
required_action.submit_tool_outputsobject
required_action.submit_tool_outputs.tool_callsarray of object
required_action.submit_tool_outputs.tool_calls[].idstring
required_action.submit_tool_outputs.tool_calls[].typestringOne of "function".
required_action.submit_tool_outputs.tool_calls[].functionobject
required_action.expires_atinteger or null
last_errorobject or null
last_error.codestring
last_error.messagestring
incomplete_detailsobject or null
incomplete_details.reasonstringOne of "max_steps", "max_wall_time", "max_cost".
metadataobject or null

Errors

  • 401OpenAI shaped error.
  • 403OpenAI shaped error.
  • 404OpenAI shaped error.

Every error answers in one shape, with its type, code and the field it names. The whole list is in the docs' Errors section.

Antimatter