AI Gateway
post/ai/v1/responses

Request

  • Base URL: /api (relative, and the document was published on a file host, not at the API’s origin)
  • URL: /api/ai/v1/responses
  • Auth: HTTP bearer

Request body

backgroundboolean nullable

Run asynchronously and poll for the result. Requires your own provider key: the result is fetched from the provider account.

conversationobject nullable

Attach the response to a stored conversation. Requires your own provider key, for the same reason as previous_response_id.

modelstring required

Model to run, e.g. gpt-6-luna. Must be served by OpenAI.

previous_response_idstring nullable

Continue from a stored response. Requires your own provider key (X-Provider-Api-Key), because stored responses live in the provider account that created them.

streamboolean

Stream the reply as server-sent events.

Response

JSON when stream=false, SSE when stream=true. Generated SDKs use the explicit /json and /stream operations.

idstring required
modelstring required
objectstring required

Always response

statusstring nullable

completed, incomplete, failed, in_progress, …

Changes