Skip to content
Open app

Responses

Create a response with the OpenAI Responses API. This is the endpoint Codex uses.

POST/v1/responses

Follows OpenAI's Responses format. The body is forwarded once it passes the gateway's checks, after a model id that is not the catalog id is replaced with that id. A trailing [1m] is removed. models, fallbacks, route, provider, plugins that add a fee, tool types other than function, custom and the supported web-search tools, x_search and audio input each return 400 unsupported_parameter. A file sent to a model without file input also returns 400 unless the request asks for the free parser: "plugins": [{ "id": "file-parser", "pdf": { "engine": "cloudflare-ai" } }]. Responses runs statelessly: send the whole conversation in input on every request. Send the key as Authorization: Bearer sk-df-....

Send a request

curl https://deference.si/v1/responses \
  -H "Authorization: Bearer $DEFERENCE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "anthropic/claude-sonnet-5.5",
    "input": "Say hello in one sentence."
  }'

Request body

modelstringRequired
The model id.
inputstring | arrayRequired
A prompt, or a list of input items for a conversation.
instructionsstring
System-level instructions.
streamboolean
Return server-sent events. Codex sets it.
toolsarray
Tools the model may call.
max_output_tokensinteger
The output limit. Also sets the credit held while the request runs.
reasoningobject
Reasoning settings, for models that support them.
storeboolean
Leave unset or false. Stored responses are not supported and return 400.
previous_response_idstring
Not supported. Send the full conversation in input.

Streaming

A stream ends with response.completed, response.incomplete (the reason is in incomplete_details) or response.failed; an error event can end it instead. Each final event carries the final response object, with its usage when the provider reports it. Codex waits for response.completed. See Streaming events.

Models

Each model reads Responses requests in its own way. If a model fails with a Codex-style request, try another. See Codex.