Create Response
Generate a model response using the OpenAI Responses schema. Set stream: true to receive typed server-sent events followed by data: [DONE].
input on each request.Parameter support
Parameter support
model, input, instructions, include (reasoning.encrypted_content), tools, tool_choice, text, temperature, top_p, parallel_tool_calls, stream, max_output_tokens, reasoning, prompt_cache_key, truncation (disabled), and service_tier (auto, default, flex, priority).Accepted but not forwarded to the model: metadata and safety_identifier. Both fields are echoed in the response.Accepted only at their default values: store (false), background (false), presence_penalty (0), and frequency_penalty (0).Rejected with a 400: non-null previous_response_id, store: true, background: true, max_tool_calls, top_logprobs, truncation: "auto", include: ["message.output_text.logprobs"], file or video input, item references, tool_choice with allowed_tools, text.format with json_object, text.format.strict: false, stream_options.include_obfuscation: true, plus any unrecognized top-level field.Notes: Function tools require a description. JSON Schema output always runs in strict mode. stream_options requires stream: true.Streaming
Streaming
stream: true to receive typed server-sent events such as response.created, response.output_text.delta, and response.completed. A successful stream ends with data: [DONE].If an error occurs after streaming begins, the stream emits an error event followed by response.failed and closes without a [DONE] trailer.Errors
Errors
type is invalid_request for invalid requests, not_found when a resource is unavailable, too_many_requests for 429, and server_error for server failures. Retry rate-limit and overload errors after the Retry-After interval. Requests that fail before producing output are not billed.Body
Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
gpt-5 and o-series models only Configuration options for reasoning models.
Response
Successful response. JSON for non-streaming requests; a text/event-stream of typed response events when stream is true.
The complete response object that was returned by the Responses API.
The output items that were generated by the model.
An item representing a message, tool call, tool output, reasoning, or other response element.
- Message
- Function call
- Function call output
- Custom tool call
- Reasoning item