Create a response
/v1/responses Generate text, execute tools, and handle multi-turn conversations.
Headers 2 required headers
Content-Type-
application/jsonorapplication/x-www-form-urlencoded Authorization-
Authorization token, usually
Bearer [secret token].
Body parameters
Supply parameters as application/json or application/x-www-form-urlencoded.
{
"model": "your-model",
"input": "Say hello"
}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.
Accepted types
Accepted types
Accepted types
Accepted types
Accepted types
Accepted types
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.
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.
Headers 1 required header
Content-Type-
application/jsonortext/event-stream
Response body
response.Accepted types
Accepted types
Accepted types
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.
Accepted types
Accepted types
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.
response.created. response.queued
A streaming event that indicated the response was queued.
response.queued. response.in_progress
A streaming event that indicated the response was in progress.
response.in_progress. response.completed
A streaming event that indicated the response was completed.
response.completed. response.failed
A streaming event that indicated the response had failed.
response.failed. response.incomplete
A streaming event that indicated the response was incomplete.
response.incomplete. response.output_item.added
A streaming event that indicated an output item was added to the response.
response.output_item.added.Accepted types
response.output_item.done
A streaming event that indicated an output item was completed.
response.output_item.done.Accepted types
response.reasoning_summary_part.added
A streaming event that indicated a reasoning summary part was added.
response.reasoning_summary_part.added. response.reasoning_summary_part.done
A streaming event that indicated a reasoning summary part was completed.
response.reasoning_summary_part.done. response.content_part.added
A streaming event that indicated a content part was added.
response.content_part.added. response.content_part.done
A streaming event that indicated a content part was completed.
response.content_part.done. response.output_text.delta
A streaming event that indicated output text was incrementally added.
response.output_text.delta. response.output_text.done
A streaming event that indicated output text was completed.
response.output_text.done. response.refusal.delta
A streaming event that indicated refusal text was incrementally added.
response.refusal.delta. response.refusal.done
A streaming event that indicated refusal text was completed.
response.refusal.done. response.reasoning.delta
A streaming event that indicated reasoning text was incrementally added.
response.reasoning.delta. response.reasoning.done
A streaming event that indicated reasoning text was completed.
response.reasoning.done. response.reasoning_summary_text.delta
A streaming event that indicated a reasoning summary was incrementally added.
response.reasoning_summary.delta. response.reasoning_summary_text.done
A streaming event that indicated a reasoning summary was completed.
response.reasoning_summary.done. response.output_text.annotation.added
A streaming event that indicated an output text annotation was added.
response.output_text.annotation.added.Accepted types
response.function_call_arguments.delta
A streaming event that indicated function call arguments were incrementally added.
response.function_call_arguments.delta. response.function_call_arguments.done
A streaming event that indicated function call arguments were completed.
response.function_call_arguments.done. error
A streaming event that indicated an error was emitted.
error.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
Annotation
An annotation that applies to a span of output text.
ItemField
An item representing a message, tool call, tool output, reasoning, or other response element.
ItemParam
An internal identifier for an item to reference.
ResponsesToolParam
SpecificToolChoiceParam
TextFormatParam
Tool
A tool that can be used to generate a response.
ToolChoiceParam
Controls which tool the model should use, if any.
Objects
AllowedToolChoice
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
allowed_tools.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.
AssistantMessageItemParam
message.assistant.Accepted types
-
array of -
string
CreateResponseBody
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.
Accepted types
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.
Accepted types
Accepted types
Accepted types
Accepted types
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.
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.
DeveloperMessageItemParam
message.developer.Accepted types
-
array of -
string
EmptyModelParam
Error
An error that occurred while generating the response.
ErrorPayload
An error payload that was emitted for a streaming error event.
ErrorStreamingEvent
A streaming event that indicated an error was emitted.
error.FunctionCall
A function tool call that was generated by the model.
function_call.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
function_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.
function_call_output.Accepted types
-
string -
array 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.
function_call_output.Accepted types
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.
function.true.FunctionToolChoice
FunctionToolParam
IncompleteDetails
Details about why the response was incomplete.
InputFileContent
A file input to the model.
input_file.InputFileContentParam
A file input to the model.
input_file.InputImageContent
An image input to the model. Learn about image inputs.
input_image.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
input_image.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.
input_text.InputTextContentParam
A text input to the model.
input_text.InputTokensDetails
A breakdown of input token usage that was recorded.
InputVideoContent
A content block representing a video input to the model.
input_video.ItemReferenceParam
An internal identifier for an item to reference.
item_reference.JsonObjectResponseFormat
JsonSchemaResponseFormat
JsonSchemaResponseFormatParam
json_schema.schema field. Only a subset of JSON Schema is supported when
strict is true.
LogProb
The log probability of a token.
Message
A message to or from the model.
message.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.
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.
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.
output_text.OutputTextContentParam
output_text.Accepted types
OutputTokensDetails
A breakdown of output token usage that was recorded.
Reasoning
Reasoning configuration and metadata that were used for the response.
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.
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.
reasoning.ReasoningItemParam
reasoning.ReasoningParam
gpt-5 and o-series models only Configuration options for reasoning models.
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.
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
summary_text.ReasoningTextContent
Reasoning text from the model.
reasoning_text.RefusalContent
A refusal from the model.
refusal.RefusalContentParam
refusal.ResponseCompletedStreamingEvent
A streaming event that indicated the response was completed.
response.completed.ResponseContentPartAddedStreamingEvent
A streaming event that indicated a content part was added.
response.content_part.added.ResponseContentPartDoneStreamingEvent
A streaming event that indicated a content part was completed.
response.content_part.done.ResponseCreatedStreamingEvent
A streaming event that indicated the response was created.
response.created.ResponseFailedStreamingEvent
A streaming event that indicated the response had failed.
response.failed.ResponseFunctionCallArgumentsDeltaStreamingEvent
A streaming event that indicated function call arguments were incrementally added.
response.function_call_arguments.delta.ResponseFunctionCallArgumentsDoneStreamingEvent
A streaming event that indicated function call arguments were completed.
response.function_call_arguments.done.ResponseIncompleteStreamingEvent
A streaming event that indicated the response was incomplete.
response.incomplete.ResponseInProgressStreamingEvent
A streaming event that indicated the response was in progress.
response.in_progress.ResponseOutputItemAddedStreamingEvent
A streaming event that indicated an output item was added to the response.
response.output_item.added.Accepted types
ResponseOutputItemDoneStreamingEvent
A streaming event that indicated an output item was completed.
response.output_item.done.Accepted types
ResponseOutputTextAnnotationAddedStreamingEvent
A streaming event that indicated an output text annotation was added.
response.output_text.annotation.added.Accepted types
ResponseOutputTextDeltaStreamingEvent
A streaming event that indicated output text was incrementally added.
response.output_text.delta.ResponseOutputTextDoneStreamingEvent
A streaming event that indicated output text was completed.
response.output_text.done.ResponseQueuedStreamingEvent
A streaming event that indicated the response was queued.
response.queued.ResponseReasoningDeltaStreamingEvent
A streaming event that indicated reasoning text was incrementally added.
response.reasoning.delta.ResponseReasoningDoneStreamingEvent
A streaming event that indicated reasoning text was completed.
response.reasoning.done.ResponseReasoningSummaryDeltaStreamingEvent
A streaming event that indicated a reasoning summary was incrementally added.
response.reasoning_summary.delta.ResponseReasoningSummaryDoneStreamingEvent
A streaming event that indicated a reasoning summary was completed.
response.reasoning_summary.done.ResponseReasoningSummaryPartAddedStreamingEvent
A streaming event that indicated a reasoning summary part was added.
response.reasoning_summary_part.added.ResponseReasoningSummaryPartDoneStreamingEvent
A streaming event that indicated a reasoning summary part was completed.
response.reasoning_summary_part.done.ResponseRefusalDeltaStreamingEvent
A streaming event that indicated refusal text was incrementally added.
response.refusal.delta.ResponseRefusalDoneStreamingEvent
A streaming event that indicated refusal text was completed.
response.refusal.done.ResponseResource
The complete response object that was returned by the Responses API.
response.Accepted types
Accepted types
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.
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.
Accepted types
Accepted types
SpecificFunctionParam
function.StreamOptionsParam
Options that control streamed response behavior.
true.SummaryTextContent
A summary text from the model.
summary_text.SystemMessageItemParam
message.system.Accepted types
-
array of -
string
TextContent
A text content.
TextField
Accepted types
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
Accepted types
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
TopLogProb
The top log probability of a token.
UrlCitationBody
A citation for a web resource used to generate a model response.
url_citation.UrlCitationParam
url_citation.Usage
Token usage statistics that were recorded for the response.
UserMessageItemParam
message.user.