Skip to main content

Generate a response

POST 

/v1/projects/:project_id/agents/:agent_id/sessions/:session_id/generate

Runs the agent over the session's accumulated messages.

Background by default: this returns 202 immediately and the turn runs on. The reply lands in the transcript, so poll GET /v1/projects/{project_id}/agents/{agent_id}/sessions/{session_id}/messages for the assistant message, or read the session for its status.

Pass ?wait=true to block instead and receive the turn itself: status is completed with the assistant message, or requires_action with the pending required_action tool calls.

model overrides the agent's default model for this turn only.

Request

Responses

The settled turn — the agent's reply or a requires_action turn. Returned only with wait=true.