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
- 429
- 502
Agent reply or requires_action (only when ?wait=true)
Generation accepted and running in the background (default, when wait is omitted or false)
Authentication required
Insufficient permissions
Not found
Generation already in progress
Session has expired due to inactivity
QUOTA_EXCEEDED: an enforce-mode generation quota is exhausted. error.meta carries quota_id, metric, limit, window and resets_at, with a Retry-After header. Only with ?wait=true: a background call is answered 202 before the quota is read.
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}.