Run an agent generation
POST/api/v1/agents/:agent_id/generate
Sends messages to the agent, resolves its tools, and runs the AI model loop. Supports streaming via stream: true. Client tools pause the generation and return requires_action.
Request
Responses
- 200
- 400
- 401
- 403
- 404
- 502
Generation result or SSE stream
Bad Request
Unauthorized
Forbidden
Agent or AI provider not found
Upstream AI provider error (AI_PROVIDER_ERROR). The error meta includes the generation_id and trace_id of the failed generation for post-mortem debugging via GET /api/v1/generations/{generation_id}.