Trigger agent generation
POST/api/v1/sessions/:session_id/generate
Triggers the agent to generate a response based on the current conversation. Background by default: returns 202 Accepted immediately while the generation runs. Pass ?wait=true to block and receive the assistant reply (or a requires_action status if the agent needs client tool outputs) in the response.
Request
Responses
- 200
- 202
- 401
- 403
- 404
- 409
- 410
- 502
Agent reply or requires_action (only when ?wait=true)
Generation accepted and running in the background (default, when wait is omitted or false)
Unauthorized
Forbidden
Not found
Generation already in progress
Session has expired due to inactivity
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}.