Reference Endpoints

OpenAPI JSON

Create a response

POST/v1/responses

Generate text, execute tools, and handle multi-turn conversations.

Headers 2 required headers
Content-Type
application/json or application/x-www-form-urlencoded
Authorization
Authorization token, usually Bearer [secret token].

Body parameters

Supply parameters as application/json or application/x-www-form-urlencoded.

modeloptional
string | null
The model to use for this request, e.g. 'gpt-5.2'.
inputoptional
string | ItemParam[] | null
Context to provide to the model for the scope of this request. May either be a string or an array of input items. If a string is provided, it is interpreted as a user message.
Example
{
  "model": "your-model",
  "input": "Say hello"
}
Input types
previous_response_idoptional
string | null
The ID of the response to use as the prior turn for this request.
includeoptional
Allowed values
reasoning.encrypted_content
includes encrypted reasoning content so that it may be rehydrated on a subsequent request.
message.output_text.logprobs
includes sampled logprobs in assistant messages.
toolsoptional
ResponsesToolParam[] | null
A list of tools that the model may call while generating the response.
Accepted types
tool_choiceoptional
ToolChoiceParam | null
Controls which tool the model should use, if any.
Accepted types
metadataoptional
MetadataParam | null
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.
Accepted types
textoptional
TextParam | null
Configuration options for text output.
Accepted types
temperatureoptional
number | null
Sampling temperature to use, between 0 and 2. Higher values make the output more random.
top_poptional
number | null
Nucleus sampling parameter, between 0 and 1. The model considers only the tokens with the top cumulative probability.
presence_penaltyoptional
number | null
Penalizes new tokens based on whether they appear in the text so far.
frequency_penaltyoptional
number | null
Penalizes new tokens based on their frequency in the text so far.
parallel_tool_callsoptional
boolean | null
Whether the model may call multiple tools in parallel.
streamoptional
boolean
Whether to stream response events as server-sent events.
stream_optionsoptional
StreamOptionsParam | null
Options that control streamed response behavior.
Accepted types
backgroundoptional
boolean
Whether to run the request in the background and return immediately.
max_output_tokensoptional
integer | null
The maximum number of tokens the model may generate for this response.
max_tool_callsoptional
integer | null
The maximum number of tool calls the model may make while generating the response.
reasoningoptional
ReasoningParam | null
Configuration options for reasoning behavior.
Accepted types
safety_identifieroptional
string | null
A stable identifier used for safety monitoring and abuse detection.
prompt_cache_keyoptional
string | null
A key to use when reading from or writing to the prompt cache.
truncationoptional
Controls how the service truncates the input when it exceeds the model context window.
Allowed values
auto
Let the service decide how to truncate.
disabled
Disable service truncation. Context over the model's context limit will result in a 400 error.
instructionsoptional
string | null
Additional instructions to guide the model for this request.
storeoptional
boolean
Whether to store the response so it can be retrieved later.
service_tieroptional
The service tier to use for this request.
Allowed values
auto
Choose a service tier automatically based on current account state.
default
Choose the default service tier.
flex
Choose the flex service tier.
priority
Choose the priority service tier.
top_logprobsoptional
integer | null
The number of most likely tokens to return at each position, along with their log probabilities.
Headers 1 required header
Content-Type
application/json or text/event-stream

Response body

idrequired
string
The unique ID of the response that was created.
objectrequired
"response"
The object type, which was always response.
created_atrequired
integer
The Unix timestamp (in seconds) for when the response was created.
completed_atrequired
integer | null
The Unix timestamp (in seconds) for when the response was completed, if it was completed.
statusrequired
string
The status that was set for the response.
incomplete_detailsrequired
IncompleteDetails | null
Details about why the response was incomplete, if applicable.
Accepted types
modelrequired
string
The model that generated this response.
previous_response_idrequired
string | null
The ID of the previous response in the chain that was referenced, if any.
instructionsrequired
string | null
Additional instructions that were used to guide the model for this response.
outputrequired
The output items that were generated by the model.
errorrequired
Error | null
The error that occurred, if the response failed.
Accepted types
toolsrequired
The tools that were available to the model during response generation.
tool_choicerequired
object | ToolChoiceValueEnum
truncationrequired
How the input was truncated by the service when it exceeded the model context window.
Allowed values
auto
Let the service decide how to truncate.
disabled
Disable service truncation. Context over the model's context limit will result in a 400 error.
parallel_tool_callsrequired
boolean
Whether the model was allowed to call multiple tools in parallel.
textrequired
Configuration options for text output that were used.
top_prequired
number
The nucleus sampling parameter that was used for this response.
presence_penaltyrequired
number
The presence penalty that was used to penalize new tokens based on whether they appear in the text so far.
frequency_penaltyrequired
number
The frequency penalty that was used to penalize new tokens based on their frequency in the text so far.
top_logprobsrequired
integer
The number of most likely tokens that were returned at each position, along with their log probabilities.
temperaturerequired
number
The sampling temperature that was used for this response.
reasoningrequired
Reasoning | null
Reasoning configuration and outputs that were produced for this response.
Accepted types
usagerequired
Usage | null
Token usage statistics that were recorded for the response, if available.
Accepted types
max_output_tokensrequired
integer | null
The maximum number of tokens the model was allowed to generate for this response.
max_tool_callsrequired
integer | null
The maximum number of tool calls the model was allowed to make while generating the response.
storerequired
boolean
Whether this response was stored so it can be retrieved later.
backgroundrequired
boolean
Whether this request was run in the background.
service_tierrequired
string
The service tier that was used for this response.
metadatarequired
unknown
Developer-defined metadata that was associated with the response.
safety_identifierrequired
string | null
A stable identifier that was used for safety monitoring and abuse detection.
prompt_cache_keyrequired
string | null
A key that was used to read from or write to the prompt cache.

Streaming events

Set stream to true to receive server-sent events as the response is generated.

response.created

A streaming event that indicated the response was created.

typerequired
"response.created"
The type of the event, always response.created.
sequence_numberrequired
integer
The sequence number of the event that was emitted.
responserequired
The response snapshot that was emitted with the event.
response.queued

A streaming event that indicated the response was queued.

typerequired
"response.queued"
The type of the event, always response.queued.
sequence_numberrequired
integer
The sequence number of the event that was emitted.
responserequired
The response snapshot that was emitted with the event.
response.in_progress

A streaming event that indicated the response was in progress.

typerequired
"response.in_progress"
The type of the event, always response.in_progress.
sequence_numberrequired
integer
The sequence number of the event that was emitted.
responserequired
The response snapshot that was emitted with the event.
response.completed

A streaming event that indicated the response was completed.

typerequired
"response.completed"
The type of the event, always response.completed.
sequence_numberrequired
integer
The sequence number of the event that was emitted.
responserequired
The response snapshot that was emitted with the event.
response.failed

A streaming event that indicated the response had failed.

typerequired
"response.failed"
The type of the event, always response.failed.
sequence_numberrequired
integer
The sequence number of the event that was emitted.
responserequired
The response snapshot that was emitted with the event.
response.incomplete

A streaming event that indicated the response was incomplete.

typerequired
"response.incomplete"
The type of the event, always response.incomplete.
sequence_numberrequired
integer
The sequence number of the event that was emitted.
responserequired
The response snapshot that was emitted with the event.
response.output_item.added

