id: string

The ID of the session.

minLength0
agent: Agent { id, instructions, model, 8 more }

The agent running in the session.

id: string

The ID of the agent.

minLength0
instructions: string | null

Custom instructions appended to the agent’s default base instructions.

minLength0
model: string

The model used by the agent.

minLength0
multi_agent: MultiAgentConfig { enabled, max_concurrent_subagents }

Configuration for creating and coordinating subagents.

name: string | null

The reusable agent’s name when the session was created, or null if no name was saved. Later changes to the agent’s name do not affect this value.

minLength0
reasoning: AgentReasoning { effort, summary }

The agent’s reasoning configuration.

service_tier: "auto" | "default" | "flex" | 3 more

The effective service-tier policy for model requests. Defaults to auto.

One of the following:
"auto"
"default"
"flex"
"priority"
"fast"
"ultrafast"
text: AgentText { format, verbosity }

Configuration for text generated by the agent.

tools: Array<AgentTool>

Tools available to the agent.

minItems0
maxItems2000
One of the following:
AgentToolResourceFunction { defer_loading, description, name, 3 more }

A function defined by the application.

defer_loading: boolean

Whether the function is deferred and discovered through tool search.

description: string

A description of what the function does.

minLength0
name: string

The name of the function.

minLength0
parameters: Record<string, unknown>

A JSON Schema object describing the function’s arguments.

type: "function"

The type of the object. Always function.

async?: boolean

Whether the agent continues without waiting for the function result.

AgentToolResourceProgrammaticToolCalling { enabled, type }

Enables calling tools from model-generated code.

enabled: boolean

Whether tools can be called from model-generated code.

type: "programmatic_tool_calling"

The type of the object. Always programmatic_tool_calling.

AgentToolResourceMcp { allowed_tools, connection_origin, credential_id, 5 more }

Tools provided by a remote MCP server.

allowed_tools: Array<string> | null

The MCP tools the agent may call.

minItems0
maxItems2000
connection_origin: "service" | "environment"

Where outbound MCP HTTP connections originate.

One of the following:
"service"
"environment"
credential_id: string | null

The attached vault credential selected for this MCP server, if any. Optional when exactly one attached credential matches the server URL.

minLength0
request_metadata: Record<string, unknown>

Metadata included with requests to this MCP server.

required: boolean

Whether this MCP server must initialize before the first turn.

server_label: string

A label used to identify the MCP server in tool calls.

minLength0
transport: McpTransport

The transport used to connect to the MCP server.

type: "mcp"

The type of the object. Always mcp.

AgentToolResourceWebSearch { allowed_domains, context_size, location, 2 more }

Web search.

allowed_domains: Array<string> | null

Allowed search domains, or null when the search is unrestricted.

minItems0
maxItems2000
context_size: "low" | "medium" | "high"

The amount of search context made available to the model. Defaults to medium.

One of the following:
"low"
"medium"
"high"
location: Location | null

Approximate location used to localize search results, if provided.

city: string | null

The city name.

minLength0
country: string | null

The two-letter ISO country code, such as US.

minLength0
region: string | null

The region or state name.

minLength0
timezone: string | null

The IANA timezone, such as America/Los_Angeles.

minLength0
mode: "disabled" | "cached" | "live"

The source used for web search results.

One of the following:
"disabled"
"cached"
"live"
type: "web_search"

The type of the object. Always web_search.

AgentToolResourceComputerUse { include_screenshots, type }

Browser use in an OpenAI-hosted session.

include_screenshots: boolean

Whether computer tool outputs include screenshots.

type: "computer_use"

The type of the object. Always computer_use.

AgentToolResourceAutomations { type }

Lets the agent manage its own scheduled wakeups.

type: "automations"

The type of the object. Always automations.

compaction?: Compaction { async }

The effective context compaction settings.

async: boolean

Whether context is compacted in the background. Defaults to false.

experimental?: Experimental { time_awareness }

The effective experimental settings for the agent.

time_awareness: boolean

Whether the model receives periodic current-time reminders.

created_at: number

The Unix timestamp, in seconds, when the session was created.

formatint64
environment: Environment

The execution environment for the session.

error: string | null

The error that caused the session to fail, if any.

minLength0
last_active_at: number

The Unix timestamp, in seconds, when the session was last active.

formatint64
metadata: Record<string, string>

Custom string key-value pairs attached to the session.

object: "agent.session"

The object type. Always agent.session.

