Create a model response
Creates a model response. Provide text or image inputs to generate text or JSON outputs. Have the model call your own custom code or use built-in tools like web search or file search to use your own data as input for the model's response.
Request body
metadataobject or 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.temperaturenumber or nullDefaults: 1
What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or
top_pbut not both.top_pnumber or nullDefaults: 1
An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
We generally recommend altering this or
temperaturebut not both.userstring
A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more.
service_tierstring or nullDefaults: auto
Specifies the latency tier to use for processing the request. This parameter is relevant for customers subscribed to the scale tier service:
- If set to 'auto', and the Project is Scale tier enabled, the system will utilize scale tier credits until they are exhausted.
- If set to 'auto', and the Project is not Scale tier enabled, the request will be processed using the default service tier with a lower uptime SLA and no latency guarentee.
- If set to 'default', the request will be processed using the default service tier with a lower uptime SLA and no latency guarentee.
- If set to 'flex', the request will be processed with the Flex Processing service tier. Learn more.
- When not set, the default behavior is 'auto'.
When this parameter is set, the response body will include the
service_tierutilized.autostring
defaultstring
flexstring
previous_response_idstring or null
The unique ID of the previous response to the model. Use this to create multi-turn conversations. Learn more about conversation state.
modelstring
Model ID used to generate the response, like
gpt-4ooro3. 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.modelstring
modelstring
gpt-4.1string
gpt-4.1-ministring
gpt-4.1-nanostring
gpt-4.1-2025-04-14string
gpt-4.1-mini-2025-04-14string
gpt-4.1-nano-2025-04-14string
o4-ministring
o4-mini-2025-04-16string
o3string
o3-2025-04-16string
o3-ministring
o3-mini-2025-01-31string
o1string
o1-2024-12-17string
o1-previewstring
o1-preview-2024-09-12string
o1-ministring
o1-mini-2024-09-12string
gpt-4ostring
gpt-4o-2024-11-20string
gpt-4o-2024-08-06string
gpt-4o-2024-05-13string
gpt-4o-audio-previewstring
gpt-4o-audio-preview-2024-10-01string
gpt-4o-audio-preview-2024-12-17string
gpt-4o-mini-audio-previewstring
gpt-4o-mini-audio-preview-2024-12-17string
gpt-4o-search-previewstring
gpt-4o-mini-search-previewstring
gpt-4o-search-preview-2025-03-11string
gpt-4o-mini-search-preview-2025-03-11string
chatgpt-4o-lateststring
gpt-4o-ministring
gpt-4o-mini-2024-07-18string
gpt-4-turbostring
gpt-4-turbo-2024-04-09string
gpt-4-0125-previewstring
gpt-4-turbo-previewstring
gpt-4-1106-previewstring
gpt-4-vision-previewstring
gpt-4string
gpt-4-0314string
gpt-4-0613string
gpt-4-32kstring
gpt-4-32k-0314string
gpt-4-32k-0613string
gpt-3.5-turbostring
gpt-3.5-turbo-16kstring
gpt-3.5-turbo-0301string
gpt-3.5-turbo-0613string
gpt-3.5-turbo-1106string
gpt-3.5-turbo-0125string
gpt-3.5-turbo-16k-0613string
ResponsesOnlyModelstring
o1-prostring
o1-pro-2025-03-19string
computer-use-previewstring
computer-use-preview-2025-03-11string
reasoningobject or null
o-series models only
Configuration options for reasoning models.
effortstring or nullDefaults: medium
o-series models only
Constrains effort on reasoning for reasoning models. Currently supported values are
low,medium, andhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.lowstring
mediumstring
highstring
summarystring or null
A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.autostring
concisestring
detailedstring
generate_summarystring or nullDeprecated
Deprecated: use
summaryinstead.A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.autostring
concisestring
detailedstring
max_output_tokensinteger or null
An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.
instructionsstring or null
Inserts a system (or developer) message as the first item in the model's context.
When using 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.textobject
Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more:
formatobject
An object specifying the format that the model must output.
Configuring
enables Structured Outputs, which ensures the model will match your supplied JSON schema. Learn more in the Structured Outputs guide.The default format is
with no additional options.Not recommended for gpt-4o and newer models:
Setting to
enables the older JSON mode, which ensures the message the model generates is valid JSON. Usingjson_schemais preferred for models that support it.Textobject
Default response format. Used to generate text responses.typestringRequired
The type of response format being defined. Always
text.textstring
JSON schemaobject
JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs.
typestringRequired
The type of response format being defined. Always
json_schema.json_schemastring
descriptionstring
A description of what the response format is for, used by the model to determine how to respond in the format.namestringRequired
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.schemaobjectRequired
The schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas here.
strictboolean or nullDefaults: false
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
schemafield. Only a subset of JSON Schema is supported whenstrictistrue. To learn more, read the Structured Outputs guide.
JSON objectobject
JSON object response format. An older method of generating JSON responses. Using
json_schemais recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so.typestringRequired
The type of response format being defined. Always
json_object.json_objectstring
toolsarray
An array of tools the model may call while generating a response. You can specify which tool to use by setting the
tool_choiceparameter.The two categories of tools you can provide the model are:
- Built-in tools: Tools that are provided by OpenAI that extend the model's capabilities, like web search or file search. Learn more about built-in tools.
- Function calls (custom tools): Functions that are defined by you, enabling the model to call your own code. Learn more about function calling.
File searchobject
A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
typestringRequiredDefaults: file_search
The type of the file search tool. Always
file_search.file_searchstring
vector_store_idsarrayRequired
The IDs of the vector stores to search.itemsstring
max_num_resultsinteger
The maximum number of results to return. This number should be between 1 and 50 inclusive.ranking_optionsobject
Ranking options for search.rankerstring
The ranker to use for the file search.autostring
default-2024-11-15string
score_thresholdnumber
The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
filtersobject or null
Comparison Filterobject
A filter used to compare a specified attribute key to a given value using a defined comparison operation.typestringRequiredDefaults: eq
Specifies the comparison operator:
eq,ne,gt,gte,lt,lte.eq: equalsne: not equalgt: greater thangte: greater than or equallt: less thanlte: less than or equal
eqstring
nestring
gtstring
gtestring
ltstring
ltestring
keystringRequired
The key to compare against the value.valuestring or number or boolean
The value to compare against the attribute key; supports string, number, or boolean types.valuestringRequired
valuenumberRequired
valuebooleanRequired
Compound Filterobject
Combine multiple filters using
andoror.typestringRequired
Type of operation:
andoror.andstring
orstring
filtersarrayRequired
Array of filters to combine. Items can be
ComparisonFilterorCompoundFilter.Comparison Filterobject
A filter used to compare a specified attribute key to a given value using a defined comparison operation.typestringRequiredDefaults: eq
Specifies the comparison operator:
eq,ne,gt,gte,lt,lte.eq: equalsne: not equalgt: greater thangte: greater than or equallt: less thanlte: less than or equal
eqstring
nestring
gtstring
gtestring
ltstring
ltestring
keystringRequired
The key to compare against the value.valuestring or number or boolean
The value to compare against the attribute key; supports string, number, or boolean types.valuestringRequired
valuenumberRequired
valuebooleanRequired
itemsobject
filtersnull
Functionobject
Defines a function in your own code the model can choose to call. Learn more about function calling.
typestringRequiredDefaults: function
The type of the function tool. Always
function.functionstring
namestringRequired
The name of the function to call.descriptionstring or null
descriptionstring
A description of the function. Used by the model to determine whether or not to call the function.descriptionnull
parametersobject or null
parametersobjectRequired
A JSON schema object describing the parameters of the function.parametersnullRequired
strictboolean or null
strictbooleanRequired
Whether to enforce strict parameter validation. Default
true.strictnullRequired
Web search previewobject
This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
typestringRequiredDefaults: web_search_preview
The type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.web_search_previewstring
web_search_preview_2025_03_11string
user_locationobject or null
user_locationobject
The user's location.typestringRequiredDefaults: approximate
The type of location approximation. Always
approximate.approximatestring
countrystring or null
countrystring
The two-letter ISO country code of the user, e.g.
US.countrynull
regionstring or null
regionstring
Free text input for the region of the user, e.g.
California.regionnull
citystring or null
citystring
Free text input for the city of the user, e.g.
San Francisco.citynull
timezonestring or null
timezonestring
The IANA timezone of the user, e.g.
America/Los_Angeles.timezonenull
user_locationnull
search_context_sizestring
High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.lowstring
mediumstring
highstring
Computer use previewobject
A tool that controls a virtual computer. Learn more about the computer tool.
typestringRequiredDefaults: computer_use_preview
The type of the computer use tool. Always
computer_use_preview.computer_use_previewstring
environmentstringRequired
The type of computer environment to control.windowsstring
macstring
linuxstring
ubuntustring
browserstring
display_widthintegerRequired
The width of the computer display.display_heightintegerRequired
The height of the computer display.
tool_choicestring or object
How the model should select which tool (or tools) to use when generating a response. See the
toolsparameter to see how to specify which tools the model can call.Tool choice modestring
Controls which (if any) tool is called by the model.
nonemeans the model will not call any tool and instead generates a message.automeans the model can pick between generating a message or calling one or more tools.requiredmeans the model must call one or more tools.nonestring
autostring
requiredstring
Hosted toolobject
Indicates that the model should use a built-in tool to generate a response. Learn more about built-in tools.
typestringRequired
The type of hosted tool the model should to use. Learn more about built-in tools.
Allowed values are:
file_searchweb_search_previewcomputer_use_preview
file_searchstring
web_search_previewstring
computer_use_previewstring
web_search_preview_2025_03_11string
Function toolobject
Use this option to force the model to call a specific function.typestringRequired
For function calling, the type is always
function.functionstring
namestringRequired
The name of the function to call.
truncationstring or nullDefaults: disabled
The truncation strategy to use for the model response.
auto: If the context of this response and previous ones exceeds the model's context window size, the model will truncate the response to fit the context window by dropping input items in the middle of the conversation.disabled(default): If a model response will exceed the context window size for a model, the request will fail with a 400 error.
autostring
disabledstring
inputstring or array
Text, image, or file inputs to the model, used to generate a response.
Learn more:
Text inputstringRequired
A text input to the model, equivalent to a text input with the
userrole.Input item listarrayRequired
A list of one or many input items to the model, containing different content types.Input messageobject
A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole. Messages with theassistantrole are presumed to have been generated by the model in previous interactions.rolestringRequired
The role of the message input. One of
user,assistant,system, ordeveloper.userstring
assistantstring
systemstring
developerstring
contentstring or array
Text, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses.Text inputstringRequired
A text input to the model.Input item content listarrayRequired
A list of one or many input items to the model, containing different content types.Input textobject
A text input to the model.typestringRequiredDefaults: input_text
The type of the input item. Always
input_text.input_textstring
textstringRequired
The text input to the model.
Input imageobject
An image input to the model. Learn about image inputs.
typestringRequiredDefaults: input_image
The type of the input item. Always
input_image.input_imagestring
image_urlstring or null
image_urlstring
The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.image_urlnull
file_idstring or null
file_idstring
The ID of the file to be sent to the model.file_idnull
detailstringRequired
The detail level of the image to be sent to the model. One of
high,low, orauto. Defaults toauto.lowstring
highstring
autostring
Input fileobject
A file input to the model.typestringRequiredDefaults: input_file
The type of the input item. Always
input_file.input_filestring
file_idstring or null
file_idstring
The ID of the file to be sent to the model.file_idnull
filenamestring
The name of the file to be sent to the model.file_datastring
The content of the file to be sent to the model.
typestring
The type of the message input. Always
message.messagestring
Input messageobject
A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole.typestring
The type of the message input. Always set to
message.messagestring
rolestringRequired
The role of the message input. One of
user,system, ordeveloper.userstring
systemstring
developerstring
statusstring
The status of item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.in_progressstring
completedstring
incompletestring
contentarrayRequired
A list of one or many input items to the model, containing different content types.Input textobject
A text input to the model.typestringRequiredDefaults: input_text
The type of the input item. Always
input_text.input_textstring
textstringRequired
The text input to the model.
Input imageobject
An image input to the model. Learn about image inputs.
typestringRequiredDefaults: input_image
The type of the input item. Always
input_image.input_imagestring
image_urlstring or null
image_urlstring
The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.image_urlnull
file_idstring or null
file_idstring
The ID of the file to be sent to the model.file_idnull
detailstringRequired
The detail level of the image to be sent to the model. One of
high,low, orauto. Defaults toauto.lowstring
highstring
autostring
Input fileobject
A file input to the model.typestringRequiredDefaults: input_file
The type of the input item. Always
input_file.input_filestring
file_idstring or null
file_idstring
The ID of the file to be sent to the model.file_idnull
filenamestring
The name of the file to be sent to the model.file_datastring
The content of the file to be sent to the model.
Output messageobject
An output message from the model.idstringRequired
The unique ID of the output message.typestringRequired
The type of the output message. Always
message.messagestring
rolestringRequired
The role of the output message. Always
assistant.assistantstring
contentarrayRequired
The content of the output message.Output textobject
A text output from the model.typestringRequiredDefaults: output_text
The type of the output text. Always
output_text.output_textstring
textstringRequired
The text output from the model.annotationsarrayRequired
The annotations of the text output.File citationobject
A citation to a file.typestringRequiredDefaults: file_citation
The type of the file citation. Always
file_citation.file_citationstring
file_idstringRequired
The ID of the file.indexintegerRequired
The index of the file in the list of files.
URL citationobject
A citation for a web resource used to generate a model response.typestringRequiredDefaults: url_citation
The type of the URL citation. Always
url_citation.url_citationstring
urlstringRequired
The URL of the web resource.start_indexintegerRequired
The index of the first character of the URL citation in the message.end_indexintegerRequired
The index of the last character of the URL citation in the message.titlestringRequired
The title of the web resource.
File pathobject
A path to a file.typestringRequired
The type of the file path. Always
file_path.file_pathstring
file_idstringRequired
The ID of the file.indexintegerRequired
The index of the file in the list of files.
Refusalobject
A refusal from the model.typestringRequiredDefaults: refusal
The type of the refusal. Always
refusal.refusalstring
refusalstringRequired
The refusal explanationfrom the model.
statusstringRequired
The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.in_progressstring
completedstring
incompletestring
File search tool callobject
The results of a file search tool call. See the file search guide for more information.
idstringRequired
The unique ID of the file search tool call.typestringRequired
The type of the file search tool call. Always
file_search_call.file_search_callstring
statusstringRequired
The status of the file search tool call. One of
in_progress,searching,incompleteorfailed,in_progressstring
searchingstring
completedstring
incompletestring
failedstring
queriesarrayRequired
The queries used to search for files.itemsstring
resultsarray or null
The results of the file search tool call.itemsobject
file_idstring
The unique ID of the file.textstring
The text that was retrieved from the file.filenamestring
The name of the file.attributesobject or 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, booleans, or numbers.scorenumber
The relevance score of the file - a value between 0 and 1.
Computer tool callobject
A tool call to a computer use tool. See the computer use guide for more information.
typestringRequiredDefaults: computer_call
The type of the computer call. Always
computer_call.computer_callstring
idstringRequired
The unique ID of the computer call.call_idstringRequired
An identifier used when responding to the tool call with output.actionobject
ClickobjectRequired
A click action.typestringRequiredDefaults: click
Specifies the event type. For a click action, this property is always set to
click.clickstring
buttonstringRequired
Indicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.leftstring
rightstring
wheelstring
backstring
forwardstring
xintegerRequired
The x-coordinate where the click occurred.yintegerRequired
The y-coordinate where the click occurred.
DoubleClickobjectRequired
A double click action.typestringRequiredDefaults: double_click
Specifies the event type. For a double click action, this property is always set to
double_click.double_clickstring
xintegerRequired
The x-coordinate where the double click occurred.yintegerRequired
The y-coordinate where the double click occurred.
DragobjectRequired
A drag action.typestringRequiredDefaults: drag
Specifies the event type. For a drag action, this property is always set to
drag.dragstring
patharrayRequired
An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
itemsobject
A series of x/y coordinate pairs in the drag path.xintegerRequired
The x-coordinate.yintegerRequired
The y-coordinate.
KeyPressobjectRequired
A collection of keypresses the model would like to perform.typestringRequiredDefaults: keypress
Specifies the event type. For a keypress action, this property is always set to
keypress.keypressstring
keysarrayRequired
The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.itemsstring
One of the keys the model is requesting to be pressed.
MoveobjectRequired
A mouse move action.typestringRequiredDefaults: move
Specifies the event type. For a move action, this property is always set to
move.movestring
xintegerRequired
The x-coordinate to move to.yintegerRequired
The y-coordinate to move to.
ScreenshotobjectRequired
A screenshot action.typestringRequiredDefaults: screenshot
Specifies the event type. For a screenshot action, this property is always set to
screenshot.screenshotstring
ScrollobjectRequired
A scroll action.typestringRequiredDefaults: scroll
Specifies the event type. For a scroll action, this property is always set to
scroll.scrollstring
xintegerRequired
The x-coordinate where the scroll occurred.yintegerRequired
The y-coordinate where the scroll occurred.scroll_xintegerRequired
The horizontal scroll distance.scroll_yintegerRequired
The vertical scroll distance.
TypeobjectRequired
An action to type in text.typestringRequiredDefaults: type
Specifies the event type. For a type action, this property is always set to
type.typestring
textstringRequired
The text to type.
WaitobjectRequired
A wait action.typestringRequiredDefaults: wait
Specifies the event type. For a wait action, this property is always set to
wait.waitstring
pending_safety_checksarrayRequired
The pending safety checks for the computer call.itemsobject
A pending safety check for the computer call.idstringRequired
The ID of the pending safety check.codestringRequired
The type of the pending safety check.messagestringRequired
Details about the pending safety check.
statusstringRequired
The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.in_progressstring
completedstring
incompletestring
Computer tool call outputobject
The output of a computer tool call.idstring or null
idstring
The ID of the computer tool call output.idnull
call_idstringRequired
The ID of the computer tool call that produced the output.typestringRequiredDefaults: computer_call_output
The type of the computer tool call output. Always
computer_call_output.computer_call_outputstring
outputobjectRequired
A computer screenshot image used with the computer use tool.typestringRequiredDefaults: computer_screenshot
Specifies the event type. For a computer screenshot, this property is always set to
computer_screenshot.computer_screenshotstring
image_urlstring
The URL of the screenshot image.file_idstring
The identifier of an uploaded file that contains the screenshot.
acknowledged_safety_checksarray or null
acknowledged_safety_checksarray
The safety checks reported by the API that have been acknowledged by the developer.itemsobject
A pending safety check for the computer call.idstringRequired
The ID of the pending safety check.codestring or null
codestring
The type of the pending safety check.codenull
messagestring or null
messagestring
Details about the pending safety check.messagenull
acknowledged_safety_checksnull
statusstring or null
statusstring
The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.in_progressstring
completedstring
incompletestring
statusnull
Web search tool callobject
The results of a web search tool call. See the web search guide for more information.
idstringRequired
The unique ID of the web search tool call.typestringRequired
The type of the web search tool call. Always
web_search_call.web_search_callstring
statusstringRequired
The status of the web search tool call.in_progressstring
searchingstring
completedstring
failedstring
Function tool callobject
A tool call to run a function. See the function calling guide for more information.
idstring
The unique ID of the function tool call.typestringRequired
The type of the function tool call. Always
function_call.function_callstring
call_idstringRequired
The unique ID of the function tool call generated by the model.namestringRequired
The name of the function to run.argumentsstringRequired
A JSON string of the arguments to pass to the function.statusstring
The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.in_progressstring
completedstring
incompletestring
Function tool call outputobject
The output of a function tool call.idstring or null
idstring
The unique ID of the function tool call output. Populated when this item is returned via API.idnull
call_idstringRequired
The unique ID of the function tool call generated by the model.typestringRequiredDefaults: function_call_output
The type of the function tool call output. Always
function_call_output.function_call_outputstring
outputstringRequired
A JSON string of the output of the function tool call.statusstring or null
statusstring
The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.in_progressstring
completedstring
incompletestring
statusnull
Reasoningobject
A description of the chain of thought used by a reasoning model while generating a response.typestringRequired
The type of the object. Always
reasoning.reasoningstring
idstringRequired
The unique identifier of the reasoning content.summaryarrayRequired
Reasoning text contents.itemsobject
typestringRequired
The type of the object. Always
summary_text.summary_textstring
textstringRequired
A short summary of the reasoning used by the model when generating the response.
statusstring
The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.in_progressstring
completedstring
incompletestring
Item referenceobject
An internal identifier for an item to reference.typestring or null
typestringDefaults: item_reference
The type of item to reference. Always
item_reference.item_referencestring
typenull
idstringRequired
The ID of the item to reference.
includearray or null
Specify additional output data to include in the model response. Currently supported values are:
file_search_call.results: Include the search results of the file search tool call.message.input_image.image_url: Include image urls from the input message.computer_call_output.output.image_url: Include image urls from the computer call output.
itemsstring
Specify additional output data to include in the model response. Currently supported values are:
file_search_call.results: Include the search results of the file search tool call.message.input_image.image_url: Include image urls from the input message.computer_call_output.output.image_url: Include image urls from the computer call output.
file_search_call.resultsstring
message.input_image.image_urlstring
computer_call_output.output.image_urlstring
parallel_tool_callsboolean or nullDefaults: true
Whether to allow the model to run tool calls in parallel.storeboolean or nullDefaults: true
Whether to store the generated model response for later retrieval via API.streamboolean or nullDefaults: false
If set to true, the model response data will be streamed to the client as it is generated using server-sent events. See the Streaming section below for more information.
Response
Returns a Response object.
1 curl https://api.openai.com/v1/responses \2 -H "Content-Type: application/json" \3 -H "Authorization: Bearer $OPENAI_API_KEY" \4 -d '{5 "model": "gpt-4.1",6 "input": "Tell me a three sentence bedtime story about a unicorn."7 }'
1 {2 "id": "resp_67ccd2bed1ec8190b14f964abc0542670bb6a6b452d3795b",3 "object": "response",4 "created_at": 1741476542,5 "status": "completed",6 "error": null,7 "incomplete_details": null,8 "instructions": null,9 "max_output_tokens": null,10 "model": "gpt-4.1-2025-04-14",11 "output": [12 {13 "type": "message",14 "id": "msg_67ccd2bf17f0819081ff3bb2cf6508e60bb6a6b452d3795b",15 "status": "completed",16 "role": "assistant",17 "content": [18 {19 "type": "output_text",20 "text": "In a peaceful grove beneath a silver moon, a unicorn named Lumina discovered a hidden pool that reflected the stars. As she dipped her horn into the water, the pool began to shimmer, revealing a pathway to a magical realm of endless night skies. Filled with wonder, Lumina whispered a wish for all who dream to find their own hidden magic, and as she glanced back, her hoofprints sparkled like stardust.",21 "annotations": []22 }23 ]24 }25 ],26 "parallel_tool_calls": true,27 "previous_response_id": null,28 "reasoning": {29 "effort": null,30 "summary": null31 },32 "store": true,33 "temperature": 1.0,34 "text": {35 "format": {36 "type": "text"37 }38 },39 "tool_choice": "auto",40 "tools": [],41 "top_p": 1.0,42 "truncation": "disabled",43 "usage": {44 "input_tokens": 36,45 "input_tokens_details": {46 "cached_tokens": 047 },48 "output_tokens": 87,49 "output_tokens_details": {50 "reasoning_tokens": 051 },52 "total_tokens": 12353 },54 "user": null,55 "metadata": {}56 }