A streaming event that indicated an output item was added to the response.

typerequired
"response.output_item.added"
The type of the event, always response.output_item.added.
sequence_numberrequired
integer
The sequence number of the event that was emitted.
output_indexrequired
integer
The index of the output item that was added.
itemrequired
ItemField | null
An item representing a message, tool call, tool output, reasoning, or other response element.
Accepted types
response.output_item.done

A streaming event that indicated an output item was completed.

typerequired
"response.output_item.done"
The type of the event, always response.output_item.done.
sequence_numberrequired
integer
The sequence number of the event that was emitted.
output_indexrequired
integer
The index of the output item that was completed.
itemrequired
ItemField | null
An item representing a message, tool call, tool output, reasoning, or other response element.
Accepted types
response.reasoning_summary_part.added

A streaming event that indicated a reasoning summary part was added.

typerequired
"response.reasoning_summary_part.added"
The type of the event, always response.reasoning_summary_part.added.
sequence_numberrequired
integer
The sequence number of the event that was emitted.
item_idrequired
string
The ID of the item that was updated.
output_indexrequired
integer
The index of the output item that was updated.
summary_indexrequired
integer
The index of the summary part that was added.
response.reasoning_summary_part.done

A streaming event that indicated a reasoning summary part was completed.

typerequired
"response.reasoning_summary_part.done"
The type of the event, always response.reasoning_summary_part.done.
sequence_numberrequired
integer
The sequence number of the event that was emitted.
item_idrequired
string
The ID of the item that was updated.
output_indexrequired
integer
The index of the output item that was updated.
summary_indexrequired
integer
The index of the summary part that was completed.
response.content_part.added

A streaming event that indicated a content part was added.

typerequired
"response.content_part.added"
The type of the event, always response.content_part.added.
sequence_numberrequired
integer
The sequence number of the event that was emitted.
item_idrequired
string
The ID of the item that was updated.
output_indexrequired
integer
The index of the output item that was updated.
content_indexrequired
integer
The index of the content part that was added.
response.content_part.done

A streaming event that indicated a content part was completed.

typerequired
"response.content_part.done"
The type of the event, always response.content_part.done.
sequence_numberrequired
integer
The sequence number of the event that was emitted.
item_idrequired
string
The ID of the item that was updated.
output_indexrequired
integer
The index of the output item that was updated.
content_indexrequired
integer
The index of the content part that was completed.
response.output_text.delta

A streaming event that indicated output text was incrementally added.

typerequired
"response.output_text.delta"
The type of the event, always response.output_text.delta.
sequence_numberrequired
integer
The sequence number of the event that was emitted.
item_idrequired
string
The ID of the item that was updated.
output_indexrequired
integer
The index of the output item that was updated.
content_indexrequired
integer
The index of the content part that was updated.
deltarequired
string
The text delta that was appended.
logprobsoptional
The token log probabilities that were emitted with the delta, if any.
obfuscationoptional
string
An obfuscation string that was added to pad the event payload.
response.output_text.done

A streaming event that indicated output text was completed.

typerequired
"response.output_text.done"
The type of the event, always response.output_text.done.
sequence_numberrequired
integer
The sequence number of the event that was emitted.
item_idrequired
string
The ID of the item that was updated.
output_indexrequired
integer
The index of the output item that was updated.
content_indexrequired
integer
The index of the content part that was completed.
textrequired
string
The final text that was emitted.
logprobsoptional
The token log probabilities that were emitted with the final text, if any.
response.refusal.delta

A streaming event that indicated refusal text was incrementally added.

typerequired
"response.refusal.delta"
The type of the event, always response.refusal.delta.
sequence_numberrequired
integer
The sequence number of the event that was emitted.
item_idrequired
string
The ID of the item that was updated.
output_indexrequired
integer
The index of the output item that was updated.
content_indexrequired
integer
The index of the refusal content that was updated.
deltarequired
string
The refusal text delta that was appended.
response.refusal.done

A streaming event that indicated refusal text was completed.

typerequired
"response.refusal.done"
The type of the event, always response.refusal.done.
sequence_numberrequired
integer
The sequence number of the event that was emitted.
item_idrequired
string
The ID of the item that was updated.
output_indexrequired
integer
The index of the output item that was updated.
content_indexrequired
integer
The index of the refusal content that was completed.
refusalrequired
string
The final refusal text that was emitted.
response.reasoning.delta

A streaming event that indicated reasoning text was incrementally added.

typerequired
"response.reasoning.delta"
The type of the event, always response.reasoning.delta.
sequence_numberrequired
integer
The sequence number of the event that was emitted.
item_idrequired
string
The ID of the item that was updated.
output_indexrequired
integer
The index of the output item that was updated.
content_indexrequired
integer
The index of the reasoning content that was updated.
deltarequired
string
The reasoning text delta that was appended.
obfuscationoptional
string
An obfuscation string that was added to pad the event payload.
response.reasoning.done

A streaming event that indicated reasoning text was completed.

typerequired
"response.reasoning.done"
The type of the event, always response.reasoning.done.
sequence_numberrequired
integer
The sequence number of the event that was emitted.
item_idrequired
string
The ID of the item that was updated.
output_indexrequired
integer
The index of the output item that was updated.
content_indexrequired
integer
The index of the reasoning content that was completed.
textrequired
string
The final reasoning text that was emitted.
response.reasoning_summary_text.delta

A streaming event that indicated a reasoning summary was incrementally added.

typerequired
"response.reasoning_summary_text.delta"
The type of the event, always response.reasoning_summary.delta.
sequence_numberrequired
integer
The sequence number of the event that was emitted.
item_idrequired
string
The ID of the item that was updated.
output_indexrequired
integer
The index of the output item that was updated.
summary_indexrequired
integer
The index of the summary content that was updated.
deltarequired
string
The summary text delta that was appended.
obfuscationoptional
string
An obfuscation string that was added to pad the event payload.
response.reasoning_summary_text.done

A streaming event that indicated a reasoning summary was completed.

typerequired
"response.reasoning_summary_text.done"
The type of the event, always response.reasoning_summary.done.
sequence_numberrequired
integer
The sequence number of the event that was emitted.
item_idrequired
string
The ID of the item that was updated.
output_indexrequired
integer
The index of the output item that was updated.
summary_indexrequired
integer
The index of the summary content that was completed.
textrequired
string
The final summary text that was emitted.
response.output_text.annotation.added

A streaming event that indicated an output text annotation was added.

typerequired
"response.output_text.annotation.added"
The type of the event, always response.output_text.annotation.added.
sequence_numberrequired
integer
The sequence number of the event that was emitted.
item_idrequired
string
The ID of the item that was updated.
output_indexrequired
integer
The index of the output item that was updated.
content_indexrequired
integer
The index of the output text content that was updated.
annotation_indexrequired
integer
The index of the annotation that was added.
annotationrequired
Annotation | null
An annotation that applies to a span of output text.
Accepted types
response.function_call_arguments.delta

A streaming event that indicated function call arguments were incrementally added.