required_actions: Array<SessionRequiredActionResourceMcpApprovalRequest { request, request_id, turn_id, type } | SessionRequiredActionResourceComputerUseApprovalRequest { request, request_id, turn_id, type } | SessionRequiredActionResourceFunctionCall { arguments, call_id, name, 2 more } | SessionRequiredActionResourceEnvironmentConnection { environment_id, type } >

Actions that must be completed before the session can continue.

minItems0
maxItems2000
One of the following:
SessionRequiredActionResourceMcpApprovalRequest { request, request_id, turn_id, type }

Respond to an MCP tool-call approval request.

request: Request { arguments, message, name, 2 more }

Information for presenting an MCP approval.

arguments: unknown

The tool arguments as JSON, or null when CCA does not provide them.

message: string
minLength0
name: string | null

The tool name, or null when CCA does not provide it.

minLength0
server_label: string
minLength0
type: "mcp_tool_call"

The type of the object. Always mcp_tool_call.

request_id: string

The opaque approval ID to echo when responding.

minLength0
turn_id: string

The turn that requested approval.

minLength0
type: "mcp_approval_request"

The type of the object. Always mcp_approval_request.

SessionRequiredActionResourceComputerUseApprovalRequest { request, request_id, turn_id, type }

Respond to a computer-use request.

request: ComputerUseApprovalRequestKindResourceBrowserAuthentication { credential_origin, fields, options, 2 more } | ComputerUseApprovalRequestKindResourceBrowserOriginAccess { origin, reason, type }

The information needed to render the request.

One of the following:
ComputerUseApprovalRequestKindResourceBrowserAuthentication { credential_origin, fields, options, 2 more }

A registered form awaiting the application’s response.

credential_origin: string | null

The registered form or frame origin where values will be entered.

minLength0
fields: Array<Field>

Controls to render. All submitted values are sensitive.

minItems0
maxItems2000
id: string

The field ID to submit as field_id in a fields entry.

minLength0
label: string

The label to display beside the control.

minLength0
required: boolean

Whether this control requires a nonempty value.

type: string

The rendering type, such as email, password, or text.

minLength0
options: Array<Option>

Sign-in methods. Empty for a plain form.

minItems0
maxItems2000
id: string

The option ID to submit as selected_option.

minLength0
field_ids: Array<string>

IDs from the registered fields that this method accepts.

minItems0
maxItems2000
label: string

The method label to display.

minLength0
reason: string | null

Why the agent needs the user to sign in.

minLength0
type: "browser_authentication"

The type of the object. Always browser_authentication.

ComputerUseApprovalRequestKindResourceBrowserOriginAccess { origin, reason, type }

A browser origin awaiting the application’s approval decision.

origin: string

The origin the browser needs permission to access.

minLength0
reason: string | null

The browser’s explanation for this request, or null when unavailable.

minLength0
type: "browser_origin_access"

The type of the object. Always browser_origin_access.

request_id: string

The registered request ID to echo when responding.

minLength0
turn_id: string

The turn that requested approval.

minLength0
type: "computer_use_approval_request"

The type of the object. Always computer_use_approval_request.

SessionRequiredActionResourceFunctionCall { arguments, call_id, name, 2 more }

Run a function tool and submit its result.

arguments: unknown

The arguments supplied by the model.

call_id: string

The ID to include when submitting the function result.

minLength0
name: string

The function name.

minLength0
turn_id: string

The ID of the turn that requested the function call.

minLength0
type: "function_call"

The type of the object. Always function_call.

SessionRequiredActionResourceEnvironmentConnection { environment_id, type }

Reconnect a session environment.

environment_id: string

The ID of the environment to reconnect.

minLength0
type: "environment_connection"

The type of the object. Always environment_connection.

status: "idle" | "in_progress" | "requires_action" | "failed"

The current status of the session.

One of the following:
"idle"

The session has no turn in progress and is ready for input. A hosted environment may still be provisioning.

"in_progress"

The session is processing a turn.

"requires_action"

The session is waiting for one or more required actions.

"failed"

The session failed.

usage: TokenUsage { input_tokens, input_tokens_details, output_tokens, 2 more } | null

Best-effort token usage for the session, or null if unknown. Recorded usage may change.

vault_ids: Array<string>

The IDs of vaults made available to the session.

minItems0
maxItems2000
prompt_cache_options?: PromptCacheOptions | null

Default prompt cache lifetime for turns in this session, when configured.

ttl: "30m" | "12h"
One of the following:
"30m"
"12h"
review?: "none" | "auto_review"

Review applied to eligible actions in this session. Omitted when review is none and automatic review is not enabled. Omission means none.

One of the following:
"none"
"auto_review"