Create a Response

Generate model output with the OpenAI-compatible Responses API.

Use the Responses API shape for text or structured model input and a unified output object.

POST/openai/v1/responses

Request Body

FieldTypeRequiredDescription
modelstringYesModel identifier routed by AnyInt.
inputstring or arrayYesText or structured input items.
streambooleanNoReturn server-sent events when supported.
reasoning.effortstringNoModel-dependent effort, forwarded without silently reducing it.
toolsarrayNoTool declarations, including custom tools.

Response

A completed request returns a response object with an identifier, status, and generated output.

Tool History and Validation

Custom tool calls and multipart tool outputs retain their ordering and Unicode text. Empty annotations and logprobs arrays are supplied for assistant output_text parts when omitted or null, so a relay cannot reconstruct them as invalid null metadata. Provider keep-alive messages are excluded from conversation history.

Reasoning effort support depends on the selected model and upstream. A structured rejection identifies the field, for example error.code: "invalid_value" and error.param: "reasoning.effort". Unlocatable or relay-generated format rejections return an upstream error instead of identifying valid client history as malformed.

Streaming and Recovery

Successful streams end with response.completed; output limits can end with response.incomplete. An upstream failure, timeout or early EOF produces response.failed. Failed streams do not receive a fabricated successful terminal or a legacy [DONE] marker. Check the terminal event even when HTTP status is 200. A terminal stream failure does not authorize automatically replaying dispatched work.

Heartbeats use SSE comments. Provider response.metadata events and SSE-Keep-Alive output items are filtered. Event sequence_number values increase monotonically.

The optional x-client-message-id and x-resume-message-id headers opt into event-offset recovery. x-anyint-resume-offset-unit: sse-event describes that offset; x-anyint-stream-replayed: true identifies a replay. Clients that do not opt in can ignore these extension headers.

Compatibility Alias

Existing clients may continue to use /v1/responses. New integrations should use /openai/v1/responses.