typerequired
"response.function_call_arguments.delta"
The type of the event, always response.function_call_arguments.delta.
sequence_numberrequired
integer
The sequence number of the event that was emitted.
item_idrequired
string
The ID of the tool call item that was updated.
output_indexrequired
integer
The index of the output item that was updated.
deltarequired
string
The arguments delta that was appended.
obfuscationoptional
string
An obfuscation string that was added to pad the event payload.
response.function_call_arguments.done

A streaming event that indicated function call arguments were completed.

typerequired
"response.function_call_arguments.done"
The type of the event, always response.function_call_arguments.done.
sequence_numberrequired
integer
The sequence number of the event that was emitted.
item_idrequired
string
The ID of the tool call item that was updated.
output_indexrequired
integer
The index of the output item that was updated.
argumentsrequired
string
The final arguments string that was emitted.
error

A streaming event that indicated an error was emitted.

typerequired
"error"
The type of the event, always error.
sequence_numberrequired
integer
The sequence number of the event that was emitted.
errorrequired
The error payload that was emitted.

WebSocket

WS /v1/responses Added 2026-04-24

Open a WebSocket connection and start each turn with a JSON response.create client message. The message uses the normal response creation body, except HTTP transport fields such as stream, stream_options, and background are not sent. Server progress messages use the same streaming event objects as text/event-stream responses, while WebSocket failures use an error envelope.

Client message

typerequired
"response.create"
The client event type. Always response.create.
modeloptional
string | null
The model to use for this request, e.g. 'gpt-5.2'.
inputoptional
string | ItemParam[] | null
Context to provide to the model for the scope of this request. May either be a string or an array of input items. If a string is provided, it is interpreted as a user message.
Input types
previous_response_idoptional
string | null
The ID of the response to use as the prior turn for this request.
includeoptional
Allowed values
reasoning.encrypted_content
includes encrypted reasoning content so that it may be rehydrated on a subsequent request.
message.output_text.logprobs
includes sampled logprobs in assistant messages.
toolsoptional
ResponsesToolParam[] | null
A list of tools that the model may call while generating the response.
Accepted types
tool_choiceoptional
ToolChoiceParam | null
Controls which tool the model should use, if any.
Accepted types
metadataoptional
MetadataParam | null
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.
Accepted types
textoptional
TextParam | null
Configuration options for text output.
Accepted types
temperatureoptional
number | null
Sampling temperature to use, between 0 and 2. Higher values make the output more random.
top_poptional
number | null
Nucleus sampling parameter, between 0 and 1. The model considers only the tokens with the top cumulative probability.
presence_penaltyoptional
number | null
Penalizes new tokens based on whether they appear in the text so far.
frequency_penaltyoptional
number | null
Penalizes new tokens based on their frequency in the text so far.
parallel_tool_callsoptional
boolean | null
Whether the model may call multiple tools in parallel.
max_output_tokensoptional
integer | null
The maximum number of tokens the model may generate for this response.
max_tool_callsoptional
integer | null
The maximum number of tool calls the model may make while generating the response.
reasoningoptional
ReasoningParam | null
Configuration options for reasoning behavior.
Accepted types
safety_identifieroptional
string | null
A stable identifier used for safety monitoring and abuse detection.
prompt_cache_keyoptional
string | null
A key to use when reading from or writing to the prompt cache.
truncationoptional
Controls how the service truncates the input when it exceeds the model context window.
Allowed values
auto
Let the service decide how to truncate.
disabled
Disable service truncation. Context over the model's context limit will result in a 400 error.
instructionsoptional
string | null
Additional instructions to guide the model for this request.
storeoptional
boolean
Whether to store the response so it can be retrieved later.
service_tieroptional
The service tier to use for this request.
Allowed values
auto
Choose a service tier automatically based on current account state.
default
Choose the default service tier.
flex
Choose the flex service tier.
priority
Choose the priority service tier.
top_logprobsoptional
integer | null
The number of most likely tokens to return at each position, along with their log probabilities.

Error message

typerequired
"error"
The event type. Always error.
statusrequired
integer
The HTTP-style status code for the WebSocket error.
errorrequired
object
The WebSocket error payload.

Compact a response

POST /v1/responses/compact Added 2026-04-24

Return a compacted conversation state object that preserves long-running context without asserting provider-specific compression behavior.

Body parameters

modelrequired
string
Model ID used to generate the response, like gpt-5 or o3. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models.
inputoptional
string | ItemParam[] | null
Text, image, or file inputs to the model, used to generate a response. A string is treated as text input with the user role. An array can contain one or more input items with different content types.
Input types
previous_response_idoptional
string | null
The unique ID of the previous response to the model. Use this to create multi-turn conversations. Learn more about conversation state. Cannot be used in conjunction with conversation.
instructionsoptional
string | null
A system (or developer) message inserted into the model's context. When used along with previous_response_id, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses.
prompt_cache_keyoptional
string | null
A key to use when reading from or writing to the prompt cache.

Response body

idrequired
string
The unique identifier for the compacted response.
objectrequired
"response.compaction"
The object type. Always response.compaction.
outputrequired
The compacted list of output items.
created_atrequired
integer
Unix timestamp (in seconds) when the compacted conversation was created.
usagerequired
Token accounting for the compaction pass, including cached, reasoning, and total tokens.

API objects

Types used by the request, response, and event schemas.

Enums

FunctionCallOutputStatusEnum

Similar to FunctionCallStatus. All three options are allowed here for compatibility, but because in practice these items will be provided by developers, only completed should be used.

in_progress
completed
incomplete

FunctionCallStatus

in_progress
Model is currently sampling this item.
completed
Model has finished sampling this item.
incomplete
Model was interrupted from sampling this item partway through. This can occur, for example, if the model encounters a stop token or exhausts its output_token budget.

ImageDetail

low
Restricts the model to a lower-resolution version of the image.
high
Allows the model to "see" a higher-resolution version of the image, usually increasing input token costs.
auto
Choose the detail level automatically.

IncludeEnum

reasoning.encrypted_content
includes encrypted reasoning content so that it may be rehydrated on a subsequent request.
message.output_text.logprobs
includes sampled logprobs in assistant messages.

MessageRole

user
End‑user input in the conversation.
assistant
Model-generated content in the conversation.
system
System-level instructions that set global behavior.
developer
Developer-supplied guidance that shapes the assistant’s behavior.

MessageStatus

in_progress
Model is currently sampling this item.
completed
Model has finished sampling this item.
incomplete
Model was interrupted from sampling this item partway through. This can occur, for example, if the model encounters a stop token or exhausts its output_token budget.

ReasoningEffortEnum

none
Restrict the model from performing any reasoning before emitting a final answer.
low
Use a lower reasoning effort for faster responses.
medium
Use a balanced reasoning effort.
high
Use a higher reasoning effort to improve answer quality.
xhigh
Use the maximum reasoning effort available.

ReasoningSummaryEnum

concise
Emit concise summaries of reasoning content.
detailed
Emit details summaries of reasoning content.
auto
Allow the model to decide when to summarize.

ServiceTierEnum

auto
Choose a service tier automatically based on current account state.
default
Choose the default service tier.
flex
Choose the flex service tier.
priority
Choose the priority service tier.

ToolChoiceValueEnum

none
Restrict the model from calling any tools.
auto
Let the model choose the tools from among the provided set.
required
Require the model to call a tool.

TruncationEnum

