05
Runs and streaming
Core platform1 min read
Create, observe, cancel, resume, and replay durable agent runs.
| Method | Endpoint | Purpose |
|---|---|---|
| POST | /v1/runs | Create an idempotent run |
| GET | /v1/runs/{run_id} | Read current run state |
| GET | /v1/runs/{run_id}/events | Stream resumable SSE events |
| POST | /v1/runs/{run_id}/cancel | Cancel work across service boundaries |
| GET | /v1/runs/{run_id}/artifacts | List generated artifacts |
const run = await client.createRun({ prompt: 'Research Base liquidity and produce a report', idempotencyKey: crypto.randomUUID(),});const stop = client.streamRunEvents(run.runId, (event, frame) => { console.log(frame.sequenceId, event.type);}, { lastEventId: 0 });Resume safely
Persist the last SSE sequence and reconnect with Last-Event-ID. Reuse the original idempotency key when retrying run creation after a timeout.
Was this page helpful?
Edit on GitHub