Skip to main content
Use background execution when a Responses API request should return before model execution completes. Set background to true on POST /v3/router/responses. The AI Gateway stores the response, returns its ID with status: "queued", and processes it asynchronously. Poll GET /v3/router/responses/{response_id} with the same ID until the response reaches a terminal status. See the Responses API reference for the complete request and response schema.

Quick start

The following examples submit a background response, then poll until processing finishes. Set store to true; background responses require stored responses.

Response lifecycle

The create request returns the response object with a stable id. Retrieve that same object while it progresses through the following statuses: Completed responses include output and completed_at. Failed responses retain the response ID so the error can be retrieved with the same GET request.

Configuration and limitations

Background execution uses the standard Responses API model, input, tools, and response schema. The asynchronous behavior changes when the result becomes available, not the shape of the final response.