auto
Let the service decide how to truncate.
disabled
Disable service truncation. Context over the model's context limit will result in a 400 error.

VerbosityEnum

low
Instruct the model to emit less verbose final responses.
medium
Use the model's default verbosity setting.
high
Instruct the model to emit more verbose final responses.

Unions

ItemField

An item representing a message, tool call, tool output, reasoning, or other response element.

ItemParam

An internal identifier for an item to reference.

TextFormatParam

ToolChoiceParam

Controls which tool the model should use, if any.

Objects

AllowedToolChoice

type required
"allowed_tools"
tools required
FunctionToolChoice[]
mode required
ToolChoiceValueEnum
Allowed values
none
Restrict the model from calling any tools.
auto
Let the model choose the tools from among the provided set.
required
Require the model to call a tool.

AllowedToolsParam

type required
"allowed_tools"
The tool choice type. Always allowed_tools.
tools required
SpecificToolChoiceParam[]
The list of tools that are permitted for this request.
mode optional
ToolChoiceValueEnum
How to select a tool from the allowed set.
Allowed values
none
Restrict the model from calling any tools.
auto
Let the model choose the tools from among the provided set.
required
Require the model to call a tool.

Annotation

An annotation that applies to a span of output text.

type required
"url_citation"
The type of the URL citation. Always url_citation.
url required
string
The URL of the web resource.
start_index required
integer
The index of the first character of the URL citation in the message.
end_index required
integer
The index of the last character of the URL citation in the message.
title required
string
The title of the web resource.

AssistantMessageItemParam

id optional
string | null
The unique ID of this message item.
type required
"message"
The item type. Always message.
role required
"assistant"
The role of the message author. Always assistant.
content required
object[] | string
The message content, as a string or an array of content parts.
Accepted types
phase optional Added 2026-04-24
string
Labels an assistant message as intermediate commentary (commentary) or the final answer (final_answer). For models like gpt-5.3-codex and beyond, when sending follow-up requests, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages.
Allowed values
commentary
final_answer
status optional
string | null
The status of the message item.
Added 2026-04-24

CompactionBody

A compaction item generated by the v1/responses/compact API.

type required
"compaction"
The type of the item. Always compaction.
id required
string
The unique ID of the compaction item.
encrypted_content required
string
The encrypted content that was produced by compaction.
created_by optional
string
The identifier of the actor that created the item.
Added 2026-04-24

CompactionSummaryItemParam

A compaction item generated by the v1/responses/compact API.

id optional
string | null
The ID of the compaction item.
type required
"compaction"
The type of the item. Always compaction.
encrypted_content required
string
The encrypted content of the compaction summary.
Added 2026-04-24

CompactResource

id required
string
The unique identifier for the compacted response.
object required
"response.compaction"
The object type. Always response.compaction.
output required
ItemField[]
The compacted list of output items.
created_at required
integer
Unix timestamp (in seconds) when the compacted conversation was created.
usage required
Usage
Token accounting for the compaction pass, including cached, reasoning, and total tokens.
Added 2026-04-24

CompactResponseMethodPublicBody

model required
string
Model ID used to generate the response, like gpt-5 or o3. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models.
input optional
string | ItemParam[] | null
Text, image, or file inputs to the model, used to generate a response. A string is treated as text input with the user role. An array can contain one or more input items with different content types.
Accepted types
previous_response_id optional
string | null
The unique ID of the previous response to the model. Use this to create multi-turn conversations. Learn more about conversation state. Cannot be used in conjunction with conversation.
instructions optional
string | null
A system (or developer) message inserted into the model's context. When used along with previous_response_id, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses.
prompt_cache_key optional
string | null
A key to use when reading from or writing to the prompt cache.

CreateResponseBody

model optional
string | null
The model to use for this request, e.g. 'gpt-5.2'.
input optional
string | ItemParam[] | null
Context to provide to the model for the scope of this request. May either be a string or an array of input items. If a string is provided, it is interpreted as a user message.
Accepted types
previous_response_id optional
string | null
The ID of the response to use as the prior turn for this request.
include optional
IncludeEnum[]
Allowed values
reasoning.encrypted_content
includes encrypted reasoning content so that it may be rehydrated on a subsequent request.
message.output_text.logprobs
includes sampled logprobs in assistant messages.
tools optional
ResponsesToolParam[] | null
A list of tools that the model may call while generating the response.
Accepted types
tool_choice optional
ToolChoiceParam | null
Controls which tool the model should use, if any.
Accepted types
Allowed values
none
Restrict the model from calling any tools.
auto
Let the model choose the tools from among the provided set.
required
Require the model to call a tool.
metadata optional
MetadataParam | null
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.
Accepted types
text optional
TextParam | null
Configuration options for text output.
Accepted types
temperature optional
number | null
Sampling temperature to use, between 0 and 2. Higher values make the output more random.
top_p optional
number | null
Nucleus sampling parameter, between 0 and 1. The model considers only the tokens with the top cumulative probability.
presence_penalty optional
number | null
Penalizes new tokens based on whether they appear in the text so far.
frequency_penalty optional
number | null
Penalizes new tokens based on their frequency in the text so far.
parallel_tool_calls optional
boolean | null
Whether the model may call multiple tools in parallel.
stream optional
boolean
Whether to stream response events as server-sent events.
stream_options optional
StreamOptionsParam | null
Options that control streamed response behavior.
Accepted types
background optional
boolean
Whether to run the request in the background and return immediately.
max_output_tokens optional
integer | null
The maximum number of tokens the model may generate for this response.
max_tool_calls optional
integer | null
The maximum number of tool calls the model may make while generating the response.
reasoning optional
ReasoningParam | null
Configuration options for reasoning behavior.
Accepted types
safety_identifier optional
string | null
A stable identifier used for safety monitoring and abuse detection.
prompt_cache_key optional
string | null
A key to use when reading from or writing to the prompt cache.
truncation optional
TruncationEnum
Controls how the service truncates the input when it exceeds the model context window.
Allowed values
auto
Let the service decide how to truncate.
disabled
Disable service truncation. Context over the model's context limit will result in a 400 error.
instructions optional
string | null
Additional instructions to guide the model for this request.
store optional
boolean
Whether to store the response so it can be retrieved later.
service_tier optional
ServiceTierEnum
The service tier to use for this request.
Allowed values
auto
Choose a service tier automatically based on current account state.
default
Choose the default service tier.
flex
Choose the flex service tier.
priority
Choose the priority service tier.
top_logprobs optional
integer | null
The number of most likely tokens to return at each position, along with their log probabilities.

DeveloperMessageItemParam

id optional
string | null
The unique ID of this message item.
type required
"message"
The item type. Always message.
role required
"developer"
The message role. Always developer.
content required
InputTextContentParam[] | string
The message content, as a string or an array of content parts.
Accepted types
status optional
string | null
The status of the message item.

EmptyModelParam

Error

An error that occurred while generating the response.

code required
string
A machine-readable error code that was returned.
message required
string
A human-readable description of the error that was returned.

ErrorPayload

An error payload that was emitted for a streaming error event.

type required
string
The error type that was emitted.
code required
string | null
The error code that was emitted, if any.
message required
string
The human-readable error message that was emitted.
param required
string | null
The parameter name that was associated with the error, if any.
headers optional
object
The response headers that were emitted with the error, if any.

