- Request
- Body
- InputTextContent
- ImageDetail
- InputImageContent
- FileInputDetail
- InputFileContent
- InputContent
- InputMessageContentList
- InputMessage
- FileCitationBody
- UrlCitationBody
- ContainerFileCitationBody
- FilePath
- Annotation
- TopLogProb
- LogProb
- OutputTextContent
- RefusalContent
- OutputMessageContent
- MessagePhase
- OutputMessage
- VectorStoreFileAttributes
- FileSearchToolCall
- WebSearchActionSearch
- WebSearchActionOpenPage
- WebSearchActionFind
- WebSearchToolCall
- FunctionToolCall
- InputTextContentParam
- InputImageContentParamAutoParam
- InputFileContentParam
- FunctionCallItemStatus
- FunctionCallOutputItemParam
- SummaryTextContent
- ReasoningTextContent
- ReasoningItem
- CompactionSummaryItemParam
- CompactionTrigger
- ImageGenToolCall
- CodeInterpreterOutputLogs
- CodeInterpreterOutputImage
- CodeInterpreterToolCall
- FunctionShellAction
- ContainerReferenceResource
- FunctionShellCall
- FunctionShellCallOutputTimeoutOutcome
- FunctionShellCallOutputExitOutcome
- FunctionShellCallOutputContent
- FunctionShellCallOutput
- MCPListToolsTool
- MCPListTools
- MCPApprovalRequest
- MCPApprovalResponse
- MCPToolCallStatus
- MCPToolCall
- Item
- ItemReferenceParam
- InputItem
- FunctionTool
- RankerVersionType
- HybridSearchOptions
- RankingOptions
- ComparisonFilter
- CompoundFilter
- Filters
- FileSearchTool
- WebSearchApproximateLocation
- WebSearchTool
- MCPToolFilter
- MCPTool
- ContainerMemoryLimit
- ContainerNetworkPolicyDisabledParam
- ContainerNetworkPolicyDomainSecretParam
- ContainerNetworkPolicyAllowlistParam
- AutoCodeInterpreterToolParam
- CodeInterpreterTool
- SkillReference
- ShellContainerAuto
- ShellEnvironment
- FunctionShellTool
- InputFidelity
- ImageGenActionEnum
- ImageGenTool
- Tool
- ResponseFormatText
- ResponseFormatJsonSchemaSchema
- TextResponseFormatJsonSchema
- ResponseFormatJsonObject
- TextResponseFormatConfiguration
- Verbosity
- ResponseTextParam
- ReasoningEffort
- Reasoning
- TruncationEnum
- ConversationParam-2
- ConversationParam
- ToolChoiceOptions
- ToolChoiceAllowed
- ToolChoiceTypes
- ToolChoiceFunction
- ToolChoiceMCP
- ToolChoiceCustom
- SpecificApplyPatchParam
- SpecificFunctionShellParam
- ToolChoiceParam
- Responses
- 200 OK
Get input token counts
CURRENTLY NOT SUPPORTED
Returns input token counts of the request. Returns an object with object set to response.input_tokens and an input_tokens count.
Request
POST
https://ai.api.cloud.yandex.net/v1/responses/input_tokens
Body
application/json
{
"model": "example",
"input": "example",
"previous_response_id": "example",
"tools": [
{
"type": "function",
"name": "example",
"description": "example",
"parameters": {},
"strict": true,
"defer_loading": true
}
],
"text": {
"format": {
"type": "text"
},
"verbosity": "medium"
},
"reasoning": {
"effort": "medium"
},
"truncation": "auto",
"instructions": "example",
"conversation": null,
"tool_choice": "none",
"parallel_tool_calls": true
}
|
Name |
Description |
|
conversation |
Type: ConversationParam The conversation that this response belongs to. Items from this conversation are prepended to Default: Example: |
|
input |
One of 2 types
Text, image, or file inputs to the model, used to generate a response Example: |
|
instructions |
Type: string A system (or developer) message inserted into the model's context. Example: |
|
model |
Type: string Model ID used to generate the response. AI Studio offers a wide range of models with different capabilities, performance characteristics, and price points. Example: |
|
parallel_tool_calls |
Type: boolean Whether to allow the model to run tool calls in parallel. |
|
previous_response_id |
Type: string The unique ID of the previous response to the model. Use this to create multi-turn conversations. Cannot be used in conjunction with Example: |
|
reasoning |
Type: Reasoning Configuration options for reasoning models. Example
|
|
text |
Type: ResponseTextParam Configuration options for a text response from the model. Can be plain text or structured JSON data. Example
|
|
tool_choice |
Type: ToolChoiceParam Controls which tool the model should use, if any. How the model should select which tool (or tools) to use when generating a response. See the Example: |
|
tools |
Type: Tool[] An array of tools the model may call while generating a response. You can specify which tool to use by setting the Example
|
|
truncation |
Type: TruncationEnum The truncation strategy to use for the model response.
Enum: |
InputTextContent
A text input to the model.
|
Name |
Description |
|
text |
Type: string The text input to the model. Example: |
|
type |
Type: string The type of the input item. Always Default: Const: |
Example
{
"type": "input_text",
"text": "example"
}
ImageDetail
Type: string
Enum: low, high, auto, original
InputImageContent
An image input to the model.
|
Name |
Description |
|
detail |
Type: ImageDetail The detail level of the image to be sent to the model. One of Enum: |
|
type |
Type: string The type of the input item. Always Default: Const: |
|
file_id |
Type: string The ID of the file to be sent to the model. Example: |
|
image_url |
Type: string The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. Example: |
Example
{
"type": "input_image",
"image_url": "example",
"file_id": "example",
"detail": "low"
}
FileInputDetail
Type: string
Enum: low, high
InputFileContent
A file input to the model.
|
Name |
Description |
|
type |
Type: string The type of the input item. Always Default: Const: |
|
detail |
Type: FileInputDetail The detail level of the file to be sent to the model. Use Enum: |
|
file_data |
Type: string The content of the file to be sent to the model. Example: |
|
file_id |
Type: string The ID of the file to be sent to the model. Example: |
|
file_url |
Type: string The URL of the file to be sent to the model. Example: |
|
filename |
Type: string The name of the file to be sent to the model. Example: |
Example
{
"type": "input_file",
"file_id": "example",
"filename": "example",
"file_data": "example",
"file_url": "example",
"detail": "low"
}
InputContent
One of 3 types
-
Input text
Type: InputTextContent
A text input to the model.
Example
{ "type": "input_text", "text": "example" } -
Input image
Type: InputImageContent
An image input to the model.
Example
{ "type": "input_image", "image_url": "example", "file_id": "example", "detail": "low" } -
Input file
Type: InputFileContent
A file input to the model.
Example
{ "type": "input_file", "file_id": "example", "filename": "example", "file_data": "example", "file_url": "example", "detail": "low" }
Example
{
"type": "input_text",
"text": "example"
}
InputMessageContentList
A list of one or many input items to the model, containing different content types.
Type: InputContent[]
Example
[
{
"type": "input_text",
"text": "example"
}
]
InputMessage
A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role.
|
Name |
Description |
|
content |
Type: InputMessageContentList A list of one or many input items to the model, containing different content types. Example
|
|
role |
Type: string The role of the message input. One of Enum: |
|
status |
Type: string The status of item. One of Enum: |
|
type |
Type: string The type of the message input. Always set to Const: Example: |
Example
{
"type": "message",
"role": "user",
"status": "in_progress",
"content": [
{
"type": "input_text",
"text": "example"
}
]
}
FileCitationBody
A citation to a file.
|
Name |
Description |
|
file_id |
Type: string The ID of the file. Example: |
|
filename |
Type: string The filename of the file cited. Example: |
|
index |
Type: integer The index of the file in the list of files. |
|
type |
Type: string The type of the file citation. Always Default: Const: |
Example
{
"type": "file_citation",
"file_id": "example",
"index": 0,
"filename": "example"
}
UrlCitationBody
A citation for a web resource used to generate a model response.
|
Name |
Description |
|
end_index |
Type: integer The index of the last character of the URL citation in the message. |
|
start_index |
Type: integer The index of the first character of the URL citation in the message. |
|
title |
Type: string The title of the web resource. Example: |
|
type |
Type: string The type of the URL citation. Always Default: Const: |
|
url |
Type: string The URL of the web resource. Example: |
Example
{
"type": "url_citation",
"url": "example",
"start_index": 0,
"end_index": 0,
"title": "example"
}
ContainerFileCitationBody
A citation for a container file used to generate a model response.
|
Name |
Description |
|
container_id |
Type: string The ID of the container file. Example: |
|
end_index |
Type: integer The index of the last character of the container file citation in the message. |
|
file_id |
Type: string The ID of the file. Example: |
|
filename |
Type: string The filename of the container file cited. Example: |
|
start_index |
Type: integer The index of the first character of the container file citation in the message. |
|
type |
Type: string The type of the container file citation. Always Default: Const: |
Example
{
"type": "container_file_citation",
"container_id": "example",
"file_id": "example",
"start_index": 0,
"end_index": 0,
"filename": "example"
}
FilePath
A path to a file.
|
Name |
Description |
|
file_id |
Type: string The ID of the file. Example: |
|
index |
Type: integer The index of the file in the list of files. |
|
type |
Type: string The type of the file path. Always Const: Example: |
Example
{
"type": "file_path",
"file_id": "example",
"index": 0
}
Annotation
An annotation that applies to a span of output text.
One of 4 types
-
File citation
Type: FileCitationBody
A citation to a file.
Example
{ "type": "file_citation", "file_id": "example", "index": 0, "filename": "example" } -
URL citation
Type: UrlCitationBody
A citation for a web resource used to generate a model response.
Example
{ "type": "url_citation", "url": "example", "start_index": 0, "end_index": 0, "title": "example" } -
Container file citation
Type: ContainerFileCitationBody
A citation for a container file used to generate a model response.
Example
{ "type": "container_file_citation", "container_id": "example", "file_id": "example", "start_index": 0, "end_index": 0, "filename": "example" } -
File path
Type: FilePath
A path to a file.
Example
{ "type": "file_path", "file_id": "example", "index": 0 }
Example
{
"type": "file_citation",
"file_id": "example",
"index": 0,
"filename": "example"
}
TopLogProb
The top log probability of a token.
|
Name |
Description |
|
bytes |
Type: integer[] Example
|
|
logprob |
Type: number |
|
token |
Type: string Example: |
Example
{
"token": "example",
"logprob": 0.5,
"bytes": [
0
]
}
LogProb
The log probability of a token.
|
Name |
Description |
|
bytes |
Type: integer[] Example
|
|
logprob |
Type: number |
|
token |
Type: string Example: |
|
top_logprobs |
Type: TopLogProb[] Example
|
Example
{
"token": "example",
"logprob": 0.5,
"bytes": [
0
],
"top_logprobs": [
{
"token": "example",
"logprob": 0.5,
"bytes": [
0
]
}
]
}
OutputTextContent
A text output from the model.
|
Name |
Description |
|
annotations |
Type: Annotation[] The annotations of the text output. Example
|
|
logprobs |
Type: LogProb[] Example
|
|
text |
Type: string The text output from the model. Example: |
|
type |
Type: string The type of the output text. Always Default: Const: |
Example
{
"type": "output_text",
"text": "example",
"annotations": [
{
"type": "file_citation",
"file_id": "example",
"index": 0,
"filename": "example"
}
],
"logprobs": [
{
"token": "example",
"logprob": 0.5,
"bytes": [
0
],
"top_logprobs": [
{
"token": "example",
"logprob": 0.5,
"bytes": [
null
]
}
]
}
]
}
RefusalContent
A refusal from the model.
|
Name |
Description |
|
refusal |
Type: string The refusal explanation from the model. Example: |
|
type |
Type: string The type of the refusal. Always Default: Const: |
Example
{
"type": "refusal",
"refusal": "example"
}
OutputMessageContent
One of 2 types
-
Output text
Type: OutputTextContent
A text output from the model.
Example
{ "type": "output_text", "text": "example", "annotations": [ { "type": "file_citation", "file_id": "example", "index": 0, "filename": "example" } ], "logprobs": [ { "token": "example", "logprob": 0.5, "bytes": [ 0 ], "top_logprobs": [ { "token": "example", "logprob": 0.5, "bytes": [ null ] } ] } ] } -
Refusal
Type: RefusalContent
A refusal from the model.
Example
{ "type": "refusal", "refusal": "example" }
Example
{
"type": "output_text",
"text": "example",
"annotations": [
{
"type": "file_citation",
"file_id": "example",
"index": 0,
"filename": "example"
}
],
"logprobs": [
{
"token": "example",
"logprob": 0.5,
"bytes": [
0
],
"top_logprobs": [
{}
]
}
]
}
MessagePhase
Labels an assistant message as intermediate commentary (commentary) or the final answer (final_answer). Not used for user messages.
Type: string
Enum: commentary, final_answer
OutputMessage
An output message from the model.
|
Name |
Description |
|
content |
Type: OutputMessageContent[] The content of the output message. Example
|
|
id |
Type: string The unique ID of the output message. Example: |
|
role |
Type: string The role of the output message. Always Const: Example: |
|
status |
Type: string The status of the message input. One of Enum: |
|
type |
Type: string The type of the output message. Always Const: Example: |
|
phase |
Type: MessagePhase Labels an Enum: |
Example
{
"id": "example",
"type": "message",
"role": "assistant",
"content": [
{
"type": "output_text",
"text": "example",
"annotations": [
null
],
"logprobs": [
{}
]
}
],
"phase": "commentary",
"status": "in_progress"
}
VectorStoreFileAttributes
Any of 2 types
-
Type: object
[additional]
One of 3 types
-
Type: string
Max length:
512Example:
example -
Type: number
-
Type: boolean
Example:
exampleSet of 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.
Max properties:
16Example
{} -
-
Type: unknown
Example:
null
Default: null
FileSearchToolCall
The results of a File Search tool call.
|
Name |
Description |
||||||||||
|
id |
Type: string The unique ID of the file search tool call. Example: |
||||||||||
|
queries |
Type: string[] The queries used to search for files. Example
|
||||||||||
|
status |
Type: string The status of the file search tool call. One of Enum: |
||||||||||
|
type |
Type: string The type of the file search tool call. Always Const: Example: |
||||||||||
|
results |
Type: object[]
The results of the file search tool call. Example
|
Example
{
"id": "example",
"type": "file_search_call",
"status": "in_progress",
"queries": [
"example"
],
"results": [
{
"file_id": "example",
"text": "example",
"filename": "example",
"attributes": null,
"score": 0.5
}
]
}
WebSearchActionSearch
Action type "search" - Performs a web search query.
|
Name |
Description |
||||
|
query |
Type: string [DEPRECATED] The search query. Example: |
||||
|
type |
Type: string The action type. Const: Example: |
||||
|
queries |
Type: string[] The search queries. Example
|
||||
|
sources |
Type: Web search source
The sources used in the search. Example
|
Example
{
"type": "search",
"query": "example",
"queries": [
"example"
],
"sources": [
{
"type": "url",
"url": "example"
}
]
}
WebSearchActionOpenPage
Action type "open_page" - Opens a specific URL from search results.
|
Name |
Description |
|
type |
Type: string The action type. Const: Example: |
|
url |
Type: string<uri> The URL opened by the model. Example: |
Example
{
"type": "open_page",
"url": "https://example.com"
}
WebSearchActionFind
Action type "find_in_page": Searches for a pattern within a loaded page.
|
Name |
Description |
|
pattern |
Type: string The pattern or text to search for within the page. Example: |
|
type |
Type: string The action type. Const: Example: |
|
url |
Type: string<uri> The URL of the page searched for the pattern. Example: |
Example
{
"type": "find_in_page",
"url": "https://example.com",
"pattern": "example"
}
WebSearchToolCall
The results of a web search tool call.
|
Name |
Description |
|
action |
Type: object One of 3 types
An object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page). Example
|
|
id |
Type: string The unique ID of the web search tool call. Example: |
|
status |
Type: string The status of the web search tool call. Enum: |
|
type |
Type: string The type of the web search tool call. Always Const: Example: |
Example
{
"id": "example",
"type": "web_search_call",
"status": "in_progress",
"action": {
"type": "search",
"query": "example",
"queries": [
"example"
],
"sources": [
{
"type": "url",
"url": "example"
}
]
}
}
FunctionToolCall
A tool call to run a function.
|
Name |
Description |
|
arguments |
Type: string A JSON string of the arguments to pass to the function. Example: |
|
call_id |
Type: string The unique ID of the function tool call generated by the model. Example: |
|
name |
Type: string The name of the function to run. Example: |
|
type |
Type: string The type of the function tool call. Always Const: Example: |
|
id |
Type: string The unique ID of the function tool call. Example: |
|
namespace |
Type: string The namespace of the function to run. Example: |
|
status |
Type: string The status of the item. One of Enum: |
Example
{
"id": "example",
"type": "function_call",
"call_id": "example",
"namespace": "example",
"name": "example",
"arguments": "example",
"status": "in_progress"
}
InputTextContentParam
A text input to the model.
|
Name |
Description |
|
text |
Type: string The text input to the model. Max length: Example: |
|
type |
Type: string The type of the input item. Always Default: Const: |
Example
{
"type": "input_text",
"text": "example"
}
InputImageContentParamAutoParam
An image input to the model.
|
Name |
Description |
|
type |
Type: string The type of the input item. Always Default: Const: |
|
detail |
Type: DetailEnum The detail level of the image to be sent to the model. One of Enum: |
|
file_id |
Type: string The ID of the file to be sent to the model. Example: |
|
image_url |
Type: string The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. Max length: Example: |
Example
{
"type": "input_image",
"image_url": "example",
"file_id": "fvtdeb81rt1d978c5hvb",
"detail": "low"
}
InputFileContentParam
A file input to the model.
|
Name |
Description |
|
type |
Type: string The type of the input item. Always Default: Const: |
|
detail |
Type: FileDetailEnum The detail level of the file to be sent to the model. Use Enum: |
|
file_data |
Type: string The base64-encoded data of the file to be sent to the model. Max length: Example: |
|
file_id |
Type: string The ID of the file to be sent to the model. Example: |
|
file_url |
Type: string The URL of the file to be sent to the model. Example: |
|
filename |
Type: string The name of the file to be sent to the model. Example: |
Example
{
"type": "input_file",
"file_id": "fvtdeb81rt1d978c5hvb",
"filename": "example",
"file_data": "example",
"file_url": "example",
"detail": "low"
}
FunctionCallItemStatus
Type: string
Enum: in_progress, completed, incomplete
FunctionCallOutputItemParam
The output of a function tool call.
|
Name |
Description |
|
call_id |
Type: string The unique ID of the function tool call generated by the model. Min length: Max length: Example: |
|
output |
One of 2 types
Text, image, or file output of the function tool call. Example: |
|
type |
Type: string The type of the function tool call output. Always Default: Const: |
|
id |
Type: string The unique ID of the function tool call output. Populated when this item is returned via API. Example: |
|
status |
Type: FunctionCallItemStatus The status of the item. One of Enum: |
Example
{
"id": "example",
"call_id": "example",
"type": "function_call_output",
"output": "example",
"status": "in_progress"
}
SummaryTextContent
A summary text from the model.
|
Name |
Description |
|
text |
Type: string A summary of the reasoning output from the model so far. Example: |
|
type |
Type: string The type of the object. Always Default: Const: |
Example
{
"type": "summary_text",
"text": "example"
}
ReasoningTextContent
Reasoning text from the model.
|
Name |
Description |
|
text |
Type: string The reasoning text from the model. Example: |
|
type |
Type: string The type of the reasoning text. Always Default: Const: |
Example
{
"type": "reasoning_text",
"text": "example"
}
ReasoningItem
A description of the chain of thought used by a reasoning model while generating a response. Be sure to include these items in your input to the Responses API for subsequent turns of a conversation if you are manually managing context.
|
Name |
Description |
|
id |
Type: string The unique identifier of the reasoning content. Example: |
|
summary |
Type: SummaryTextContent[] Reasoning summary content. Example
|
|
type |
Type: string The type of the object. Always Const: Example: |
|
content |
Type: ReasoningTextContent[] Reasoning text content. Example
|
|
encrypted_content |
Type: string The encrypted content of the reasoning item - populated when a response is Example: |
|
status |
Type: string The status of the item. One of Enum: |
Example
{
"type": "reasoning",
"id": "example",
"encrypted_content": "example",
"summary": [
{
"type": "summary_text",
"text": "example"
}
],
"content": [
{
"type": "reasoning_text",
"text": "example"
}
],
"status": "in_progress"
}
CompactionSummaryItemParam
A compaction item generated by the v1/responses/compact API.
|
Name |
Description |
|
encrypted_content |
Type: string The encrypted content of the compaction summary. Max length: Example: |
|
type |
Type: string The type of the item. Always Default: Const: |
|
id |
Type: string The ID of the compaction item. Example: |
Example
{
"id": "example",
"type": "compaction",
"encrypted_content": "example"
}
CompactionTrigger
Compacts the current context. Must be the final input item.
|
Name |
Description |
|
type |
Type: string The type of the item. Always Default: Const: |
|
id |
Type: string The unique ID of the compaction trigger item. Example: |
Example
{
"id": "example",
"type": "compaction_trigger"
}
ImageGenToolCall
An image generation request made by the model.
|
Name |
Description |
|
id |
Type: string The unique ID of the image generation call. Example: |
|
result |
Type: string The generated image encoded in base64. Example: |
|
status |
Type: string The status of the image generation call. Enum: |
|
type |
Type: string The type of the image generation call. Always Const: Example: |
Example
{
"type": "image_generation_call",
"id": "example",
"status": "in_progress",
"result": "example"
}
CodeInterpreterOutputLogs
The logs output from the code interpreter.
|
Name |
Description |
|
logs |
Type: string The logs output from the code interpreter. Example: |
|
type |
Type: string The type of the output. Always Default: Const: |
Example
{
"type": "logs",
"logs": "example"
}
CodeInterpreterOutputImage
The image output from the code interpreter.
|
Name |
Description |
|
type |
Type: string The type of the output. Always Default: Const: |
|
url |
Type: string The URL of the image output from the code interpreter. Example: |
Example
{
"type": "image",
"url": "example"
}
CodeInterpreterToolCall
A tool call to run code.
|
Name |
Description |
|
code |
Type: string The code to run, or null if not available. Example: |
|
container_id |
Type: string The ID of the container used to run the code. Example: |
|
id |
Type: string The unique ID of the code interpreter tool call. Example: |
|
outputs |
Type: arrayOne of 2 types
The outputs generated by the code interpreter, such as logs or images. Example
|
|
status |
Type: string The status of the code interpreter tool call. Valid values are Enum: |
|
type |
Type: string The type of the code interpreter tool call. Always Default: Const: |
Example
{
"type": "code_interpreter_call",
"id": "example",
"status": "in_progress",
"container_id": "example",
"code": "example",
"outputs": [
{
"type": "logs",
"logs": "example"
}
]
}
FunctionShellAction
Execute a shell command.
|
Name |
Description |
|
commands |
Type: string[] Example
|
|
max_output_length |
Any of 2 types
Example: |
|
timeout_ms |
Any of 2 types
Example: |
Example
{
"commands": [
"example"
],
"timeout_ms": 0,
"max_output_length": 0
}
ContainerReferenceResource
Represents a container created with /v1/containers.
|
Name |
Description |
|
container_id |
Type: string Example: |
|
type |
Type: string The environment type. Always Default: Const: |
Example
{
"type": "container_reference",
"container_id": "example"
}
FunctionShellCall
A tool call that executes one or more shell commands in a managed environment.
|
Name |
Description |
|
action |
Type: FunctionShellAction The shell commands and limits that describe how to run the tool call. Execute a shell command. Example
|
|
call_id |
Type: string The unique ID of the shell tool call generated by the model. Example: |
|
environment |
Any of 2 types
Example
|
|
id |
Type: string The unique ID of the shell tool call. Populated when this item is returned via API. Example: |
|
status |
Type: LocalShellCallStatus The status of the shell call. One of Enum: |
|
type |
Type: string The type of the item. Always Default: Const: |
|
created_by |
Type: string The ID of the entity that created this tool call. Example: |
Example
{
"type": "shell_call",
"id": "example",
"call_id": "example",
"action": {
"commands": [
"example"
],
"timeout_ms": 0,
"max_output_length": 0
},
"status": "in_progress",
"environment": {
"type": "container_reference",
"container_id": "example"
},
"created_by": "example"
}
FunctionShellCallOutputTimeoutOutcome
Indicates that the shell call exceeded its configured time limit.
|
Name |
Description |
|
type |
Type: string The outcome type. Always Default: Const: |
Example
{
"type": "timeout"
}
FunctionShellCallOutputExitOutcome
Indicates that the shell commands finished and returned an exit code.
|
Name |
Description |
|
exit_code |
Type: integer Exit code from the shell process. |
|
type |
Type: string The outcome type. Always Default: Const: |
Example
{
"type": "exit",
"exit_code": 0
}
FunctionShellCallOutputContent
The content of a shell tool call output that was emitted.
|
Name |
Description |
|
outcome |
One of 2 types
Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk. Example
|
|
stderr |
Type: string The standard error output that was captured. Example: |
|
stdout |
Type: string The standard output that was captured. Example: |
|
created_by |
Type: string The identifier of the actor that created the item. Example: |
Example
{
"stdout": "example",
"stderr": "example",
"outcome": {
"type": "timeout"
},
"created_by": "example"
}
FunctionShellCallOutput
The output of a shell tool call that was emitted.
|
Name |
Description |
|
call_id |
Type: string The unique ID of the shell tool call generated by the model. Example: |
|
id |
Type: string The unique ID of the shell call output. Populated when this item is returned via API. Example: |
|
max_output_length |
Any of 2 types
Example: |
|
output |
Type: FunctionShellCallOutputContent[] An array of shell call output contents Example
|
|
status |
Type: LocalShellCallOutputStatusEnum The status of the shell call output. One of Enum: |
|
type |
Type: string The type of the shell call output. Always Default: Const: |
|
created_by |
Type: string The identifier of the actor that created the item. Example: |
Example
{
"type": "shell_call_output",
"id": "example",
"call_id": "example",
"status": "in_progress",
"output": [
{
"stdout": "example",
"stderr": "example",
"outcome": {
"type": "timeout"
},
"created_by": "example"
}
],
"max_output_length": 0,
"created_by": "example"
}
MCPListToolsTool
A tool available on an MCP server.
|
Name |
Description |
|
input_schema |
Type: object The JSON schema describing the tool's input. Example
|
|
name |
Type: string The name of the tool. Example: |
|
annotations |
Type: object Additional annotations about the tool. Example
|
|
description |
Type: string The description of the tool. Example: |
Example
{
"name": "example",
"description": "example",
"input_schema": {},
"annotations": {}
}
MCPListTools
A list of tools available on an MCP server.
|
Name |
Description |
|
id |
Type: string The unique ID of the list. Example: |
|
server_label |
Type: string The label of the MCP server. Example: |
|
tools |
Type: MCPListToolsTool[] The tools available on the server. Example
|
|
type |
Type: string The type of the item. Always Const: Example: |
|
error |
Type: string Error message if the server could not list tools. Example: |
Example
{
"type": "mcp_list_tools",
"id": "example",
"server_label": "example",
"tools": [
{
"name": "example",
"description": "example",
"input_schema": {},
"annotations": {}
}
],
"error": "example"
}
MCPApprovalRequest
A request for human approval of a tool invocation.
|
Name |
Description |
|
arguments |
Type: string A JSON string of arguments for the tool. Example: |
|
id |
Type: string The unique ID of the approval request. Example: |
|
name |
Type: string The name of the tool to run. Example: |
|
server_label |
Type: string The label of the MCP server making the request. Example: |
|
type |
Type: string The type of the item. Always Const: Example: |
Example
{
"type": "mcp_approval_request",
"id": "example",
"server_label": "example",
"name": "example",
"arguments": "example"
}
MCPApprovalResponse
A response to an MCP approval request.
|
Name |
Description |
|
approval_request_id |
Type: string The ID of the approval request being answered. Example: |
|
approve |
Type: boolean Whether the request was approved. |
|
type |
Type: string The type of the item. Always Const: Example: |
|
id |
Type: string The unique ID of the approval response Example: |
|
reason |
Type: string Optional reason for the decision. Example: |
Example
{
"type": "mcp_approval_response",
"id": "example",
"approval_request_id": "example",
"approve": true,
"reason": "example"
}
MCPToolCallStatus
Type: string
Enum: in_progress, completed, incomplete, calling, failed
MCPToolCall
An invocation of a tool on an MCP server.
|
Name |
Description |
|
arguments |
Type: string A JSON string of the arguments passed to the tool. Example: |
|
id |
Type: string The unique ID of the tool call. Example: |
|
name |
Type: string The name of the tool that was run. Example: |
|
server_label |
Type: string The label of the MCP server running the tool. Example: |
|
type |
Type: string The type of the item. Always Const: Example: |
|
approval_request_id |
Type: string Unique identifier for the MCP tool call approval request. Example: |
|
error |
Type: string The error from the tool call, if any. Example: |
|
output |
Type: string The output from the tool call. Example: |
|
status |
Type: MCPToolCallStatus The status of the tool call. One of Enum: |
Example
{
"type": "mcp_call",
"id": "example",
"server_label": "example",
"name": "example",
"arguments": "example",
"output": "example",
"error": "example",
"status": "in_progress",
"approval_request_id": "example"
}
Item
Content item used to generate a response.
Type: object
One of 17 types
-
Input message
Type: InputMessage
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.Example
{ "type": "message", "role": "user", "status": "in_progress", "content": [ { "type": "input_text", "text": "example" } ] } -
Output message
Type: OutputMessage
An output message from the model.
Example
{ "id": "example", "type": "message", "role": "assistant", "content": [ { "type": "output_text", "text": "example", "annotations": [ null ], "logprobs": [ {} ] } ], "phase": "commentary", "status": "in_progress" } -
File search tool call
Type: FileSearchToolCall
The results of a File Search tool call.
Example
{ "id": "example", "type": "file_search_call", "status": "in_progress", "queries": [ "example" ], "results": [ { "file_id": "example", "text": "example", "filename": "example", "attributes": null, "score": 0.5 } ] } -
Web search tool call
Type: WebSearchToolCall
The results of a web search tool call.
Example
{ "id": "example", "type": "web_search_call", "status": "in_progress", "action": { "type": "search", "query": "example", "queries": [ "example" ], "sources": [ { "type": "url", "url": "example" } ] } } -
Function tool call
Type: FunctionToolCall
A tool call to run a function.
Example
{ "id": "example", "type": "function_call", "call_id": "example", "namespace": "example", "name": "example", "arguments": "example", "status": "in_progress" } -
Function tool call output
Type: FunctionCallOutputItemParam
The output of a function tool call.
Example
{ "id": "example", "call_id": "example", "type": "function_call_output", "output": "example", "status": "in_progress" } -
Reasoning
Type: ReasoningItem
A description of the chain of thought used by a reasoning model while generating a response. Be sure to include these items in your
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.Example
{ "type": "reasoning", "id": "example", "encrypted_content": "example", "summary": [ { "type": "summary_text", "text": "example" } ], "content": [ { "type": "reasoning_text", "text": "example" } ], "status": "in_progress" } -
Compaction item
Type: CompactionSummaryItemParam
A compaction item generated by the
v1/responses/compactAPI.Example
{ "id": "example", "type": "compaction", "encrypted_content": "example" } -
Compaction trigger
Type: CompactionTrigger
Compacts the current context. Must be the final input item.
Example
{ "id": "example", "type": "compaction_trigger" } -
Image generation call
Type: ImageGenToolCall
An image generation request made by the model.
Example
{ "type": "image_generation_call", "id": "example", "status": "in_progress", "result": "example" } -
Code interpreter tool call
Type: CodeInterpreterToolCall
A tool call to run code.
Example
{ "type": "code_interpreter_call", "id": "example", "status": "in_progress", "container_id": "example", "code": "example", "outputs": [ { "type": "logs", "logs": "example" } ] } -
Shell tool call
Type: FunctionShellCall
A tool call that executes one or more shell commands in a managed environment.
Example
{ "type": "shell_call", "id": "example", "call_id": "example", "action": { "commands": [ "example" ], "timeout_ms": 0, "max_output_length": 0 }, "status": "in_progress", "environment": { "type": "container_reference", "container_id": "example" }, "created_by": "example" } -
Shell call output
Type: FunctionShellCallOutput
The output of a shell tool call that was emitted.
Example
{ "type": "shell_call_output", "id": "example", "call_id": "example", "status": "in_progress", "output": [ { "stdout": "example", "stderr": "example", "outcome": { "type": "timeout" }, "created_by": "example" } ], "max_output_length": 0, "created_by": "example" } -
MCP list tools
Type: MCPListTools
A list of tools available on an MCP server.
Example
{ "type": "mcp_list_tools", "id": "example", "server_label": "example", "tools": [ { "name": "example", "description": "example", "input_schema": {}, "annotations": {} } ], "error": "example" } -
MCP approval request
Type: MCPApprovalRequest
A request for human approval of a tool invocation.
Example
{ "type": "mcp_approval_request", "id": "example", "server_label": "example", "name": "example", "arguments": "example" } -
MCP approval response
Type: MCPApprovalResponse
A response to an MCP approval request.
Example
{ "type": "mcp_approval_response", "id": "example", "approval_request_id": "example", "approve": true, "reason": "example" } -
MCP tool call
Type: MCPToolCall
An invocation of a tool on an MCP server.
Example
{ "type": "mcp_call", "id": "example", "server_label": "example", "name": "example", "arguments": "example", "output": "example", "error": "example", "status": "in_progress", "approval_request_id": "example" }
Example
{
"type": "message",
"role": "user",
"status": "in_progress",
"content": [
{
"type": "input_text",
"text": "example"
}
]
}
ItemReferenceParam
An internal identifier for an item to reference.
|
Name |
Description |
|
id |
Type: string The ID of the item to reference. Example: |
|
type |
Type: string The type of item to reference. Always Default: Const: |
Example
{
"type": "item_reference",
"id": "example"
}
InputItem
One of 2 types
-
Item
Type: Item
An item representing part of the context for the response to be generated by the model. Can contain text, images, and audio inputs, as well as previous assistant responses and tool call outputs.
Content item used to generate a response.
Example
{ "type": "message", "role": "user", "status": "in_progress", "content": [ { "type": "input_text", "text": "example" } ] } -
Item reference
Type: ItemReferenceParam
An internal identifier for an item to reference.
Example
{ "type": "item_reference", "id": "example" }
Example
{
"type": "message",
"role": "user",
"status": "in_progress",
"content": [
{}
]
}
FunctionTool
Defines a function in your own code the model can choose to call. Learn more about function calling.
|
Name |
Description |
||
|
name |
Type: string The name of the function to call. Example: |
||
|
parameters |
Type: object
A JSON schema object describing the parameters of the function. Example
|
||
|
strict |
Type: boolean Whether to enforce strict parameter validation. Default |
||
|
type |
Type: string The type of the function tool. Always Default: Const: |
||
|
defer_loading |
Type: boolean Whether this function is deferred and loaded via tool search. |
||
|
description |
Type: string A description of the function. Used by the model to determine whether or not to call the function. Example: |
Example
{
"type": "function",
"name": "example",
"description": "example",
"parameters": {},
"strict": true,
"defer_loading": true
}
RankerVersionType
Type: string
Enum: auto, default-2024-11-15
HybridSearchOptions
|
Name |
Description |
|
embedding_weight |
Type: number The weight of the embedding in the reciprocal ranking fusion. |
|
text_weight |
Type: number The weight of the text in the reciprocal ranking fusion. |
Example
{
"embedding_weight": 0.5,
"text_weight": 0.5
}
RankingOptions
|
Name |
Description |
|
hybrid_search |
Type: HybridSearchOptions Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. Example
|
|
ranker |
Type: RankerVersionType The ranker to use for the file search. Enum: |
|
score_threshold |
Type: number 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. |
Example
{
"ranker": "auto",
"score_threshold": 0.5,
"hybrid_search": {
"embedding_weight": 0.5,
"text_weight": 0.5
}
}
ComparisonFilter
A filter used to compare a specified attribute key to a given value using a defined comparison operation.
|
Name |
Description |
|
key |
Type: string The key to compare against the value. Example: |
|
type |
Type: string Specifies the comparison operator:
Default: Enum: |
|
value |
One of 4 types
The value to compare against the attribute key; supports string, number, or boolean types. Example: |
Example
{
"type": "eq",
"key": "example",
"value": "example"
}
CompoundFilter
Combine multiple filters using and or or.
|
Name |
Description |
|
filters |
Type: arrayOne of 2 types
Array of filters to combine. Items can be Example
|
|
type |
Type: string Type of operation: Enum: |
Example
{
"type": "and",
"filters": [
{
"type": "eq",
"key": "example",
"value": "example"
}
]
}
Filters
Any of 2 types
-
Comparison Filter
Type: ComparisonFilter
A filter used to compare a specified attribute key to a given value using a defined comparison operation.
Example
{ "type": "eq", "key": "example", "value": "example" } -
Compound Filter
Type: CompoundFilter
Combine multiple filters using
andoror.Example
{ "type": "and", "filters": [ { "type": "eq", "key": "example", "value": "example" } ] }
Example
{
"type": "eq",
"key": "example",
"value": "example"
}
FileSearchTool
A tool that searches for relevant content from uploaded files. Learn more about the File Search tool.
|
Name |
Description |
|
type |
Type: string The type of the file search tool. Always Default: Const: |
|
vector_store_ids |
Type: string[] The IDs of the vector stores to search. Example
|
|
filters |
Type: Filters A filter to apply. Example
|
|
max_num_results |
Type: integer The maximum number of results to return. This number should be between 1 and 50 inclusive. |
|
ranking_options |
Type: RankingOptions Ranking options for search. Example
|
Example
{
"type": "file_search",
"vector_store_ids": [
"example"
],
"max_num_results": 0,
"ranking_options": {
"ranker": "auto",
"score_threshold": 0.5,
"hybrid_search": {
"embedding_weight": 0.5,
"text_weight": 0.5
}
},
"filters": {
"type": "eq",
"key": "example",
"value": "example"
}
}
WebSearchApproximateLocation
The approximate location of the user.
|
Name |
Description |
|
city |
Type: string Free text input for the city of the user, e.g. Example: |
|
country |
Type: string The two-letter ISO country code of the user, e.g. Example: |
|
region |
Type: string Free text input for the region of the user, e.g. Example: |
|
timezone |
Type: string The IANA timezone of the user, e.g. Example: |
|
type |
Type: string The type of location approximation. Always Default: Const: |
Example
{
"type": "approximate",
"country": "example",
"region": "example",
"city": "example",
"timezone": "example"
}
WebSearchTool
Search the Internet for sources related to the prompt. Learn more about the web search tool.
|
Name |
Description |
||
|
type |
Type: string The type of the web search tool. One of Default: Enum: |
||
|
filters |
Type: object
Filters for the search. Example
|
||
|
search_context_size |
Type: string High level guidance for the amount of context window space to use for the search. One of Default: Enum: |
||
|
user_location |
Type: WebSearchApproximateLocation The approximate location of the user. Example
|
Example
{
"type": "web_search",
"filters": {
"allowed_domains": []
},
"user_location": {
"type": "approximate",
"country": "example",
"region": "example",
"city": "example",
"timezone": "example"
},
"search_context_size": "medium"
}
MCPToolFilter
A filter object to specify which tools are allowed.
|
Name |
Description |
|
read_only |
Type: boolean Indicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with |
|
tool_names |
Type: string[] List of allowed tool names. Example
|
Example
{
"tool_names": [
"example"
],
"read_only": true
}
MCPTool
Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
|
Name |
Description |
||||
|
server_label |
Type: string A label for this MCP server, used to identify it in tool calls. Example: |
||||
|
type |
Type: string The type of the MCP tool. Always Const: Example: |
||||
|
allowed_tools |
One of 2 types
List of allowed tool names or a filter object. Example
|
||||
|
authorization |
Type: string An OAuth access token that can be used with a remote MCP server, Example: |
||||
|
connector_id |
Type: string Identifier for service connectors. One of Enum: |
||||
|
defer_loading |
Type: boolean Whether this MCP tool is deferred and discovered via tool search. |
||||
|
headers |
Type: object
Optional HTTP headers to send to the MCP server. Use for Example
|
||||
|
require_approval |
One of: MCP tool approval filter or MCP tool approval setting
Specify which of the MCP server's tools require approval. Default: |
||||
|
server_description |
Type: string Optional description of the MCP server, used to provide more context. Example: |
||||
|
server_url |
Type: string The URL for the MCP server. One of Example: |
Example
{
"type": "mcp",
"server_label": "example",
"server_url": "example",
"connector_id": "connector_dropbox",
"authorization": "example",
"server_description": "example",
"headers": {},
"allowed_tools": [
"example"
],
"require_approval": "always",
"defer_loading": true
}
ContainerMemoryLimit
Type: string
Enum: 1g, 4g, 16g, 64g
ContainerNetworkPolicyDisabledParam
|
Name |
Description |
|
type |
Type: string Disable outbound network access. Always Default: Const: |
Example
{
"type": "disabled"
}
ContainerNetworkPolicyDomainSecretParam
|
Name |
Description |
|
domain |
Type: string The domain associated with the secret. Min length: Example: |
|
name |
Type: string The name of the secret to inject for the domain. Min length: Example: |
|
value |
Type: string The secret value to inject for the domain. Min length: Max length: Example: |
Example
{
"domain": "example",
"name": "example",
"value": "example"
}
ContainerNetworkPolicyAllowlistParam
|
Name |
Description |
|
allowed_domains |
Type: string[] A list of allowed domains when type is Min items: Example
|
|
type |
Type: string Allow outbound network access only to specified domains. Always Default: Const: |
|
domain_secrets |
Type: ContainerNetworkPolicyDomainSecretParam[] Optional domain-scoped secrets for allowlisted domains. Min items: Example
|
Example
{
"type": "allowlist",
"allowed_domains": [
"example"
],
"domain_secrets": [
{
"domain": "example",
"name": "example",
"value": "example"
}
]
}
AutoCodeInterpreterToolParam
Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
|
Name |
Description |
|
type |
Type: string Always Default: Const: |
|
file_ids |
Type: string[] An optional list of uploaded files to make available to your code. Max items: Example
|
|
memory_limit |
Type: ContainerMemoryLimit The memory limit for the code interpreter container. Enum: |
|
network_policy |
One of 2 types
Network access policy for the container. Example
|
Example
{
"type": "auto",
"file_ids": [
"example"
],
"memory_limit": "1g",
"network_policy": {
"type": "disabled"
}
}
CodeInterpreterTool
A tool that runs Python code to help generate a response to a prompt.
|
Name |
Description |
|
container |
One of 2 types
The code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional Example: |
|
type |
Type: string The type of the code interpreter tool. Always Const: Example: |
Example
{
"type": "code_interpreter",
"container": "example"
}
SkillReference
References a skill created with the /v1/skills endpoint.
|
Name |
Description |
|
skill_id |
Type: string The ID of the referenced skill. Example: |
|
type |
Type: string The skill attachment type. Always Default: Const: |
|
version |
Type: string Optional skill version. Use a positive integer or Pattern: Example: |
Example
{
"type": "skill_reference",
"skill_id": "example",
"version": "example"
}
ShellContainerAuto
Automatically creates a container for this request.
|
Name |
Description |
|
type |
Type: string The environment type. Always Default: Const: |
|
file_ids |
Type: string[] Uploaded files to make available in the container. Example
|
|
skills |
Type: SkillReference[] Skills to make available in the container. Example
|
Example
{
"type": "container_auto",
"file_ids": [
"example"
],
"skills": [
{
"type": "skill_reference",
"skill_id": "example",
"version": "example"
}
]
}
ShellEnvironment
One of 2 types
-
Automatic shell container
Type: ShellContainerAuto
Automatically creates a container for this request.
Example
{ "type": "container_auto", "file_ids": [ "example" ], "skills": [ { "type": "skill_reference", "skill_id": "example", "version": "example" } ] } -
Container Reference
Type: ContainerReferenceResource
Represents a container created with /v1/containers.
Example
{ "type": "container_reference", "container_id": "example" }
Example
{
"type": "container_auto",
"file_ids": [
"example"
],
"skills": [
{
"type": "skill_reference",
"skill_id": "example",
"version": "example"
}
]
}
FunctionShellTool
A tool that allows the model to execute shell commands in a managed container.
|
Name |
Description |
|
environment |
Type: ShellEnvironment Example
|
|
type |
Type: string The type of the shell tool. Always Default: Const: |
Example
{
"type": "shell",
"environment": {
"type": "container_auto",
"file_ids": [
"example"
],
"skills": [
{
"type": "skill_reference",
"skill_id": "example",
"version": "example"
}
]
}
}
InputFidelity
Control how much effort the model will exert to match the style and features, especially facial features, of input images.
Supports high and low. Defaults to low.
Type: string
Enum: high, low
ImageGenActionEnum
Type: string
Enum: generate, edit, auto
ImageGenTool
A tool that generates images using the image generation models.
|
Name |
Description |
||||
|
type |
Type: string The type of the image generation tool. Always Const: Example: |
||||
|
action |
Type: ImageGenActionEnum Whether to generate a new image or edit an existing image. Default: Enum: |
||||
|
background |
Type: string CURRENTLY NOT SUPPORTED Background type for the generated image. One of Default: Enum: |
||||
|
input_fidelity |
Type: InputFidelity Control how much effort the model will exert to match the style and features, especially facial features, of input images. Enum: |
||||
|
input_image_mask |
Type: object
CURRENTLY NOT SUPPORTED Optional mask for inpainting. Contains Example
|
||||
|
model |
Any of 2 types
Example: |
||||
|
moderation |
Type: string CURRENTLY NOT SUPPORTED Moderation level for the generated image. Default: Enum: |
||||
|
output_compression |
Type: integer Compression level for the output image. Default: Min value: Max value: |
||||
|
output_format |
Type: string The output format of the generated image. One of Default: Enum: |
||||
|
partial_images |
Type: integer Number of partial images to generate in streaming mode, from 0 (default value) to 3. Default: Min value: Max value: |
||||
|
quality |
Type: string The quality of the generated image. One of Default: Enum: |
||||
|
size |
Type: string The size of the generated image. One of Default: Enum: |
Example
{
"type": "image_generation",
"model": "example",
"quality": "auto",
"size": "auto",
"output_format": "png",
"output_compression": 100,
"moderation": "auto",
"background": "auto",
"input_fidelity": "high",
"input_image_mask": {
"image_url": "example",
"file_id": "example"
},
"partial_images": 0,
"action": "generate"
}
Tool
A tool that can be used to generate a response.
One of 7 types
-
Function
Type: FunctionTool
Defines a function in your own code the model can choose to call. Learn more about function calling.
Example
{ "type": "function", "name": "example", "description": "example", "parameters": {}, "strict": true, "defer_loading": true } -
File search
Type: FileSearchTool
A tool that searches for relevant content from uploaded files. Learn more about the File Search tool.
Example
{ "type": "file_search", "vector_store_ids": [ "example" ], "max_num_results": 0, "ranking_options": { "ranker": "auto", "score_threshold": 0.5, "hybrid_search": { "embedding_weight": 0.5, "text_weight": 0.5 } }, "filters": { "type": "eq", "key": "example", "value": "example" } } -
Web search
Type: WebSearchTool
Search the Internet for sources related to the prompt. Learn more about the web search tool.
Example
{ "type": "web_search", "filters": { "allowed_domains": [] }, "user_location": { "type": "approximate", "country": "example", "region": "example", "city": "example", "timezone": "example" }, "search_context_size": "medium" } -
MCP tool
Type: MCPTool
Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
Example
{ "type": "mcp", "server_label": "example", "server_url": "example", "connector_id": "connector_dropbox", "authorization": "example", "server_description": "example", "headers": {}, "allowed_tools": [ "example" ], "require_approval": "always", "defer_loading": true } -
Code interpreter
Type: CodeInterpreterTool
A tool that runs Python code to help generate a response to a prompt.
Example
{ "type": "code_interpreter", "container": "example" } -
Shell
Type: FunctionShellTool
A tool that allows the model to execute shell commands in a managed container.
Example
{ "type": "shell", "environment": { "type": "container_auto", "file_ids": [ "example" ], "skills": [ { "type": "skill_reference", "skill_id": "example", "version": "example" } ] } } -
Image generation tool
Type: ImageGenTool
A tool that generates images using the image generation models.
Example
{ "type": "image_generation", "model": "example", "quality": "auto", "size": "auto", "output_format": "png", "output_compression": 100, "moderation": "auto", "background": "auto", "input_fidelity": "high", "input_image_mask": { "image_url": "example", "file_id": "example" }, "partial_images": 0, "action": "generate" }
Example
{
"type": "function",
"name": "example",
"description": "example",
"parameters": {},
"strict": true,
"defer_loading": true
}
ResponseFormatText
Default response format. Used to generate text responses.
|
Name |
Description |
|
type |
Type: string The type of response format being defined. Always Const: Example: |
Example
{
"type": "text"
}
ResponseFormatJsonSchemaSchema
The schema for the response format, described as a JSON Schema object.
Learn how to build JSON schemas here.
|
Name |
Description |
Example
{}
TextResponseFormatJsonSchema
JSON Schema response format. Used to generate structured JSON responses.
Learn more about Structured Outputs.
|
Name |
Description |
|
name |
Type: 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. Example: |
|
schema |
Type: ResponseFormatJsonSchemaSchema The schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas here. Example
|
|
type |
Type: string The type of response format being defined. Always Const: Example: |
|
description |
Type: string A description of what the response format is for, used by the model to determine how to respond in the format. Example: |
|
strict |
Type: boolean Whether to enable strict schema adherence when generating the output. Default: |
Example
{
"type": "json_schema",
"description": "example",
"name": "example",
"schema": {},
"strict": false
}
ResponseFormatJsonObject
JSON object response format. An older method of generating JSON responses.
Using json_schema is 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.
|
Name |
Description |
|
type |
Type: string The type of response format being defined. Always Const: Example: |
Example
{
"type": "json_object"
}
TextResponseFormatConfiguration
An object specifying the format that the model must output.
Configuring { "type": "json_schema" } enables Structured Outputs, which ensures the model will match your supplied JSON schema. Learn more in the Structured Outputs.
The default format is { "type": "text" } with no additional options.
Setting to { "type": "json_object" } enables the older JSON mode, which ensures the message the model generates is valid JSON. Using json_schema is preferred for models that support it.
One of 3 types
-
Text
Type: ResponseFormatText
Default response format. Used to generate text responses.
Example
{ "type": "text" } -
JSON schema
Type: TextResponseFormatJsonSchema
JSON Schema response format. Used to generate structured JSON responses.
Learn more about Structured Outputs.
Example
{ "type": "json_schema", "description": "example", "name": "example", "schema": {}, "strict": false } -
JSON object
Type: ResponseFormatJsonObject
JSON object response format. An older method of generating JSON responses.
Usingjson_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.Example
{ "type": "json_object" }
Example
{
"type": "text"
}
Verbosity
Constrains the verbosity of the model's response. Lower values will result in more concise responses, while higher values will result in more verbose responses.
Currently supported values are low, medium, and high.
Type: string
Default: medium
Enum: low, medium, high
ResponseTextParam
Configuration options for a text response from the model. Can be plain text or structured JSON data.
|
Name |
Description |
|
format |
Type: TextResponseFormatConfiguration An object specifying the format that the model must output. Configuring The default format is Setting to Example
|
|
verbosity |
Type: Verbosity Constrains the verbosity of the model's response. Lower values will result in more concise responses, while higher values will result in more verbose responses. Default: Enum: |
Example
{
"format": {
"type": "text"
},
"verbosity": "medium"
}
ReasoningEffort
Constrains effort on reasoning for reasoning models.
Currently supported values are none, minimal, low, medium, high, and xhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
Type: string
Default: medium
Enum: none, minimal, low, medium, high, xhigh
Reasoning
Configuration options for reasoning models.
|
Name |
Description |
|
effort |
Type: ReasoningEffort Constrains effort on reasoning for reasoning models. Default: Enum: |
Example
{
"effort": "medium"
}
TruncationEnum
Type: string
Enum: auto, disabled
ConversationParam-2
The conversation that this response belongs to.
|
Name |
Description |
|
id |
Type: string The unique ID of the conversation. Example: |
Example
{
"id": "example"
}
ConversationParam
The conversation that this response belongs to. Items from this conversation are prepended to input_items for this response request.
Input items and output items from this response are automatically added to this conversation after this response completes.
One of 2 types
-
Conversation ID
Type: string
The unique ID of the conversation.
Example:
example -
Conversation object
Type: ConversationParam-2
The conversation that this response belongs to.
Example
{ "id": "example" }
Default: null
ToolChoiceOptions
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.
Type: string
Enum: none, auto, required
ToolChoiceAllowed
Constrains the tools available to the model to a pre-defined set.
|
Name |
Description |
|
mode |
Type: string Constrains the tools available to the model to a pre-defined set.
Enum: |
|
tools |
Type: object[]A list of tool definitions that the model should be allowed to call. For the Responses API, the list of tool definitions might look like:
Example
|
|
type |
Type: string Allowed tool configuration type. Always Const: Example: |
Example
{
"type": "allowed_tools",
"mode": "auto",
"tools": [
{}
]
}
ToolChoiceTypes
Indicates that the model should use a built-in tool to generate a response.
Learn more about built-in tools.
|
Name |
Description |
|
type |
Type: string The type of hosted tool the model should use. Learn more about built-in tools. Enum: |
Example
{
"type": "file_search"
}
ToolChoiceFunction
Use this option to force the model to call a specific function.
|
Name |
Description |
|
name |
Type: string The name of the function to call. Example: |
|
type |
Type: string For function calling, the type is always Const: Example: |
Example
{
"type": "function",
"name": "example"
}
ToolChoiceMCP
Use this option to force the model to call a specific tool on a remote MCP server.
|
Name |
Description |
|
server_label |
Type: string The label of the MCP server to use. Example: |
|
type |
Type: string For MCP tools, the type is always Const: Example: |
|
name |
Type: string The name of the tool to call on the server. Example: |
Example
{
"type": "mcp",
"server_label": "example",
"name": "example"
}
ToolChoiceCustom
Use this option to force the model to call a specific custom tool.
|
Name |
Description |
|
name |
Type: string The name of the custom tool to call. Example: |
|
type |
Type: string For custom tool calling, the type is always Const: Example: |
Example
{
"type": "custom",
"name": "example"
}
SpecificApplyPatchParam
Forces the model to call the apply_patch tool when executing a tool call.
|
Name |
Description |
|
type |
Type: string The tool to call. Always Default: Const: |
Example
{
"type": "apply_patch"
}
SpecificFunctionShellParam
Forces the model to call the shell tool when a tool call is required.
|
Name |
Description |
|
type |
Type: string The tool to call. Always Default: Const: |
Example
{
"type": "shell"
}
ToolChoiceParam
How the model should select which tool (or tools) to use when generating a response. See the tools parameter to see how to specify which tools the model can call.
One of 8 types
-
Tool choice mode
Type: ToolChoiceOptions
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.
Enum:
none,auto,required -
Allowed tools
Type: ToolChoiceAllowed
Constrains the tools available to the model to a pre-defined set.
Example
{ "type": "allowed_tools", "mode": "auto", "tools": [ {} ] } -
Hosted tool
Type: ToolChoiceTypes
Indicates that the model should use a built-in tool to generate a response.
Learn more about built-in tools.Example
{ "type": "file_search" } -
Function tool
Type: ToolChoiceFunction
Use this option to force the model to call a specific function.
Example
{ "type": "function", "name": "example" } -
MCP tool
Type: ToolChoiceMCP
Use this option to force the model to call a specific tool on a remote MCP server.
Example
{ "type": "mcp", "server_label": "example", "name": "example" } -
Custom tool
Type: ToolChoiceCustom
Use this option to force the model to call a specific custom tool.
Example
{ "type": "custom", "name": "example" } -
Specific apply patch tool choice
Type: SpecificApplyPatchParam
Forces the model to call the apply_patch tool when executing a tool call.
Example
{ "type": "apply_patch" } -
Specific shell tool choice
Type: SpecificFunctionShellParam
Forces the model to call the shell tool when a tool call is required.
Example
{ "type": "shell" }
Example: none
Responses
200 OK
Success
Body
application/json
{
"object": "response.input_tokens",
"input_tokens": 123
}
|
Name |
Description |
|
input_tokens |
Type: integer |
|
object |
Type: string Default: Const: |
InputImageContentParamAutoParam
An image input to the model.
|
Name |
Description |
|
type |
Type: string The type of the input item. Always Default: Const: |
|
detail |
Type: DetailEnum The detail level of the image to be sent to the model. One of Enum: |
|
file_id |
Type: string The ID of the file to be sent to the model. Example: |
|
image_url |
Type: string The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. Max length: Example: |
Example
{
"type": "input_image",
"image_url": "example",
"file_id": "fvtdeb81rt1d978c5hvb",
"detail": "low"
}
InputFileContentParam
A file input to the model.
|
Name |
Description |
|
type |
Type: string The type of the input item. Always Default: Const: |
|
detail |
Type: FileDetailEnum The detail level of the file to be sent to the model. Use Enum: |
|
file_data |
Type: string The base64-encoded data of the file to be sent to the model. Max length: Example: |
|
file_id |
Type: string The ID of the file to be sent to the model. Example: |
|
file_url |
Type: string The URL of the file to be sent to the model. Example: |
|
filename |
Type: string The name of the file to be sent to the model. Example: |
Example
{
"type": "input_file",
"file_id": "fvtdeb81rt1d978c5hvb",
"filename": "example",
"file_data": "example",
"file_url": "example",
"detail": "low"
}
FunctionCallOutputItemParam
The output of a function tool call.
|
Name |
Description |
|
call_id |
Type: string The unique ID of the function tool call generated by the model. Min length: Max length: Example: |
|
output |
One of 2 types
Text, image, or file output of the function tool call. Example: |
|
type |
Type: string The type of the function tool call output. Always Default: Const: |
|
id |
Type: string The unique ID of the function tool call output. Populated when this item is returned via API. Example: |
|
status |
Type: FunctionCallItemStatus The status of the item. One of Enum: |
Example
{
"id": "example",
"call_id": "example",
"type": "function_call_output",
"output": "example",
"status": "in_progress"
}
FunctionShellCall
A tool call that executes one or more shell commands in a managed environment.
|
Name |
Description |
|
action |
Type: FunctionShellAction The shell commands and limits that describe how to run the tool call. Execute a shell command. Example
|
|
call_id |
Type: string The unique ID of the shell tool call generated by the model. Example: |
|
environment |
Any of 2 types
Example
|
|
id |
Type: string The unique ID of the shell tool call. Populated when this item is returned via API. Example: |
|
status |
Type: LocalShellCallStatus The status of the shell call. One of Enum: |
|
type |
Type: string The type of the item. Always Default: Const: |
|
created_by |
Type: string The ID of the entity that created this tool call. Example: |
Example
{
"type": "shell_call",
"id": "example",
"call_id": "example",
"action": {
"commands": [
"example"
],
"timeout_ms": 0,
"max_output_length": 0
},
"status": "in_progress",
"environment": {
"type": "container_reference",
"container_id": "example"
},
"created_by": "example"
}
FunctionShellCallOutput
The output of a shell tool call that was emitted.
|
Name |
Description |
|
call_id |
Type: string The unique ID of the shell tool call generated by the model. Example: |
|
id |
Type: string The unique ID of the shell call output. Populated when this item is returned via API. Example: |
|
max_output_length |
Any of 2 types
Example: |
|
output |
Type: FunctionShellCallOutputContent[] An array of shell call output contents Example
|
|
status |
Type: LocalShellCallOutputStatusEnum The status of the shell call output. One of Enum: |
|
type |
Type: string The type of the shell call output. Always Default: Const: |
|
created_by |
Type: string The identifier of the actor that created the item. Example: |
Example
{
"type": "shell_call_output",
"id": "example",
"call_id": "example",
"status": "in_progress",
"output": [
{
"stdout": "example",
"stderr": "example",
"outcome": {
"type": "timeout"
},
"created_by": "example"
}
],
"max_output_length": 0,
"created_by": "example"
}
Item
Content item used to generate a response.
Type: object
One of 17 types
-
Input message
Type: InputMessage
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.Example
{ "type": "message", "role": "user", "status": "in_progress", "content": [ { "type": "input_text", "text": "example" } ] } -
Output message
Type: OutputMessage
An output message from the model.
Example
{ "id": "example", "type": "message", "role": "assistant", "content": [ { "type": "output_text", "text": "example", "annotations": [ null ], "logprobs": [ {} ] } ], "phase": "commentary", "status": "in_progress" } -
File search tool call
Type: FileSearchToolCall
The results of a File Search tool call.
Example
{ "id": "example", "type": "file_search_call", "status": "in_progress", "queries": [ "example" ], "results": [ { "file_id": "example", "text": "example", "filename": "example", "attributes": null, "score": 0.5 } ] } -
Web search tool call
Type: WebSearchToolCall
The results of a web search tool call.
Example
{ "id": "example", "type": "web_search_call", "status": "in_progress", "action": { "type": "search", "query": "example", "queries": [ "example" ], "sources": [ { "type": "url", "url": "example" } ] } } -
Function tool call
Type: FunctionToolCall
A tool call to run a function.
Example
{ "id": "example", "type": "function_call", "call_id": "example", "namespace": "example", "name": "example", "arguments": "example", "status": "in_progress" } -
Function tool call output
Type: FunctionCallOutputItemParam
The output of a function tool call.
Example
{ "id": "example", "call_id": "example", "type": "function_call_output", "output": "example", "status": "in_progress" } -
Reasoning
Type: ReasoningItem
A description of the chain of thought used by a reasoning model while generating a response. Be sure to include these items in your
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.Example
{ "type": "reasoning", "id": "example", "encrypted_content": "example", "summary": [ { "type": "summary_text", "text": "example" } ], "content": [ { "type": "reasoning_text", "text": "example" } ], "status": "in_progress" } -
Compaction item
Type: CompactionSummaryItemParam
A compaction item generated by the
v1/responses/compactAPI.Example
{ "id": "example", "type": "compaction", "encrypted_content": "example" } -
Compaction trigger
Type: CompactionTrigger
Compacts the current context. Must be the final input item.
Example
{ "id": "example", "type": "compaction_trigger" } -
Image generation call
Type: ImageGenToolCall
An image generation request made by the model.
Example
{ "type": "image_generation_call", "id": "example", "status": "in_progress", "result": "example" } -
Code interpreter tool call
Type: CodeInterpreterToolCall
A tool call to run code.
Example
{ "type": "code_interpreter_call", "id": "example", "status": "in_progress", "container_id": "example", "code": "example", "outputs": [ { "type": "logs", "logs": "example" } ] } -
Shell tool call
Type: FunctionShellCall
A tool call that executes one or more shell commands in a managed environment.
Example
{ "type": "shell_call", "id": "example", "call_id": "example", "action": { "commands": [ "example" ], "timeout_ms": 0, "max_output_length": 0 }, "status": "in_progress", "environment": { "type": "container_reference", "container_id": "example" }, "created_by": "example" } -
Shell call output
Type: FunctionShellCallOutput
The output of a shell tool call that was emitted.
Example
{ "type": "shell_call_output", "id": "example", "call_id": "example", "status": "in_progress", "output": [ { "stdout": "example", "stderr": "example", "outcome": { "type": "timeout" }, "created_by": "example" } ], "max_output_length": 0, "created_by": "example" } -
MCP list tools
Type: MCPListTools
A list of tools available on an MCP server.
Example
{ "type": "mcp_list_tools", "id": "example", "server_label": "example", "tools": [ { "name": "example", "description": "example", "input_schema": {}, "annotations": {} } ], "error": "example" } -
MCP approval request
Type: MCPApprovalRequest
A request for human approval of a tool invocation.
Example
{ "type": "mcp_approval_request", "id": "example", "server_label": "example", "name": "example", "arguments": "example" } -
MCP approval response
Type: MCPApprovalResponse
A response to an MCP approval request.
Example
{ "type": "mcp_approval_response", "id": "example", "approval_request_id": "example", "approve": true, "reason": "example" } -
MCP tool call
Type: MCPToolCall
An invocation of a tool on an MCP server.
Example
{ "type": "mcp_call", "id": "example", "server_label": "example", "name": "example", "arguments": "example", "output": "example", "error": "example", "status": "in_progress", "approval_request_id": "example" }
Example
{
"type": "message",
"role": "user",
"status": "in_progress",
"content": [
{
"type": "input_text",
"text": "example"
}
]
}
InputItem
One of 2 types
-
Item
Type: Item
An item representing part of the context for the response to be generated by the model. Can contain text, images, and audio inputs, as well as previous assistant responses and tool call outputs.
Content item used to generate a response.
Example
{ "type": "message", "role": "user", "status": "in_progress", "content": [ { "type": "input_text", "text": "example" } ] } -
Item reference
Type: ItemReferenceParam
An internal identifier for an item to reference.
Example
{ "type": "item_reference", "id": "example" }
Example
{
"type": "message",
"role": "user",
"status": "in_progress",
"content": [
{}
]
}