Skip to content
SupportLogin
Responses

Responses

Generate a model response
POST/api/v1/responses
Retrieve a model response
GET/api/v1/responses/{response_id}
Delete a model response
DELETE/api/v1/responses/{response_id}
ModelsExpand Collapse
Response object { id, object, created_at, 10 more }
id: string
object: "response"
created_at: optional number

Unix timestamp (in seconds) when the response was created.

status: "completed" or "failed" or "in_progress" or 3 more
One of the following:
"completed"
"failed"
"in_progress"
"cancelled"
"queued"
"incomplete"
model: string

Public name of the model that generated the response.

output: array of ResponseOutputItem { type, id, status, 27 more }

Items the model generated, in order.

type: string

Item type, such as message, reasoning, function_call, mcp_call, file_search_call, web_search_call, code_execution_call, tool_search_call or tool_search_output. Fields beyond the ones listed depend on the type. On a self-improving stack, the model can search with tool_retriever for hosted MCP tools that were not loaded up front; each search is a tool_search_call followed by a tool_search_output.

id: optional string

Identifier of the output item.

status: optional string

Status of the item, such as completed or in_progress. A code_execution_call is completed, failed or timed_out.

role: optional "assistant"

Author of a message item.

content: optional array of ResponseOutputContent { type, text, refusal, annotations }

Content parts of a message item.

type: string

Content part type: output_text for reply text, refusal for a refusal.

text: optional string

The reply text, on an output_text part.

refusal: optional string

The refusal message, on a refusal part.

annotations: optional array of map[unknown]

