# Agents (/docs/api/gateway/agents)

Run a server-side agent synchronously or as an async run you poll, stream or cancel.

The agents API wraps the gateway's own tool-using loop. Synchronous runs return the answer inline; async runs return `202` with an id you poll, stream over SSE (full replay on reconnect — no `Last-Event-ID`) or cancel. Concepts and limits: [agents guide](../../agents/index.mdx).

<OpenAPIPage document="./openapi/en/gateway.yaml" operations={[{path: '/v1/agents/run',method: 'post'},{path: '/v1/agents/runs',method: 'post'},{path: '/v1/agents/runs/stats',method: 'get'},{path: '/v1/agents/runs/{id}',method: 'get'},{path: '/v1/agents/runs/{id}/steps',method: 'get'},{path: '/v1/agents/runs/{id}/stream',method: 'get'},{path: '/v1/agents/runs/{id}/cancel',method: 'post'}]} />
