API reference · Agents
Follow a run's events
GET/v1/agents/{id}/runs/{run}/eventsAPI key
JSON after ?after=<n> (?limit, 100 at most), or with Accept: text/event-stream (or ?stream=true) server sent events whose ids are the event numbers: the stream replays from the larger of ?after and Last-Event-ID, follows the run, and closes at its end or after a few minutes, to be resumed. A 404 while hosted runs are off on the deployment.
Parameters
| Field | Type | What it is |
|---|---|---|
| id (path)required | string | The agent's id; self on an agent's own key. |
| run (path)required | string | The run's id, run_ and 24 hex digits. |
| after (query) | integer | The last event number seen. |
| limit (query) | integer | At most 100, JSON only. |
| stream (query) | string | true for server sent events. |
Answer 200
The events.
| Field | Type | What it is |
|---|---|---|
| object | string | One of "list". |
| data | array of object | |
| data[] | string | One of "agent.run.event". |
| data[] | integer | Numbered from 1 per run; the SSE id. |
| data[] | string | run.created, run.in_progress, run.message, run.tool_call, run.tool_output, run.image, run.step.failed, run.requires_action, and one of run.completed, run.incomplete, run.failed, run.cancelled, run.expired last. |
| data[] | integer | |
| data[] | object | |
| has_more | boolean |
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.