The agent execution object
⚠️
Preview — this feature is being built; the design below is the spec.
The agent_execution object as the API returns it. Every field below appears in every response that returns this object; fields with no value are null rather than missing.
Example
{
"id": "exec_01JC7N0Q8S2U4W6Y8A0C",
"type": "agent_execution",
"agent_id": "agt_01JC4R8W6Q2N9X3T5V7Y",
"agent_name": "refund-desk",
"agent_version": 4,
"session_id": "sesn_01JC7M2K4P6R8T0V2X4Z",
"state": "error",
"started_at": "2026-11-05T10:00:01Z",
"ended_at": "2026-11-05T10:00:19Z",
"duration_ms": 18234,
"error": "Tool lookup_order returned an error: order not found",
"usage": {
"input_tokens": 9120,
"cached_input_tokens": 6400,
"output_tokens": 412,
"cost_usd": "0.0294"
},
"trace_count": 7,
"input": {
"message": "Please refund order 88123."
},
"output": null,
"traces": [
{
"step": 2,
"step_type": "tool_call",
"label": "lookup_order",
"input": {
"order_id": "88123"
},
"output": {
"error": "order not found"
},
"error": "order not found",
"started_at": "2026-11-05T10:00:05Z",
"ended_at": "2026-11-05T10:00:06Z",
"duration_ms": 412,
"usage": null
}
],
"traces_truncated": false
}Fields
| Field | Type | Description |
|---|---|---|
id | string | Unique id of this object. |
type | string | The object type, always agent_execution. |
agent_id | string | The related agent. |
agent_name | string | See the endpoint pages below. |
agent_version | integer | See the endpoint pages below. |
session_id | string | The related session. |
state | string | See the endpoint pages below. |
started_at | string | When work began. |
ended_at | string | See the endpoint pages below. |
duration_ms | integer | See the endpoint pages below. |
error | string | Set when something failed: code and message. |
usage | object | Tokens and cost attributed to it. |
trace_count | integer | See the endpoint pages below. |
input | object | Nested detail; see the endpoint pages below. |
output | string or null | See the endpoint pages below. |
traces | array | Nested detail; see the endpoint pages below. |
traces_truncated | boolean | See the endpoint pages below. |
Returned by
GET /v1/agents/executionsGET /v1/agents/executions/{execution_id}POST /v1/agents/executions/{execution_id}/terminate
Was this page helpful?