ErrorStreamingEvent

A streaming event that indicated an error was emitted.

type required
"error"
The type of the event, always error.
sequence_number required
integer
The sequence number of the event that was emitted.
error required
ErrorPayload
The error payload that was emitted.

FunctionCall

A function tool call that was generated by the model.

type required
"function_call"
The type of the item. Always function_call.
id required
string
The unique ID of the function call item.
call_id required
string
The unique ID of the function tool call that was generated.
name required
string
The name of the function that was called.
arguments required
string
The arguments JSON string that was generated.
status required
FunctionCallStatus
The status of the function call item that was recorded.
Allowed values
in_progress
Model is currently sampling this item.
completed
Model has finished sampling this item.
incomplete
Model was interrupted from sampling this item partway through. This can occur, for example, if the model encounters a stop token or exhausts its output_token budget.

FunctionCallItemParam

id optional
string | null
The unique ID of this function tool call.
call_id required
string
The unique ID of the function tool call generated by the model.
type required
"function_call"
The item type. Always function_call.
name required
string
The name of the function to call.
arguments required
string
The function arguments as a JSON string.
status optional
FunctionCallStatus | null
The status of the function tool call.
Accepted types
Allowed values
in_progress
Model is currently sampling this item.
completed
Model has finished sampling this item.
incomplete
Model was interrupted from sampling this item partway through. This can occur, for example, if the model encounters a stop token or exhausts its output_token budget.

FunctionCallOutput

A function tool call output that was returned by the tool.

type required
"function_call_output"
The type of the function tool call output. Always function_call_output.
id required
string
The unique ID of the function tool call output. Populated when this item is returned via API.
call_id required
string
The unique ID of the function tool call generated by the model.
output required
string | object[]
The function tool call output, as a JSON string or an array of text, image, or file content.
Accepted types
status required
FunctionCallOutputStatusEnum
The status of the item. One of in_progress, completed, or incomplete. Populated when items are returned via API.
Allowed values
in_progress
completed
incomplete

FunctionCallOutputItemParam

The output of a function tool call.

id optional
string | null
The unique ID of the function tool call output. Populated when this item is returned via API.
call_id required
string
The unique ID of the function tool call generated by the model.
type required
"function_call_output"
The type of the function tool call output. Always function_call_output.
output required
string | object[]
The function tool call output, as a JSON string or an array of text, image, or file content.
Accepted types
status optional
FunctionCallStatus | null
The status of the item. One of in_progress, completed, or incomplete. Populated when items are returned via API.
Accepted types
Allowed values
in_progress
Model is currently sampling this item.
completed
Model has finished sampling this item.
incomplete
Model was interrupted from sampling this item partway through. This can occur, for example, if the model encounters a stop token or exhausts its output_token budget.

FunctionTool

Defines a function in your own code the model can choose to call. Learn more about function calling.

type required
"function"
The type of the function tool. Always function.
name required
string
The name of the function to call.
description required
string | null
A description of the function. Used by the model to determine whether or not to call the function.
parameters required
object | null
A JSON schema object describing the parameters of the function.
strict required
boolean | null
Whether to enforce strict parameter validation. Default true.

FunctionToolChoice

type required
"function"
name optional
string

FunctionToolParam

name required
string
description optional
string | null
parameters optional
EmptyModelParam | null
Accepted types
strict optional
boolean
type required
"function"

IncompleteDetails

Details about why the response was incomplete.

reason required
string
The reason the response could not be completed.

InputFileContent

A file input to the model.

type required
"input_file"
The type of the input item. Always input_file.
filename optional
string
The name of the file to be sent to the model.
file_url optional
string
The URL of the file to be sent to the model.

InputFileContentParam

A file input to the model.

type required
"input_file"
The type of the input item. Always input_file.
filename optional
string | null
The name of the file to be sent to the model.
file_data optional
string | null
The base64-encoded data of the file to be sent to the model.
file_url optional
string | null
The URL of the file to be sent to the model.

InputImageContent

An image input to the model. Learn about image inputs.

type required
"input_image"
The type of the input item. Always input_image.
image_url required
string | null
The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
detail required
ImageDetail
The detail level of the image to be sent to the model. One of high, low, or auto. Defaults to auto.
Allowed values
low
Restricts the model to a lower-resolution version of the image.
high
Allows the model to "see" a higher-resolution version of the image, usually increasing input token costs.
auto
Choose the detail level automatically.

InputImageContentParamAutoParam

An image input to the model. Learn about image inputs

type required
"input_image"
The type of the input item. Always input_image.
image_url optional
string | null
The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
detail optional
ImageDetail | null
The detail level of the image to be sent to the model. One of high, low, or auto. Defaults to auto.
Accepted types
Allowed values
low
Restricts the model to a lower-resolution version of the image.
high
Allows the model to "see" a higher-resolution version of the image, usually increasing input token costs.
auto
Choose the detail level automatically.

InputTextContent

A text input to the model.

type required
"input_text"
The type of the input item. Always input_text.
text required
string
The text input to the model.

InputTextContentParam

A text input to the model.

type required
"input_text"
The type of the input item. Always input_text.
text required
string
The text input to the model.

InputTokensDetails

A breakdown of input token usage that was recorded.

cached_tokens required
integer
The number of input tokens that were served from cache.

InputVideoContent

A content block representing a video input to the model.

type required
"input_video"
The type of the input content. Always input_video.
video_url required
string
A base64 or remote url that resolves to a video file.

ItemReferenceParam

An internal identifier for an item to reference.

type optional
"item_reference" | null
The type of item to reference. Always item_reference.
id required
string
The ID of the item to reference.

JsonObjectResponseFormat

type required
"json_object"

JsonSchemaResponseFormat

type required
"json_schema"
name required
string
description required
string | null
schema required
null
strict required
boolean

JsonSchemaResponseFormatParam

type optional
"json_schema"
The type of response format being defined. Always json_schema.
description optional
string
A description of what the response format is for, used by the model to determine how to respond in the format.
name optional
string
The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
schema optional
object
The schema for the response format, described as a JSON Schema object.
strict optional
boolean | null
Whether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is true.

LogProb

The log probability of a token.

token required
string
logprob required
number
bytes required
integer[]
top_logprobs required
TopLogProb[]

Message

A message to or from the model.

type required
"message"
The type of the message. Always set to message.
id required
string
The unique ID of the message.
status required
MessageStatus
The status of item. One of in_progress, completed, or incomplete. Populated when items are returned via API.
Allowed values
in_progress
Model is currently sampling this item.
completed
Model has finished sampling this item.
incomplete
Model was interrupted from sampling this item partway through. This can occur, for example, if the model encounters a stop token or exhausts its output_token budget.
role required
MessageRole
The role of the message. One of unknown, user, assistant, system, critic, discriminator, developer, or tool.
Allowed values
user
End‑user input in the conversation.
assistant
Model-generated content in the conversation.
system
System-level instructions that set global behavior.
developer
Developer-supplied guidance that shapes the assistant’s behavior.
content required
object[]
The content of the message
phase optional Added 2026-04-24
string
Labels an assistant message as intermediate commentary (commentary) or the final answer (final_answer). For models like gpt-5.3-codex and beyond, when sending follow-up requests, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages.
Allowed values
commentary
final_answer