Citations into text: file_citation for a file search source and url_citation (with url and title) for a web search source. Each covers its [S#] bracket and carries its citation_id.

name: optional string

Name of the tool called, on function_call, mcp_call and mcp_approval_request items.

arguments: optional string or map[unknown]

JSON-encoded arguments for the tool, on function_call, mcp_call and mcp_approval_request items. On a tool_search_call item, the search as an object, e.g. {"query": "search Slack messages"}.

One of the following:
string
map[unknown]
call_id: optional string

Identifier to answer a function_call with: send it back as the call_id of a function_call_output input item. On tool_search_call and tool_search_output items, it pairs a search with its result.

server_label: optional string

Label of the MCP server, on mcp_call, mcp_approval_request and mcp_list_tools items.

execution: optional "server" or "client"

Where a tool search ran, on tool_search_call and tool_search_output items. Searches Adaption runs are server.

One of the following:
"server"
"client"
approval_request_id: optional string

The approval request this mcp_call answers, if it needed approval.

output: optional string

What the tool returned, on an mcp_call item.

error: optional string

Why the tool call failed, on mcp_call and mcp_list_tools items.

tools: optional array of map[unknown]

Tools the server offers, on an mcp_list_tools item. On a tool_search_output item, the tools the search loaded, as function definitions.

summary: optional array of map[unknown]

Summary parts of a reasoning item, each with type and text.

encrypted_content: optional string

Opaque reasoning state to replay in a later request, on a reasoning item.

queries: optional array of string

Search queries, on a file_search_call item.

action: optional map[unknown]

The search on a web_search_call item: type, query, queries and sources (the result URLs).

results: optional array of map[unknown]

Matched chunks on a file_search_call item, or search results on a web_search_call item (citation_id, title, url, and when available summary, highlights, published_date, author). Send the item back unchanged to replay it without a new search.

session_id: optional string

Sandbox session of a code_execution_call item. Send it as the session_id of a code_execution tool to keep its files.

execution_id: optional string

Identifier of the run, on a code_execution_call item.

language: optional "python" or "javascript" or "typescript" or "bash"

Language of the code, on a code_execution_call item.

One of the following:
"python"
"javascript"
"typescript"
"bash"
code: optional string

Code the model ran, on a code_execution_call item.

exit_code: optional number

Exit code of the program, on a code_execution_call item. Null when the program did not run.

stdout: optional string

Standard output, on a code_execution_call item.

stderr: optional string

Standard error, on a code_execution_call item, or why the run failed.

stdout_truncated: optional boolean

Whether stdout was cut to the output limit.

stderr_truncated: optional boolean

Whether stderr was cut to the output limit.

sandbox_reused: optional boolean

Whether the run reused a sandbox from an earlier run in the session.

timing: optional map[unknown]

Run timing in milliseconds, on a code_execution_call item: sandbox_ms, execution_ms and total_ms.

output_text: string

The text of every output_text part in output, joined. Reasoning and tool calls are excluded.

error: optional ResponseError { code, message }
code: string
message: string
incomplete_details: optional ResponseIncompleteDetails { reason }
reason: optional string

Why the response is incomplete.

usage: optional ResponseUsage { input_tokens, output_tokens, total_tokens, 3 more }
input_tokens: number
output_tokens: number
total_tokens: number
input_tokens_details: optional map[unknown]
output_tokens_details: optional map[unknown]
cost: optional number

Cost of the request in US dollars. Missing when a model call did not report its cost.

previous_response_id: optional string

The response this one continues, if any.

store: optional boolean

Whether the response is stored for later retrieval.

metadata: optional map[string]
ResponseError object { code, message }
code: string
message: string
ResponseIncompleteDetails object { reason }
reason: optional string

Why the response is incomplete.

ResponseOutputContent object { type, text, refusal, annotations }
type: string

Content part type: output_text for reply text, refusal for a refusal.

text: optional string

The reply text, on an output_text part.

refusal: optional string

The refusal message, on a refusal part.

annotations: optional array of map[unknown]

Citations into text: file_citation for a file search source and url_citation (with url and title) for a web search source. Each covers its [S#] bracket and carries its citation_id.

ResponseOutputItem object { type, id, status, 27 more }
type: string

Item type, such as message, reasoning, function_call, mcp_call, file_search_call, web_search_call, code_execution_call, tool_search_call or tool_search_output. Fields beyond the ones listed depend on the type. On a self-improving stack, the model can search with tool_retriever for hosted MCP tools that were not loaded up front; each search is a tool_search_call followed by a tool_search_output.

id: optional string

Identifier of the output item.

status: optional string

Status of the item, such as completed or in_progress. A code_execution_call is completed, failed or timed_out.

role: optional "assistant"

Author of a message item.

content: optional array of ResponseOutputContent { type, text, refusal, annotations }

Content parts of a message item.

type: string

Content part type: output_text for reply text, refusal for a refusal.

text: optional string

The reply text, on an output_text part.

refusal: optional string

The refusal message, on a refusal part.

annotations: optional array of map[unknown]

Citations into text: file_citation for a file search source and url_citation (with url and title) for a web search source. Each covers its [S#] bracket and carries its citation_id.

name: optional string

Name of the tool called, on function_call, mcp_call and mcp_approval_request items.

arguments: optional string or map[unknown]

JSON-encoded arguments for the tool, on function_call, mcp_call and mcp_approval_request items. On a tool_search_call item, the search as an object, e.g. {"query": "search Slack messages"}.

One of the following:
string
map[unknown]
call_id: optional string

Identifier to answer a function_call with: send it back as the call_id of a function_call_output input item. On tool_search_call and tool_search_output items, it pairs a search with its result.

server_label: optional string

Label of the MCP server, on mcp_call, mcp_approval_request and mcp_list_tools items.

execution: optional "server" or "client"

Where a tool search ran, on tool_search_call and tool_search_output items. Searches Adaption runs are server.

One of the following:
"server"
"client"
approval_request_id: optional string

The approval request this mcp_call answers, if it needed approval.

output: optional string

What the tool returned, on an mcp_call item.

error: optional string

Why the tool call failed, on mcp_call and mcp_list_tools items.

tools: optional array of map[unknown]

Tools the server offers, on an mcp_list_tools item. On a tool_search_output item, the tools the search loaded, as function definitions.

summary: optional array of map[unknown]

Summary parts of a reasoning item, each with type and text.

encrypted_content: optional string

Opaque reasoning state to replay in a later request, on a reasoning item.

queries: optional array of string

Search queries, on a file_search_call item.

action: optional map[unknown]

The search on a web_search_call item: type, query, queries and sources (the result URLs).

results: optional array of map[unknown]

Matched chunks on a file_search_call item, or search results on a web_search_call item (citation_id, title, url, and when available summary, highlights, published_date, author). Send the item back unchanged to replay it without a new search.

session_id: optional string

Sandbox session of a code_execution_call item. Send it as the session_id of a code_execution tool to keep its files.

execution_id: optional string

Identifier of the run, on a code_execution_call item.

language: optional "python" or "javascript" or "typescript" or "bash"

Language of the code, on a code_execution_call item.

One of the following:
"python"
"javascript"
"typescript"
"bash"
code: optional string

Code the model ran, on a code_execution_call item.

exit_code: optional number

Exit code of the program, on a code_execution_call item. Null when the program did not run.

stdout: optional string

Standard output, on a code_execution_call item.

stderr: optional string

Standard error, on a code_execution_call item, or why the run failed.

stdout_truncated: optional boolean

Whether stdout was cut to the output limit.

stderr_truncated: optional boolean

Whether stderr was cut to the output limit.

sandbox_reused: optional boolean

Whether the run reused a sandbox from an earlier run in the session.

timing: optional map[unknown]

Run timing in milliseconds, on a code_execution_call item: sandbox_ms, execution_ms and total_ms.

ResponseStreamEvent object { type, sequence_number, response, 6 more }
type: string

Event type, such as response.created, response.output_text.delta or response.completed. Fields beyond the ones listed depend on the type.

sequence_number: optional number
response: optional Response { id, object, created_at, 10 more }

The response so far, on response.* lifecycle events.

id: string
object: "response"
created_at: optional number

Unix timestamp (in seconds) when the response was created.

status: "completed" or "failed" or "in_progress" or 3 more
One of the following:
"completed"
"failed"
"in_progress"
"cancelled"
"queued"
"incomplete"
model: string

Public name of the model that generated the response.

output: array of ResponseOutputItem { type, id, status, 27 more }

Items the model generated, in order.

type: string

Item type, such as message, reasoning, function_call, mcp_call, file_search_call, web_search_call, code_execution_call, tool_search_call or tool_search_output. Fields beyond the ones listed depend on the type. On a self-improving stack, the model can search with tool_retriever for hosted MCP tools that were not loaded up front; each search is a tool_search_call followed by a tool_search_output.

id: optional string

Identifier of the output item.

status: optional string

Status of the item, such as completed or in_progress. A code_execution_call is completed, failed or timed_out.

role: optional "assistant"

Author of a message item.

content: optional array of ResponseOutputContent { type, text, refusal, annotations }

Content parts of a message item.

type: string

Content part type: output_text for reply text, refusal for a refusal.

text: optional string

The reply text, on an output_text part.

refusal: optional string

The refusal message, on a refusal part.

annotations: optional array of map[unknown]

Citations into text: file_citation for a file search source and url_citation (with url and title) for a web search source. Each covers its [S#] bracket and carries its citation_id.

name: optional string

Name of the tool called, on function_call, mcp_call and mcp_approval_request items.

arguments: optional string or map[unknown]

JSON-encoded arguments for the tool, on function_call, mcp_call and mcp_approval_request items. On a tool_search_call item, the search as an object, e.g. {"query": "search Slack messages"}.

One of the following:
string
map[unknown]
call_id: optional string

Identifier to answer a function_call with: send it back as the call_id of a function_call_output input item. On tool_search_call and tool_search_output items, it pairs a search with its result.

server_label: optional string

Label of the MCP server, on mcp_call, mcp_approval_request and mcp_list_tools items.

execution: optional "server" or "client"

Where a tool search ran, on tool_search_call and tool_search_output items. Searches Adaption runs are server.

One of the following:
"server"
"client"
approval_request_id: optional string

The approval request this mcp_call answers, if it needed approval.

output: optional string

What the tool returned, on an mcp_call item.

error: optional string

Why the tool call failed, on mcp_call and mcp_list_tools items.

tools: optional array of map[unknown]

Tools the server offers, on an mcp_list_tools item. On a tool_search_output item, the tools the search loaded, as function definitions.

summary: optional array of map[unknown]

Summary parts of a reasoning item, each with type and text.

encrypted_content: optional string

Opaque reasoning state to replay in a later request, on a reasoning item.

queries: optional array of string

Search queries, on a file_search_call item.

action: optional map[unknown]

The search on a web_search_call item: type, query, queries and sources (the result URLs).

results: optional array of map[unknown]

Matched chunks on a file_search_call item, or search results on a web_search_call item (citation_id, title, url, and when available summary, highlights, published_date, author). Send the item back unchanged to replay it without a new search.

session_id: optional string

Sandbox session of a code_execution_call item. Send it as the session_id of a code_execution tool to keep its files.

execution_id: optional string

Identifier of the run, on a code_execution_call item.

language: optional "python" or "javascript" or "typescript" or "bash"

Language of the code, on a code_execution_call item.

One of the following:
"python"
"javascript"
"typescript"
"bash"
code: optional string

Code the model ran, on a code_execution_call item.

exit_code: optional number

Exit code of the program, on a code_execution_call item. Null when the program did not run.

stdout: optional string

Standard output, on a code_execution_call item.

stderr: optional string

Standard error, on a code_execution_call item, or why the run failed.

stdout_truncated: optional boolean

Whether stdout was cut to the output limit.

stderr_truncated: optional boolean

Whether stderr was cut to the output limit.

sandbox_reused: optional boolean

Whether the run reused a sandbox from an earlier run in the session.

timing: optional map[unknown]

Run timing in milliseconds, on a code_execution_call item: sandbox_ms, execution_ms and total_ms.

output_text: string

The text of every output_text part in output, joined. Reasoning and tool calls are excluded.

error: optional ResponseError { code, message }
code: string
message: string
incomplete_details: optional ResponseIncompleteDetails { reason }
reason: optional string

Why the response is incomplete.

usage: optional ResponseUsage { input_tokens, output_tokens, total_tokens, 3 more }
input_tokens: number
output_tokens: number
total_tokens: number
input_tokens_details: optional map[unknown]
output_tokens_details: optional map[unknown]
cost: optional number

Cost of the request in US dollars. Missing when a model call did not report its cost.

previous_response_id: optional string

The response this one continues, if any.

store: optional boolean

Whether the response is stored for later retrieval.

metadata: optional map[string]
delta: optional string

The text added, on *.delta events.

item: optional ResponseOutputItem { type, id, status, 27 more }

The output item, on response.output_item.* events.

type: string

Item type, such as message, reasoning, function_call, mcp_call, file_search_call, web_search_call, code_execution_call, tool_search_call or tool_search_output. Fields beyond the ones listed depend on the type. On a self-improving stack, the model can search with tool_retriever for hosted MCP tools that were not loaded up front; each search is a tool_search_call followed by a tool_search_output.

id: optional string

Identifier of the output item.

status: optional string

Status of the item, such as completed or in_progress. A code_execution_call is completed, failed or timed_out.

role: optional "assistant"

Author of a message item.

content: optional array of ResponseOutputContent { type, text, refusal, annotations }

Content parts of a message item.

type: string

Content part type: output_text for reply text, refusal for a refusal.

text: optional string

The reply text, on an output_text part.

refusal: optional string

The refusal message, on a refusal part.

annotations: optional array of map[unknown]

Citations into text: file_citation for a file search source and url_citation (with url and title) for a web search source. Each covers its [S#] bracket and carries its citation_id.

name: optional string

Name of the tool called, on function_call, mcp_call and mcp_approval_request items.

arguments: optional string or map[unknown]

JSON-encoded arguments for the tool, on function_call, mcp_call and mcp_approval_request items. On a tool_search_call item, the search as an object, e.g. {"query": "search Slack messages"}.

One of the following:
string
map[unknown]
call_id: optional string

Identifier to answer a function_call with: send it back as the call_id of a function_call_output input item. On tool_search_call and tool_search_output items, it pairs a search with its result.

server_label: optional string

Label of the MCP server, on mcp_call, mcp_approval_request and mcp_list_tools items.

execution: optional "server" or "client"

Where a tool search ran, on tool_search_call and tool_search_output items. Searches Adaption runs are server.

One of the following:
"server"
"client"
approval_request_id: optional string

The approval request this mcp_call answers, if it needed approval.

output: optional string

What the tool returned, on an mcp_call item.

error: optional string

Why the tool call failed, on mcp_call and mcp_list_tools items.

tools: optional array of map[unknown]

Tools the server offers, on an mcp_list_tools item. On a tool_search_output item, the tools the search loaded, as function definitions.

summary: optional array of map[unknown]

Summary parts of a reasoning item, each with type and text.

encrypted_content: optional string

Opaque reasoning state to replay in a later request, on a reasoning item.

queries: optional array of string

Search queries, on a file_search_call item.

action: optional map[unknown]

The search on a web_search_call item: type, query, queries and sources (the result URLs).

results: optional array of map[unknown]

Matched chunks on a file_search_call item, or search results on a web_search_call item (citation_id, title, url, and when available summary, highlights, published_date, author). Send the item back unchanged to replay it without a new search.

session_id: optional string

Sandbox session of a code_execution_call item. Send it as the session_id of a code_execution tool to keep its files.

execution_id: optional string

Identifier of the run, on a code_execution_call item.

language: optional "python" or "javascript" or "typescript" or "bash"

Language of the code, on a code_execution_call item.

One of the following:
"python"
"javascript"
"typescript"
"bash"
code: optional string

Code the model ran, on a code_execution_call item.

exit_code: optional number

Exit code of the program, on a code_execution_call item. Null when the program did not run.

stdout: optional string

Standard output, on a code_execution_call item.

stderr: optional string

Standard error, on a code_execution_call item, or why the run failed.

stdout_truncated: optional boolean

Whether stdout was cut to the output limit.

stderr_truncated: optional boolean

Whether stderr was cut to the output limit.

sandbox_reused: optional boolean

Whether the run reused a sandbox from an earlier run in the session.

timing: optional map[unknown]

Run timing in milliseconds, on a code_execution_call item: sandbox_ms, execution_ms and total_ms.

output_index: optional number
item_id: optional string

Identifier of the output item the event belongs to.

content_index: optional number
text: optional string

The complete text, on *.done text events.

ResponseUsage object { input_tokens, output_tokens, total_tokens, 3 more }
input_tokens: number
output_tokens: number
total_tokens: number
input_tokens_details: optional map[unknown]
output_tokens_details: optional map[unknown]
cost: optional number

Cost of the request in US dollars. Missing when a model call did not report its cost.

ResponseDeleteResponse object { id, object, deleted }
id: string
object: "response.deleted"
deleted: true

ResponsesInput Items

List response input items
GET/api/v1/responses/{response_id}/input_items
ModelsExpand Collapse
InputItemListResponse = map[unknown]