Create response
/v1/responsesCreate a model response. Use this endpoint for OpenAI-compatible Responses models.
Authentication
Authorization Bearer
API key as bearer token in Authorization header.
Headers
AuthorizationstringRequired. Bearer API key.
Content-TypestringRequest body content type.
Request Body
backgroundbooleanWhether to run the response in the background. Explicit true is not supported.
context_managementobject[]Context management configuration.
context_management.type"compaction"Context management entry type.
context_management.compact_thresholdnumberToken threshold for compaction.
conversationstring | objectConversation ID or conversation object. Stateful conversations are not supported.
conversation.idstringConversation ID.
includestring[]Additional output data to include. Values must match the requested model and enabled features.
inputstring | ResponseInputItem[]Text, image, file, or structured input items.
input.typestringInput item type.
input.role"user" | "assistant" | "system" | "developer"Message role.
input.contentstring | ResponseInputContent[]Text or content parts.
input.idstringInput item ID when referencing an existing item.
input.call_idstringTool or function call ID.
input.outputstring | object[]Output for function, computer, or tool call results.
input.status"in_progress" | "completed" | "incomplete"Input item status when present.
instructionsstringSystem-level instructions.
max_output_tokensnumberUpper bound for generated tokens, including visible output and reasoning tokens.
max_tool_callsnumberMaximum total built-in tool calls for the response. Applies when tools are available.
metadataobjectUp to 16 key-value pairs attached to the response.
modelstringRequired. Model ID from /v1/models.
moderationobjectModeration configuration, when supported.
moderation.modelstringModeration model to use.
parallel_tool_callsbooleanWhether parallel tool calls are allowed, when supported.
previous_response_idstringPrevious response ID for multi-turn state. This field is not supported.
promptobjectReusable prompt template reference. Requires an existing prompt template ID.
prompt.idstringPrompt template ID.
prompt.variablesobjectTemplate variable values.
prompt.versionstringPrompt template version.
prompt_cache_keystringCache key used to improve cache hit rates.
prompt_cache_retention"in_memory" | "24h"Prompt cache retention policy.
reasoningobjectReasoning configuration.
reasoning.context"auto" | "current_turn" | "all_turns"Which reasoning items are rendered back on later turns.
reasoning.effort"none" | "minimal" | "low" | "medium" | "high" | "xhigh"Reasoning effort.
reasoning.generate_summary"auto" | "concise" | "detailed"Deprecated reasoning summary option.
reasoning.summary"auto" | "concise" | "detailed"Reasoning summary option.
safety_identifierstringStable end-user identifier for safety systems.
service_tier"auto" | "default" | "flex" | "scale" | "priority"Processing tier.
storebooleanMust be false or omitted. Explicit true is not supported.
streambooleanWhether to stream the response using Server-Sent Events.
stream_optionsobjectStreaming options. Applies to streamed responses.
stream_options.include_obfuscationbooleanWhether to include stream obfuscation fields.
temperaturenumberSampling temperature between 0 and 2.
textobjectText response configuration.
text.formatobjectResponse format configuration.
text.verbosity"low" | "medium" | "high"Response verbosity.
tool_choice"none" | "auto" | "required" | objectHow the model should select tools. Tool choices depend on the provided tools and model capabilities.
tool_choice.typestringTool choice object type.
tool_choice.mode"auto" | "required"Allowed tools mode.
tool_choice.toolsobject[]Allowed tool definitions.
tool_choice.namestringTool name when forcing a specific tool.
tool_choice.server_labelstringMCP server label.
toolsobject[]Tools the model may call while generating a response. Tool types and nested fields depend on model and account capabilities.
tools.typestringTool type.
tools.namestringTool or function name.
tools.descriptionstringTool description.
tools.parametersobjectFunction parameters JSON schema.
tools.input_schemaobjectCustom tool input schema.
tools.vector_store_idsstring[]Vector store IDs for file search.
tools.filtersobjectFile search filters.
tools.max_num_resultsnumberMaximum file search results.
tools.search_context_size"low" | "medium" | "high"Search context size for web search.
tools.user_locationobjectApproximate user location for web search.
tools.server_labelstringMCP server label.
tools.server_urlstringMCP server URL.
tools.allowed_toolsobject | string[]Allowed MCP tools.
tools.require_approvalstring | objectMCP tool approval policy.
tools.containerobject | stringContainer configuration for code tools.
tools.partial_imagesnumberNumber of partial images for image generation streaming.
top_logprobsnumberNumber of most likely tokens to return at each token position, from 0 to 20.
top_pnumberNucleus sampling value.
truncation"auto" | "disabled"Input truncation strategy.
userstringDeprecated stable end-user identifier. Prefer safety_identifier and prompt_cache_key.
Parameter compatibility
Some fields are conditional or intentionally unsupported depending on the selected model, enabled features, and whether the request requires stored response state:
background: true,conversation,previous_response_id, andstore: trueare stateful operations and return501 unsupported_feature.promptrequires an existing prompt template ID.- Image and file input parts require model support and valid
file_id, URL, or data values. - Tool fields are tool-type dependent.
includevalues andtop_logprobsmust match the requested output features.stream_optionsis intended for streaming requests.
Response
idstringResponse ID.
created_atnumberUnix timestamp in seconds.
errorobject|nullError object when response generation fails.
error.codestringError code.
error.messagestringError message.
incomplete_detailsobject|nullDetails for incomplete responses.
incomplete_details.reason"max_output_tokens" | "content_filter"Incomplete reason.
instructionsstring | object[] | nullInstructions used for the response.
max_output_tokensnumber|nullMaximum output token setting.
modelstringModel identifier.
object"response"Object type.
outputobject[]Output items.
output.idstringOutput item ID.
output.typestringOutput item type.
output.status"in_progress" | "completed" | "incomplete"Output item status.
output.rolestringRole for message output items.
output.contentobject[]Content parts.
output.call_idstringTool or function call ID.
output.namestringTool or function name.
output.argumentsstringFunction call arguments.
output.outputstring | object[]Function or tool output.
output.summaryobject[]Reasoning summary items.
output.encrypted_contentstringEncrypted reasoning content when included.
output_textstringConcatenated text output, when available.
parallel_tool_callsbooleanWhether parallel tool calls were allowed.
previous_response_idstring|nullPrevious response ID.
promptobject|nullPrompt template reference.
prompt.idstringPrompt template ID.
prompt.variablesobjectPrompt variables.
prompt.versionstringPrompt version.
prompt_cache_keystringPrompt cache key.
prompt_cache_retention"in_memory" | "24h"Prompt cache retention policy.
reasoningobject|nullReasoning configuration used.
reasoning.context"auto" | "current_turn" | "all_turns"Reasoning context mode.
reasoning.effort"none" | "minimal" | "low" | "medium" | "high" | "xhigh"Reasoning effort.
reasoning.summary"auto" | "concise" | "detailed" | nullReasoning summary mode.
safety_identifierstringStable end-user identifier.
service_tier"auto" | "default" | "flex" | "scale" | "priority"Service tier used.
status"completed" | "failed" | "in_progress" | "cancelled" | "queued" | "incomplete"Response status.
storebooleanWhether the response was stored.
temperaturenumberSampling temperature.
textobjectText response configuration.
text.formatobjecttext.verbosity"low" | "medium" | "high"Verbosity setting.
tool_choicestring | objectTool choice used.
toolsobject[]Tool definitions used.
top_logprobsnumberTop logprobs setting.
top_pnumberNucleus sampling setting.
truncation"auto" | "disabled"Truncation strategy.
usageobjectToken usage.
usage.input_tokensnumberInput token count.
usage.input_tokens_detailsobjectusage.output_tokensnumberOutput token count.
usage.output_tokens_detailsobjectusage.total_tokensnumberTotal token count.
userstringDeprecated end-user identifier.
metadataobjectMetadata attached to the response.
Unsupported stateful operations
Requests that require stored response state return 501 unsupported_feature, including:
previous_response_idconversationbackground: truestore: true/v1/responses/{response_id}/v1/responses/{response_id}/input_items/v1/responses/{response_id}/cancel