MetadataParam

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.

OutputTextContent

A text output from the model.

type required
"output_text"
The type of the output text. Always output_text.
text required
string
The text output from the model.
annotations required
Annotation[]
The annotations of the text output.
logprobs optional
LogProb[]

OutputTextContentParam

type required
"output_text"
The content type. Always output_text.
text required
string
The text content.
annotations optional
UrlCitationParam[]
Citations associated with the text content.

OutputTokensDetails

A breakdown of output token usage that was recorded.

reasoning_tokens required
integer
The number of output tokens that were attributed to reasoning.

Reasoning

Reasoning configuration and metadata that were used for the response.

effort required
ReasoningEffortEnum | null
The reasoning effort that was requested for the model, if specified.
Accepted types
Allowed values
none
Restrict the model from performing any reasoning before emitting a final answer.
low
Use a lower reasoning effort for faster responses.
medium
Use a balanced reasoning effort.
high
Use a higher reasoning effort to improve answer quality.
xhigh
Use the maximum reasoning effort available.
summary required
ReasoningSummaryEnum | null
A model-generated summary of its reasoning that was produced, if available.
Accepted types
Allowed values
concise
Emit concise summaries of reasoning content.
detailed
Emit details summaries of reasoning content.
auto
Allow the model to decide when to summarize.

ReasoningBody

A reasoning item that was generated by the model.

type required
"reasoning"
The type of the item. Always reasoning.
id required
string
The unique ID of the reasoning item.
content optional
object[]
The reasoning content that was generated.
summary required
object[]
The reasoning summary content that was generated.
encrypted_content optional
string
The encrypted reasoning content that was generated.

ReasoningItemParam

id optional
string | null
The unique ID of this reasoning item.
type required
"reasoning"
The item type. Always reasoning.
summary required
ReasoningSummaryContentParam[]
Reasoning summary content associated with this item.
content optional
null
encrypted_content optional
string | null
An encrypted representation of the reasoning content.

ReasoningParam

gpt-5 and o-series models only Configuration options for reasoning models.

effort optional
ReasoningEffortEnum | null
Controls the level of reasoning effort the model should apply. Higher effort may increase latency and cost.
Accepted types
Allowed values
none
Restrict the model from performing any reasoning before emitting a final answer.
low
Use a lower reasoning effort for faster responses.
medium
Use a balanced reasoning effort.
high
Use a higher reasoning effort to improve answer quality.
xhigh
Use the maximum reasoning effort available.
summary optional
ReasoningSummaryEnum | null
Controls whether the response includes a reasoning summary.
Accepted types
Allowed values
concise
Emit concise summaries of reasoning content.
detailed
Emit details summaries of reasoning content.
auto
Allow the model to decide when to summarize.

ReasoningSummaryContentParam

type required
"summary_text"
The content type. Always summary_text.
text required
string
The reasoning summary text.

ReasoningTextContent

Reasoning text from the model.

type required
"reasoning_text"
The type of the reasoning text. Always reasoning_text.
text required
string
The reasoning text from the model.

RefusalContent

A refusal from the model.

type required
"refusal"
The type of the refusal. Always refusal.
refusal required
string
The refusal explanation from the model.

RefusalContentParam

type required
"refusal"
The content type. Always refusal.
refusal required
string
The refusal text.

ResponseCompletedStreamingEvent

A streaming event that indicated the response was completed.

type required
"response.completed"
The type of the event, always response.completed.
sequence_number required
integer
The sequence number of the event that was emitted.
response required
ResponseResource
The response snapshot that was emitted with the event.

ResponseContentPartAddedStreamingEvent

A streaming event that indicated a content part was added.

type required
"response.content_part.added"
The type of the event, always response.content_part.added.
sequence_number required
integer
The sequence number of the event that was emitted.
item_id required
string
The ID of the item that was updated.
output_index required
integer
The index of the output item that was updated.
content_index required
integer
The index of the content part that was added.

ResponseContentPartDoneStreamingEvent

A streaming event that indicated a content part was completed.

type required
"response.content_part.done"
The type of the event, always response.content_part.done.
sequence_number required
integer
The sequence number of the event that was emitted.
item_id required
string
The ID of the item that was updated.
output_index required
integer
The index of the output item that was updated.
content_index required
integer
The index of the content part that was completed.

ResponseCreatedStreamingEvent

A streaming event that indicated the response was created.

type required
"response.created"
The type of the event, always response.created.
sequence_number required
integer
The sequence number of the event that was emitted.
response required
ResponseResource
The response snapshot that was emitted with the event.

ResponseFailedStreamingEvent

A streaming event that indicated the response had failed.

type required
"response.failed"
The type of the event, always response.failed.
sequence_number required
integer
The sequence number of the event that was emitted.
response required
ResponseResource
The response snapshot that was emitted with the event.

ResponseFunctionCallArgumentsDeltaStreamingEvent

A streaming event that indicated function call arguments were incrementally added.

type required
"response.function_call_arguments.delta"
The type of the event, always response.function_call_arguments.delta.
sequence_number required
integer
The sequence number of the event that was emitted.
item_id required
string
The ID of the tool call item that was updated.
output_index required
integer
The index of the output item that was updated.
delta required
string
The arguments delta that was appended.
obfuscation optional
string
An obfuscation string that was added to pad the event payload.

ResponseFunctionCallArgumentsDoneStreamingEvent

A streaming event that indicated function call arguments were completed.

type required
"response.function_call_arguments.done"
The type of the event, always response.function_call_arguments.done.
sequence_number required
integer
The sequence number of the event that was emitted.
item_id required
string
The ID of the tool call item that was updated.
output_index required
integer
The index of the output item that was updated.
arguments required
string
The final arguments string that was emitted.

ResponseIncompleteStreamingEvent

A streaming event that indicated the response was incomplete.

type required
"response.incomplete"
The type of the event, always response.incomplete.
sequence_number required
integer
The sequence number of the event that was emitted.
response required
ResponseResource
The response snapshot that was emitted with the event.

ResponseInProgressStreamingEvent

A streaming event that indicated the response was in progress.

type required
"response.in_progress"
The type of the event, always response.in_progress.
sequence_number required
integer
The sequence number of the event that was emitted.
response required
ResponseResource
The response snapshot that was emitted with the event.

ResponseOutputItemAddedStreamingEvent

A streaming event that indicated an output item was added to the response.

type required
"response.output_item.added"
The type of the event, always response.output_item.added.
sequence_number required
integer
The sequence number of the event that was emitted.
output_index required
integer
The index of the output item that was added.
item required
ItemField | null
An item representing a message, tool call, tool output, reasoning, or other response element.
Accepted types

ResponseOutputItemDoneStreamingEvent

A streaming event that indicated an output item was completed.

type required
"response.output_item.done"
The type of the event, always response.output_item.done.
sequence_number required
integer
The sequence number of the event that was emitted.
output_index required
integer
The index of the output item that was completed.
item required
ItemField | null
An item representing a message, tool call, tool output, reasoning, or other response element.
Accepted types

ResponseOutputTextAnnotationAddedStreamingEvent

A streaming event that indicated an output text annotation was added.

