Create a model response
POST/responses
OpenAI's Responses API (client.responses.create in the OpenAI SDKs) over the same chat models as POST /v1/chat/completions, with the same keys, prices and limits.
Stateless. Nothing is stored, so the whole conversation goes in input on every request. store: true, previous_response_id, conversation, background: true and stored prompt templates are refused with 400, every response says "store": false, and the routes under /v1/responses/ (retrieve, delete, cancel, input items, compact, input tokens) answer 404.
Served:
- text and inline images,
instructions, and the items of earlier turns; - function tools (
tools,tool_choice,parallel_tool_calls); text.format(text,json_object,json_schema);reasoning.effort, with the reasoning returned in plain text in areasoningitem;max_output_tokens,temperature,top_p.
Streaming. With stream: true the body is a text/event-stream of Responses events (event: line plus JSON with type and sequence_number), in this order:
response.created, thenresponse.in_progress;- each output item:
response.output_item.added, its content part, the deltas (response.output_text.delta,response.reasoning_text.delta,response.function_call_arguments.delta) and the matchingdoneevents; - exactly one of
response.completed,response.incompleteorresponse.failed, carrying the full response.
No [DONE] follows. See the Responses API guide.
Request
Responses
- 200
- 400
- 401
- 404
- 413
- 429
- 500
- 503
The response. With stream: true, a text/event-stream of ResponseStreamEvent objects instead, ending with response.completed, response.incomplete or response.failed.
The request was refused before reaching the model. Causes:
- a stateful parameter:
store: true,previous_response_id,conversation,background: true,promptor anitem_referenceitem. The API is stateless; - a hosted tool (
web_search,file_search,code_interpreter,computer_use,image_generation,mcp, custom tools) or its items ininput. In Codex, turn web search off withweb_search = "disabled"inconfig.toml; - a file input, or an image by URL or file id: images must be inline base64 data URLs;
- logprobs,
truncation: "auto",context_management(compaction) or an unknown parameter (such as chat'smessages); - more images than the model reads, counted over the whole
input: from 1 to 8 depending on the model (code: too_many_images,param: input); - any invalid value, or input longer than the context window (
context_length_exceeded).
param names the field at fault in the Responses API's terms (input, max_output_tokens, tools[0].type).
Missing or invalid API key.
The requested model does not exist or is not available to this key.
The request body is larger than the gateway accepts (4 MB).
Rate limit exceeded, or the service is temporarily at capacity for this model. Wait for the number of seconds in the Retry-After header before retrying.
Response Headers
Seconds to wait before retrying.
Unexpected server error: the model service returned an unexpected response (upstream_error), the request got no answer within 600 seconds (timeout), or an error in the gateway. Retry with backoff.
The model service is temporarily unavailable. Retry later and check the status page at https://status.serenityedge.ai.