Trigger agent generation
POST/v1/projects/:project_id/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)
Missing or invalid credentials.
The credential is scoped to a different project, or the caller's role in the project does not carry this action.
The resource does not exist (existence is not leaked).
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 /v1/projects/{project_id}/generations/{generation_id}.