type required
"response.output_text.annotation.added"
The type of the event, always response.output_text.annotation.added.
sequence_number required
integer
The sequence number of the event that was emitted.
item_id required
string
The ID of the item that was updated.
output_index required
integer
The index of the output item that was updated.
content_index required
integer
The index of the output text content that was updated.
annotation_index required
integer
The index of the annotation that was added.
annotation required
Annotation | null
An annotation that applies to a span of output text.
Accepted types

ResponseOutputTextDeltaStreamingEvent

A streaming event that indicated output text was incrementally added.

type required
"response.output_text.delta"
The type of the event, always response.output_text.delta.
sequence_number required
integer
The sequence number of the event that was emitted.
item_id required
string
The ID of the item that was updated.
output_index required
integer
The index of the output item that was updated.
content_index required
integer
The index of the content part that was updated.
delta required
string
The text delta that was appended.
logprobs optional
LogProb[]
The token log probabilities that were emitted with the delta, if any.
obfuscation optional
string
An obfuscation string that was added to pad the event payload.

ResponseOutputTextDoneStreamingEvent

A streaming event that indicated output text was completed.

type required
"response.output_text.done"
The type of the event, always response.output_text.done.
sequence_number required
integer
The sequence number of the event that was emitted.
item_id required
string
The ID of the item that was updated.
output_index required
integer
The index of the output item that was updated.
content_index required
integer
The index of the content part that was completed.
text required
string
The final text that was emitted.
logprobs optional
LogProb[]
The token log probabilities that were emitted with the final text, if any.

ResponseQueuedStreamingEvent

A streaming event that indicated the response was queued.

type required
"response.queued"
The type of the event, always response.queued.
sequence_number required
integer
The sequence number of the event that was emitted.
response required
ResponseResource
The response snapshot that was emitted with the event.

ResponseReasoningDeltaStreamingEvent

A streaming event that indicated reasoning text was incrementally added.

type required
"response.reasoning.delta"
The type of the event, always response.reasoning.delta.
sequence_number required
integer
The sequence number of the event that was emitted.
item_id required
string
The ID of the item that was updated.
output_index required
integer
The index of the output item that was updated.
content_index required
integer
The index of the reasoning content that was updated.
delta required
string
The reasoning text delta that was appended.
obfuscation optional
string
An obfuscation string that was added to pad the event payload.

ResponseReasoningDoneStreamingEvent

A streaming event that indicated reasoning text was completed.

type required
"response.reasoning.done"
The type of the event, always response.reasoning.done.
sequence_number required
integer
The sequence number of the event that was emitted.
item_id required
string
The ID of the item that was updated.
output_index required
integer
The index of the output item that was updated.
content_index required
integer
The index of the reasoning content that was completed.
text required
string
The final reasoning text that was emitted.

ResponseReasoningSummaryDeltaStreamingEvent

A streaming event that indicated a reasoning summary was incrementally added.

type required
"response.reasoning_summary_text.delta"
The type of the event, always response.reasoning_summary.delta.
sequence_number required
integer
The sequence number of the event that was emitted.
item_id required
string
The ID of the item that was updated.
output_index required
integer
The index of the output item that was updated.
summary_index required
integer
The index of the summary content that was updated.
delta required
string
The summary text delta that was appended.
obfuscation optional
string
An obfuscation string that was added to pad the event payload.

ResponseReasoningSummaryDoneStreamingEvent

A streaming event that indicated a reasoning summary was completed.

type required
"response.reasoning_summary_text.done"
The type of the event, always response.reasoning_summary.done.
sequence_number required
integer
The sequence number of the event that was emitted.
item_id required
string
The ID of the item that was updated.
output_index required
integer
The index of the output item that was updated.
summary_index required
integer
The index of the summary content that was completed.
text required
string
The final summary text that was emitted.

ResponseReasoningSummaryPartAddedStreamingEvent

A streaming event that indicated a reasoning summary part was added.

type required
"response.reasoning_summary_part.added"
The type of the event, always response.reasoning_summary_part.added.
sequence_number required
integer
The sequence number of the event that was emitted.
item_id required
string
The ID of the item that was updated.
output_index required
integer
The index of the output item that was updated.
summary_index required
integer
The index of the summary part that was added.

ResponseReasoningSummaryPartDoneStreamingEvent

A streaming event that indicated a reasoning summary part was completed.

type required
"response.reasoning_summary_part.done"
The type of the event, always response.reasoning_summary_part.done.
sequence_number required
integer
The sequence number of the event that was emitted.
item_id required
string
The ID of the item that was updated.
output_index required
integer
The index of the output item that was updated.
summary_index required
integer
The index of the summary part that was completed.

ResponseRefusalDeltaStreamingEvent

A streaming event that indicated refusal text was incrementally added.

type required
"response.refusal.delta"
The type of the event, always response.refusal.delta.
sequence_number required
integer
The sequence number of the event that was emitted.
item_id required
string
The ID of the item that was updated.
output_index required
integer
The index of the output item that was updated.
content_index required
integer
The index of the refusal content that was updated.
delta required
string
The refusal text delta that was appended.

ResponseRefusalDoneStreamingEvent

A streaming event that indicated refusal text was completed.

type required
"response.refusal.done"
The type of the event, always response.refusal.done.
sequence_number required
integer
The sequence number of the event that was emitted.
item_id required
string
The ID of the item that was updated.
output_index required
integer
The index of the output item that was updated.
content_index required
integer
The index of the refusal content that was completed.
refusal required
string
The final refusal text that was emitted.

ResponseResource

The complete response object that was returned by the Responses API.

id required
string
The unique ID of the response that was created.
object required
"response"
The object type, which was always response.
created_at required
integer
The Unix timestamp (in seconds) for when the response was created.
completed_at required
integer | null
The Unix timestamp (in seconds) for when the response was completed, if it was completed.
status required
string
The status that was set for the response.
incomplete_details required
IncompleteDetails | null
Details about why the response was incomplete, if applicable.
Accepted types
model required
string
The model that generated this response.
previous_response_id required
string | null
The ID of the previous response in the chain that was referenced, if any.
instructions required
string | null
Additional instructions that were used to guide the model for this response.
output required
ItemField[]
The output items that were generated by the model.
error required
Error | null
The error that occurred, if the response failed.
Accepted types
tools required
Tool[]
The tools that were available to the model during response generation.
tool_choice required
object | ToolChoiceValueEnum
Accepted types
Allowed values
none
Restrict the model from calling any tools.
auto
Let the model choose the tools from among the provided set.
required
Require the model to call a tool.
truncation required
TruncationEnum
How the input was truncated by the service when it exceeded the model context window.
Allowed values
auto
Let the service decide how to truncate.
disabled
Disable service truncation. Context over the model's context limit will result in a 400 error.
parallel_tool_calls required
boolean
Whether the model was allowed to call multiple tools in parallel.
text required
TextField
Configuration options for text output that were used.
top_p required
number
The nucleus sampling parameter that was used for this response.
presence_penalty required
number
The presence penalty that was used to penalize new tokens based on whether they appear in the text so far.
frequency_penalty required
number
The frequency penalty that was used to penalize new tokens based on their frequency in the text so far.
top_logprobs required
integer
The number of most likely tokens that were returned at each position, along with their log probabilities.
temperature required
number
The sampling temperature that was used for this response.
reasoning required
Reasoning | null
Reasoning configuration and outputs that were produced for this response.
Accepted types
usage required
Usage | null
Token usage statistics that were recorded for the response, if available.
Accepted types
max_output_tokens required
integer | null
The maximum number of tokens the model was allowed to generate for this response.
max_tool_calls required
integer | null
The maximum number of tool calls the model was allowed to make while generating the response.
store required
boolean
Whether this response was stored so it can be retrieved later.
background required
boolean
Whether this request was run in the background.
service_tier required
string
The service tier that was used for this response.
metadata required
unknown
Developer-defined metadata that was associated with the response.
safety_identifier required
string | null
A stable identifier that was used for safety monitoring and abuse detection.
prompt_cache_key required
string | null
A key that was used to read from or write to the prompt cache.

