- Request
- Body
- ModelIds
- 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
- ImageGenToolCall
- CodeInterpreterOutputLogs
- CodeInterpreterOutputImage
- CodeInterpreterToolCall
- MCPListToolsTool
- MCPListTools
- MCPApprovalRequest
- MCPApprovalResponse
- MCPToolCallStatus
- MCPToolCall
- Item
- ItemReferenceParam
- InputItem
- PromptCacheRetentionEnum
- Responses
- 200 OK
Compact a conversation
CURRENTLY NOT SUPPORTED
Compact a conversation. Returns a compacted response object.
Request
POST
https://ai.api.cloud.yandex.net/v1/responses/compact
Body
application/json
{
"model": "example",
"input": "example",
"previous_response_id": "example",
"instructions": "example",
"prompt_cache_key": "example",
"prompt_cache_retention": "in_memory"
}
|
Name |
Description |
|
model |
Type: ModelIds Model ID used to generate the response. Example: |
|
input |
Any of 2 types
Example: |
|
instructions |
Any of 2 types
Example: |
|
previous_response_id |
Any of 2 types
Example: |
|
prompt_cache_key |
Any of 2 types
Example: |
|
prompt_cache_retention |
Any of 2 types
Example: |
ModelIds
Model ID used to generate the response.
Any of 2 types
-
Type: string
Example:
example -
Type: null
Example:
null
Example: example
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 |
Any of 2 types
Example: |
|
image_url |
Any of 2 types
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 |
Any of 2 types
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 |
Any of 2 types
Example: |
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 |
Any of 2 types
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 |
Any of 2 types
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 |
Any of 2 types
Example: |
|
file_id |
Any of 2 types
Example: |
|
image_url |
Any of 2 types
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 |
Any of 2 types
Example: |
|
file_id |
Any of 2 types
Example: |
|
file_url |
Any of 2 types
Example: |
|
filename |
Any of 2 types
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 |
Any of 2 types
Example: |
|
status |
Any of 2 types
Example: |
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 |
Any of 2 types
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 |
Any of 2 types
Example: |
Example
{
"id": "example",
"type": "compaction",
"encrypted_content": "example"
}
ImageGenToolCall
An image generation request made by the model.
|
Name |
Description |
|
id |
Type: string The unique ID of the image generation call. Example: |
|
result |
Any of 2 types
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 |
Any of 2 types
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 |
Any of 2 types
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"
}
]
}
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 |
Any of 2 types
Example
|
|
description |
Any of 2 types
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 |
Any of 2 types
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 |
Any of 2 types
Example: |
|
reason |
Any of 2 types
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 |
Any of 2 types
Example: |
|
error |
Any of 2 types
Example: |
|
output |
Any of 2 types
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 14 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" } -
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" } ] } -
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 |
Any of 2 types
Example: |
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": [
{}
]
}
PromptCacheRetentionEnum
Type: string
Enum: in_memory, 24h
Responses
200 OK
Success
Body
application/json
{
"id": "example",
"object": "response.compaction",
"output": [
{
"type": "message",
"id": "example",
"status": "in_progress",
"role": "unknown",
"content": [
null
],
"phase": "commentary"
}
],
"created_at": 0,
"usage": {
"input_tokens": 0,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 0,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 0
}
}
|
Name |
Description |
|
created_at |
Type: integer Unix timestamp (in seconds) when the compacted conversation was created. |
|
id |
Type: string The unique identifier for the compacted response. Example: |
|
object |
Type: string The object type. Always Default: Const: |
|
output |
Type: ItemField[] The compacted list of output items. Example
|
|
usage |
Type: ResponseUsage Token accounting for the compaction pass, including cached, reasoning, and total tokens. Represents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used. Example
|
InputImageContentParamAutoParam
An image input to the model.
|
Name |
Description |
|
type |
Type: string The type of the input item. Always Default: Const: |
|
detail |
Any of 2 types
Example: |
|
file_id |
Any of 2 types
Example: |
|
image_url |
Any of 2 types
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 |
Any of 2 types
Example: |
|
file_id |
Any of 2 types
Example: |
|
file_url |
Any of 2 types
Example: |
|
filename |
Any of 2 types
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 |
Any of 2 types
Example: |
|
status |
Any of 2 types
Example: |
Example
{
"id": "example",
"call_id": "example",
"type": "function_call_output",
"output": "example",
"status": "in_progress"
}
Item
Content item used to generate a response.
Type: object
One of 14 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" } -
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" } ] } -
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": [
{}
]
}
MessageRole
Type: string
Enum: unknown, user, assistant, system, critic, discriminator, developer, tool
TextContent
A text content.
|
Name |
Description |
|
text |
Type: string Example: |
|
type |
Type: string Default: Const: |
Example
{
"type": "text",
"text": "example"
}
ComputerScreenshotContent
A screenshot of a computer.
|
Name |
Description |
|
detail |
Type: ImageDetail The detail level of the screenshot image to be sent to the model. One of Enum: |
|
file_id |
Any of 2 types
Example: |
|
image_url |
Any of 2 types
Example: |
|
type |
Type: string Specifies the event type. For a computer screenshot, this property is always set to Default: Const: |
Example
{
"type": "computer_screenshot",
"image_url": "example",
"file_id": "example",
"detail": "low"
}
MessagePhase-2
Type: string
Enum: commentary, final_answer
Message
A message to or from the model.
|
Name |
Description |
|
content |
Type: arrayOne of 9 types
The content of the message Example
|
|
id |
Type: string The unique ID of the message. Example: |
|
role |
Type: MessageRole The role of the message. One of Enum: |
|
status |
Type: MessageStatus The status of item. One of Enum: |
|
type |
Type: string The type of the message. Always set to Default: Const: |
|
phase |
Any of 2 types
Example: |
Example
{
"type": "message",
"id": "example",
"status": "in_progress",
"role": "unknown",
"content": [
{
"type": "input_text",
"text": "example"
}
],
"phase": "commentary"
}
MCPApprovalResponseResource
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. |
|
id |
Type: string The unique ID of the approval response Example: |
|
type |
Type: string The type of the item. Always Const: Example: |
|
reason |
Any of 2 types
Example: |
Example
{
"type": "mcp_approval_response",
"id": "example",
"approval_request_id": "example",
"approve": true,
"reason": "example"
}
CompactionBody
A compaction item generated by the v1/responses/compact API.
|
Name |
Description |
|
encrypted_content |
Type: string The encrypted content that was produced by compaction. Example: |
|
id |
Type: string The unique ID of the compaction item. Example: |
|
type |
Type: string The type of the item. Always Default: Const: |
|
created_by |
Type: string The identifier of the actor that created the item. Example: |
Example
{
"type": "compaction",
"id": "example",
"encrypted_content": "example",
"created_by": "example"
}
ItemField
An item representing a message, tool call, tool output, reasoning, or other response element.
One of 11 types
-
Message
Type: Message
A message to or from the model.
Example
{ "type": "message", "id": "example", "status": "in_progress", "role": "unknown", "content": [ { "type": "input_text", "text": "example" } ], "phase": "commentary" } -
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" } ] } } -
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" } ] } -
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" } -
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" } -
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: MCPApprovalResponseResource
A response to an MCP approval request.
Example
{ "type": "mcp_approval_response", "id": "example", "approval_request_id": "example", "approve": true, "reason": "example" } -
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: CompactionBody
A compaction item generated by the
v1/responses/compactAPI.Example
{ "type": "compaction", "id": "example", "encrypted_content": "example", "created_by": "example" }
Example
{
"type": "message",
"id": "example",
"status": "in_progress",
"role": "unknown",
"content": [
{
"type": "input_text",
"text": "example"
}
],
"phase": "commentary"
}
ResponseUsage
Represents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.
|
Name |
Description |
||
|
input_tokens |
Type: integer The number of input tokens. |
||
|
input_tokens_details |
Type: object
A detailed breakdown of the input tokens. Example
|
||
|
output_tokens |
Type: integer The number of output tokens. |
||
|
output_tokens_details |
Type: object
A detailed breakdown of the output tokens. Example
|
||
|
total_tokens |
Type: integer The total number of tokens used. |
Example
{
"input_tokens": 0,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 0,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 0
}