ResponsesToolParam

name required
string
description optional
string | null
parameters optional
EmptyModelParam | null
Accepted types
strict optional
boolean
type required
"function"

SpecificFunctionParam

type required
"function"
The tool to call. Always function.
name required
string
The name of the function tool to call.

SpecificToolChoiceParam

type required
"function"
The tool to call. Always function.
name required
string
The name of the function tool to call.

StreamOptionsParam

Options that control streamed response behavior.

include_obfuscation optional
boolean
Whether to obfuscate sensitive information in streamed output. Defaults to true.

SummaryTextContent

A summary text from the model.

type required
"summary_text"
The type of the object. Always summary_text.
text required
string
A summary of the reasoning output from the model so far.

SystemMessageItemParam

id optional
string | null
The unique ID of this message item.
type required
"message"
The item type. Always message.
role required
"system"
The message role. Always system.
content required
InputTextContentParam[] | string
The message content, as a string or an array of content parts.
Accepted types
status optional
string | null
The status of the message item.

TextContent

A text content.

type required
"text"
text required
string

TextField

verbosity optional
VerbosityEnum
Allowed values
low
Instruct the model to emit less verbose final responses.
medium
Use the model's default verbosity setting.
high
Instruct the model to emit more verbose final responses.

TextParam

format optional
TextFormatParam | null
The format configuration for text output.
Accepted types
verbosity optional
VerbosityEnum
Controls the level of detail in generated text output.
Allowed values
low
Instruct the model to emit less verbose final responses.
medium
Use the model's default verbosity setting.
high
Instruct the model to emit more verbose final responses.

TextResponseFormat

type required
"text"

Tool

A tool that can be used to generate a response.

type required
"function"
The type of the function tool. Always function.
name required
string
The name of the function to call.
description required
string | null
A description of the function. Used by the model to determine whether or not to call the function.
parameters required
object | null
A JSON schema object describing the parameters of the function.
strict required
boolean | null
Whether to enforce strict parameter validation. Default true.

TopLogProb

The top log probability of a token.

token required
string
logprob required
number
bytes required
integer[]

UrlCitationBody

A citation for a web resource used to generate a model response.

type required
"url_citation"
The type of the URL citation. Always url_citation.
url required
string
The URL of the web resource.
start_index required
integer
The index of the first character of the URL citation in the message.
end_index required
integer
The index of the last character of the URL citation in the message.
title required
string
The title of the web resource.

UrlCitationParam

type required
"url_citation"
The citation type. Always url_citation.
start_index required
integer
The index of the first character of the citation in the message.
end_index required
integer
The index of the last character of the citation in the message.
url required
string
The URL of the cited resource.
title required
string
The title of the cited resource.

Usage

Token usage statistics that were recorded for the response.

input_tokens required
integer
The number of input tokens that were used to generate the response.
output_tokens required
integer
The number of output tokens that were generated by the model.
total_tokens required
integer
The total number of tokens that were used.
input_tokens_details required
InputTokensDetails
A breakdown of input token usage that was recorded.
output_tokens_details required
OutputTokensDetails
A breakdown of output token usage that was recorded.

UserMessageItemParam

id optional
string | null
The unique ID of this message item.
type required
"message"
The item type. Always message.
role required
"user"
The message role. Always user.
content required
object[] | string
The message content, as a string or an array of content parts.
Accepted types
status optional
string | null
The status of the message item.
Added 2026-04-24

WebSocketErrorEvent

A WebSocket error envelope returned for Responses WebSocket mode failures.

type required
"error"
The event type. Always error.
status required
integer
The HTTP-style status code for the WebSocket error.
error required
object
The WebSocket error payload.
Added 2026-04-24

WebSocketResponseCreateEvent

A client-sent WebSocket event that starts a Responses turn. It uses the normal response-create body plus a required type field.

type required
"response.create"
The client event type. Always response.create.
model optional
string | null
The model to use for this request, e.g. 'gpt-5.2'.
input optional
string | ItemParam[] | null
Context to provide to the model for the scope of this request. May either be a string or an array of input items. If a string is provided, it is interpreted as a user message.
Accepted types
previous_response_id optional
string | null
The ID of the response to use as the prior turn for this request.
include optional
IncludeEnum[]
Allowed values
reasoning.encrypted_content
includes encrypted reasoning content so that it may be rehydrated on a subsequent request.
message.output_text.logprobs
includes sampled logprobs in assistant messages.
tools optional
ResponsesToolParam[] | null
A list of tools that the model may call while generating the response.
Accepted types
tool_choice optional
ToolChoiceParam | null
Controls which tool the model should use, if any.
Accepted types
Allowed values
none
Restrict the model from calling any tools.
auto
Let the model choose the tools from among the provided set.
required
Require the model to call a tool.
metadata optional
MetadataParam | null
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.
Accepted types
text optional
TextParam | null
Configuration options for text output.
Accepted types
temperature optional
number | null
Sampling temperature to use, between 0 and 2. Higher values make the output more random.
top_p optional
number | null
Nucleus sampling parameter, between 0 and 1. The model considers only the tokens with the top cumulative probability.
presence_penalty optional
number | null
Penalizes new tokens based on whether they appear in the text so far.
frequency_penalty optional
number | null
Penalizes new tokens based on their frequency in the text so far.
parallel_tool_calls optional
boolean | null
Whether the model may call multiple tools in parallel.
max_output_tokens optional
integer | null
The maximum number of tokens the model may generate for this response.
max_tool_calls optional
integer | null
The maximum number of tool calls the model may make while generating the response.
reasoning optional
ReasoningParam | null
Configuration options for reasoning behavior.
Accepted types
safety_identifier optional
string | null
A stable identifier used for safety monitoring and abuse detection.
prompt_cache_key optional
string | null
A key to use when reading from or writing to the prompt cache.
truncation optional
TruncationEnum
Controls how the service truncates the input when it exceeds the model context window.
Allowed values
auto
Let the service decide how to truncate.
disabled
Disable service truncation. Context over the model's context limit will result in a 400 error.
instructions optional
string | null
Additional instructions to guide the model for this request.
store optional
boolean
Whether to store the response so it can be retrieved later.
service_tier optional
ServiceTierEnum
The service tier to use for this request.
Allowed values
auto
Choose a service tier automatically based on current account state.
default
Choose the default service tier.
flex
Choose the flex service tier.
priority
Choose the priority service tier.
top_logprobs optional
integer | null
The number of most likely tokens to return at each position, along with their log probabilities.