1501 1501
1502 - `"environment_connection"`1502 - `"environment_connection"`
1503 1503
1504 - `status: "idle" or "in_progress" or "requires_action" or 2 more`1504 - `status: "idle" or "in_progress" or "requires_action" or "failed"`
1505 1505
1506 The current status of the session.1506 The current status of the session.
1507 1507
1521 1521
1522 The session failed.1522 The session failed.
1523 1523
1524 - `"budget_reached"`
1525
1526 The session is paused because its spending limit was reached.
1527
1528 - `usage: TokenUsage or null`1524 - `usage: TokenUsage or null`
1529 1525
1530 Best-effort token usage for the session, or null if unknown. Recorded usage may change.1526 Best-effort token usage for the session, or null if unknown. Recorded usage may change.
1752 1748
1753 A customer-safe error. Non-null only for a failed turn.1749 A customer-safe error. Non-null only for a failed turn.
1754 1750
1755 - `code: "context_length_exceeded" or "max_output_tokens" or "session_budget_exceeded" or 22 more`1751 - `code: "context_length_exceeded" or "max_output_tokens" or "usage_limit_exceeded" or 21 more`
1756 1752
1757 A stable, machine-readable failure category.1753 A stable, machine-readable failure category.
1758 1754
1764 1760
1765 The model reached its output token limit before finishing the response.1761 The model reached its output token limit before finishing the response.
1766 1762
1767 - `"session_budget_exceeded"`
1768
1769 The session has reached its usage budget.
1770
1771 - `"usage_limit_exceeded"`1763 - `"usage_limit_exceeded"`
1772 1764
1773 The organization has reached a usage, plan, or billing limit.1765 The organization has reached a usage, plan, or billing limit.
2079 2071
2080 A customer-safe error. Non-null only for a failed turn.2072 A customer-safe error. Non-null only for a failed turn.
2081 2073
2082 - `code: "context_length_exceeded" or "max_output_tokens" or "session_budget_exceeded" or 22 more`2074 - `code: "context_length_exceeded" or "max_output_tokens" or "usage_limit_exceeded" or 21 more`
2083 2075
2084 A stable, machine-readable failure category.2076 A stable, machine-readable failure category.
2085 2077
2091 2083
2092 The model reached its output token limit before finishing the response.2084 The model reached its output token limit before finishing the response.
2093 2085
2094 - `"session_budget_exceeded"`
2095
2096 The session has reached its usage budget.
2097
2098 - `"usage_limit_exceeded"`2086 - `"usage_limit_exceeded"`
2099 2087
2100 The organization has reached a usage, plan, or billing limit.2088 The organization has reached a usage, plan, or billing limit.
2406 2394
2407 A customer-safe error. Non-null only for a failed turn.2395 A customer-safe error. Non-null only for a failed turn.
2408 2396
2409 - `code: "context_length_exceeded" or "max_output_tokens" or "session_budget_exceeded" or 22 more`2397 - `code: "context_length_exceeded" or "max_output_tokens" or "usage_limit_exceeded" or 21 more`
2410 2398
2411 A stable, machine-readable failure category.2399 A stable, machine-readable failure category.
2412 2400
2418 2406
2419 The model reached its output token limit before finishing the response.2407 The model reached its output token limit before finishing the response.
2420 2408
2421 - `"session_budget_exceeded"`
2422
2423 The session has reached its usage budget.
2424
2425 - `"usage_limit_exceeded"`2409 - `"usage_limit_exceeded"`
2426 2410
2427 The organization has reached a usage, plan, or billing limit.2411 The organization has reached a usage, plan, or billing limit.
2748 2732
2749 A customer-safe error. Non-null only for a failed turn.2733 A customer-safe error. Non-null only for a failed turn.
2750 2734
2751 - `code: "context_length_exceeded" or "max_output_tokens" or "session_budget_exceeded" or 22 more`2735 - `code: "context_length_exceeded" or "max_output_tokens" or "usage_limit_exceeded" or 21 more`
2752 2736
2753 A stable, machine-readable failure category.2737 A stable, machine-readable failure category.
2754 2738
2760 2744
2761 The model reached its output token limit before finishing the response.2745 The model reached its output token limit before finishing the response.
2762 2746
2763 - `"session_budget_exceeded"`
2764
2765 The session has reached its usage budget.
2766
2767 - `"usage_limit_exceeded"`2747 - `"usage_limit_exceeded"`
2768 2748
2769 The organization has reached a usage, plan, or billing limit.2749 The organization has reached a usage, plan, or billing limit.
3090 3070
3091 A customer-safe error. Non-null only for a failed turn.3071 A customer-safe error. Non-null only for a failed turn.
3092 3072
3093 - `code: "context_length_exceeded" or "max_output_tokens" or "session_budget_exceeded" or 22 more`3073 - `code: "context_length_exceeded" or "max_output_tokens" or "usage_limit_exceeded" or 21 more`
3094 3074
3095 A stable, machine-readable failure category.3075 A stable, machine-readable failure category.
3096 3076
3102 3082
3103 The model reached its output token limit before finishing the response.3083 The model reached its output token limit before finishing the response.
3104 3084
3105 - `"session_budget_exceeded"`
3106
3107 The session has reached its usage budget.
3108
3109 - `"usage_limit_exceeded"`3085 - `"usage_limit_exceeded"`
3110 3086
3111 The organization has reached a usage, plan, or billing limit.3087 The organization has reached a usage, plan, or billing limit.
5457 5433
5458 - `"environment_connection"`5434 - `"environment_connection"`
5459 5435
5460 - `status: "idle" or "in_progress" or "requires_action" or 2 more`5436 - `status: "idle" or "in_progress" or "requires_action" or "failed"`
5461 5437
5462 The current status of the session.5438 The current status of the session.
5463 5439
5477 5453
5478 The session failed.5454 The session failed.
5479 5455
5480 - `"budget_reached"`
5481
5482 The session is paused because its spending limit was reached.
5483
5484 - `usage: TokenUsage or null`5456 - `usage: TokenUsage or null`
5485 5457
5486 Best-effort token usage for the session, or null if unknown. Recorded usage may change.5458 Best-effort token usage for the session, or null if unknown. Recorded usage may change.
5654}5626}
5655```5627```
5656 5628
5657<a id="agent.session.budget_reached"></a>5629<a id="agent.session.in_progress"></a>
5658 5630
5659## agent.session.budget_reached5631## agent.session.in_progress
5660 5632
5661Emitted when a session pauses because its spending limit was reached.5633Emitted when a session starts processing a turn.
5662 5634
5663### Schema5635### Schema
5664 5636
5665Schema name: `SessionEventAgentSessionBudgetReached`5637Schema name: `SessionEventAgentSessionInProgress`
5666 5638
5667- `event_id: string`5639- `event_id: string`
5668 5640
5672 5644
5673- `session: AgentSession`5645- `session: AgentSession`
5674 5646
5675 The paused session.5647 The session that started processing.
5676 5648
5677 - `id: string`5649 - `id: string`
5678 5650
6618 6590
6619 - `"environment_connection"`6591 - `"environment_connection"`
6620 6592
6621 - `status: "idle" or "in_progress" or "requires_action" or 2 more`6593 - `status: "idle" or "in_progress" or "requires_action" or "failed"`
6622 6594
6623 The current status of the session.6595 The current status of the session.
6624 6596
6638 6610
6639 The session failed.6611 The session failed.
6640 6612
6641 - `"budget_reached"`
6642
6643 The session is paused because its spending limit was reached.
6644
6645 - `usage: TokenUsage or null`6613 - `usage: TokenUsage or null`
6646 6614
6647 Best-effort token usage for the session, or null if unknown. Recorded usage may change.6615 Best-effort token usage for the session, or null if unknown. Recorded usage may change.
6708 6676
6709 - `"auto_review"`6677 - `"auto_review"`
6710 6678
6711- `type: "agent.session.budget_reached" (default: "agent.session.budget_reached")`6679- `type: "agent.session.in_progress" (default: "agent.session.in_progress")`
6712 6680
6713 The type of the object. Always `agent.session.budget_reached`.6681 The type of the object. Always `agent.session.in_progress`.
6714 6682
6715 - `"agent.session.budget_reached"`6683 - `"agent.session.in_progress"`
6716 6684
6717- `obfuscation: optional string`6685- `obfuscation: optional string`
6718 6686
6724 6692
6725```json6693```json
6726{6694{
6727 "type": "agent.session.budget_reached",6695 "type": "agent.session.in_progress",
6728 "event_id": "event_id",6696 "event_id": "event_id",
6729 "session": {6697 "session": {
6730 "prompt_cache_options": {6698 "prompt_cache_options": {
6815}6783}
6816```6784```
6817 6785
6818<a id="agent.session.in_progress"></a>6786<a id="agent.session.requires_action"></a>
6819 6787
6820## agent.session.in_progress6788## agent.session.requires_action
6821 6789
6822Emitted when a session starts processing a turn.6790Emitted when a session is waiting for one or more required actions.
6823 6791
6824### Schema6792### Schema
6825 6793
6826Schema name: `SessionEventAgentSessionInProgress`6794Schema name: `SessionEventAgentSessionRequiresAction`
6827 6795
6828- `event_id: string`6796- `event_id: string`
6829 6797
6833 6801
6834- `session: AgentSession`6802- `session: AgentSession`
6835 6803
6836 The session that started processing.6804 The session and its current required actions.
6837 6805
6838 - `id: string`6806 - `id: string`
6839 6807
7779 7747
7780 - `"environment_connection"`7748 - `"environment_connection"`
7781 7749
7782 - `status: "idle" or "in_progress" or "requires_action" or 2 more`7750 - `status: "idle" or "in_progress" or "requires_action" or "failed"`
7783 7751
7784 The current status of the session.7752 The current status of the session.
7785 7753
7799 7767
7800 The session failed.7768 The session failed.
7801 7769
7802 - `"budget_reached"`
7803
7804 The session is paused because its spending limit was reached.
7805
7806 - `usage: TokenUsage or null`7770 - `usage: TokenUsage or null`
7807 7771
7808 Best-effort token usage for the session, or null if unknown. Recorded usage may change.7772 Best-effort token usage for the session, or null if unknown. Recorded usage may change.
7869 7833
7870 - `"auto_review"`7834 - `"auto_review"`
7871 7835
7872- `type: "agent.session.in_progress" (default: "agent.session.in_progress")`7836- `type: "agent.session.requires_action" (default: "agent.session.requires_action")`
7873 7837
7874 The type of the object. Always `agent.session.in_progress`.7838 The type of the object. Always `agent.session.requires_action`.
7875 7839
7876 - `"agent.session.in_progress"`7840 - `"agent.session.requires_action"`
7877 7841
7878- `obfuscation: optional string`7842- `obfuscation: optional string`
7879 7843
7885 7849
7886```json7850```json
7887{7851{
7888 "type": "agent.session.in_progress",7852 "type": "agent.session.requires_action",
7889 "event_id": "event_id",7853 "event_id": "event_id",
7890 "session": {7854 "session": {
7891 "prompt_cache_options": {7855 "prompt_cache_options": {
7976}7940}
7977```7941```
7978 7942
7979<a id="agent.session.requires_action"></a>7943<a id="agent.session.failed"></a>
7980 7944
7981## agent.session.requires_action7945## agent.session.failed
7982 7946
7983Emitted when a session is waiting for one or more required actions.7947Emitted when a session fails.
7984 7948
7985### Schema7949### Schema
7986 7950
7987Schema name: `SessionEventAgentSessionRequiresAction`7951Schema name: `SessionEventAgentSessionFailed`
7988 7952
7989- `event_id: string`7953- `event_id: string`
7990 7954
7994 7958
7995- `session: AgentSession`7959- `session: AgentSession`
7996 7960
7997 The session and its current required actions.7961 The failed session.
7998 7962
7999 - `id: string`7963 - `id: string`
8000 7964
8940 8904
8941 - `"environment_connection"`8905 - `"environment_connection"`
8942 8906
8943 - `status: "idle" or "in_progress" or "requires_action" or 2 more`8907 - `status: "idle" or "in_progress" or "requires_action" or "failed"`
8944 8908
8945 The current status of the session.8909 The current status of the session.
8946 8910
8960 8924
8961 The session failed.8925 The session failed.
8962 8926
8963 - `"budget_reached"`
8964
8965 The session is paused because its spending limit was reached.
8966
8967 - `usage: TokenUsage or null`
8968
8969 Best-effort token usage for the session, or null if unknown. Recorded usage may change.
8970
8971 - `input_tokens: integer`
8972
8973 The number of input tokens used by the agent.
8974
8975 `format: int64`
8976
8977 - `input_tokens_details: object { cached_tokens }`
8978
8979 A breakdown of the agent's input token usage.
8980
8981 - `cached_tokens: integer`
8982
8983 The number of input tokens retrieved from the prompt cache.
8984
8985 `format: int64`
8986
8987 - `output_tokens: integer`
8988
8989 The number of output tokens generated by the agent.
8990
8991 `format: int64`
8992
8993 - `output_tokens_details: object { reasoning_tokens }`
8994
8995 A breakdown of the agent's output token usage.
8996
8997 - `reasoning_tokens: integer`
8998
8999 The number of output tokens used for reasoning.
9000
9001 `format: int64`
9002
9003 - `total_tokens: integer`
9004
9005 The total number of input and output tokens used by the agent.
9006
9007 `format: int64`
9008
9009 - `vault_ids: array of string`
9010
9011 The IDs of vaults made available to the session.
9012
9013 `minItems: 0`, `maxItems: 2000`
9014
9015 - `prompt_cache_options: optional object { ttl } or null`
9016
9017 Default prompt cache lifetime for turns in this session, when configured.
9018
9019 - `ttl: "30m" or "12h"`
9020
9021 - `"30m"`
9022
9023 - `"12h"`
9024
9025 - `review: optional "none" or "auto_review"`
9026
9027 Review applied to eligible actions in this session. Omitted when review is none and automatic review is not enabled. Omission means none.
9028
9029 - `"none"`
9030
9031 - `"auto_review"`
9032
9033- `type: "agent.session.requires_action" (default: "agent.session.requires_action")`
9034
9035 The type of the object. Always `agent.session.requires_action`.
9036
9037 - `"agent.session.requires_action"`
9038
9039- `obfuscation: optional string`
9040
9041 Random alphanumeric padding. Present when stream obfuscation is enabled.
9042
9043 `minLength: 0`
9044
9045### Example
9046
9047```json
9048{
9049 "type": "agent.session.requires_action",
9050 "event_id": "event_id",
9051 "session": {
9052 "prompt_cache_options": {
9053 "ttl": "30m"
9054 },
9055 "review": "none",
9056 "metadata": {
9057 "foo": "string"
9058 },
9059 "id": "id",
9060 "object": "agent.session",
9061 "created_at": 0,
9062 "last_active_at": 0,
9063 "status": "idle",
9064 "required_actions": [
9065 {
9066 "type": "mcp_approval_request",
9067 "turn_id": "turn_id",
9068 "request_id": "request_id",
9069 "request": {
9070 "type": "mcp_tool_call",
9071 "server_label": "server_label",
9072 "name": "name",
9073 "arguments": {},
9074 "message": "message"
9075 }
9076 }
9077 ],
9078 "error": "error",
9079 "agent": {
9080 "id": "id",
9081 "name": "name",
9082 "model": "model",
9083 "reasoning": {
9084 "effort": "none",
9085 "summary": "concise"
9086 },
9087 "text": {
9088 "format": {
9089 "type": "text"
9090 },
9091 "verbosity": "low"
9092 },
9093 "service_tier": "auto",
9094 "instructions": "instructions",
9095 "tools": [
9096 {
9097 "type": "function",
9098 "name": "name",
9099 "description": "description",
9100 "parameters": {
9101 "foo": "bar"
9102 },
9103 "defer_loading": true,
9104 "async": true
9105 }
9106 ],
9107 "multi_agent": {
9108 "enabled": true,
9109 "max_concurrent_subagents": 1
9110 },
9111 "compaction": {
9112 "async": true
9113 },
9114 "experimental": {
9115 "time_awareness": true
9116 }
9117 },
9118 "environment": {
9119 "type": "none"
9120 },
9121 "vault_ids": [
9122 "string"
9123 ],
9124 "usage": {
9125 "input_tokens": 0,
9126 "input_tokens_details": {
9127 "cached_tokens": 0
9128 },
9129 "output_tokens": 0,
9130 "output_tokens_details": {
9131 "reasoning_tokens": 0
9132 },
9133 "total_tokens": 0
9134 }
9135 },
9136 "obfuscation": "obfuscation"
9137}
9138```
9139
9140<a id="agent.session.failed"></a>
9141
9142## agent.session.failed
9143
9144Emitted when a session fails.
9145
9146### Schema
9147
9148Schema name: `SessionEventAgentSessionFailed`
9149
9150- `event_id: string`
9151
9152 The unique ID of the event.
9153
9154 `minLength: 0`
9155
9156- `session: AgentSession`
9157
9158 The failed session.
9159
9160 - `id: string`
9161
9162 The ID of the session.
9163
9164 `minLength: 0`
9165
9166 - `agent: object { id, instructions, model, 8 more }`
9167
9168 The agent running in the session.
9169
9170 - `id: string`
9171
9172 The ID of the agent.
9173
9174 `minLength: 0`
9175
9176 - `instructions: string or null`
9177
9178 Custom instructions appended to the agent's default base instructions.
9179
9180 `minLength: 0`
9181
9182 - `model: string`
9183
9184 The model used by the agent.
9185
9186 `minLength: 0`
9187
9188 - `multi_agent: MultiAgentConfig`
9189
9190 Configuration for creating and coordinating subagents.
9191
9192 - `enabled: boolean`
9193
9194 Whether subagent tools are enabled. Defaults to false.
9195
9196 - `max_concurrent_subagents: integer or null`
9197
9198 Maximum number of subagents that may run concurrently, or null when disabled. Defaults to 6 when enabled.
9199
9200 `format: int64`, `minimum: 1`, `maximum: 4294967295`
9201
9202 - `name: string or null`
9203
9204 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.
9205
9206 `minLength: 0`
9207
9208 - `reasoning: AgentReasoning`
9209
9210 The agent's reasoning configuration.
9211
9212 - `effort: "none" or "minimal" or "low" or 4 more or null`
9213
9214 The requested reasoning effort, or `null` when the model selects its own default.
9215
9216 - `"none"`
9217
9218 - `"minimal"`
9219
9220 - `"low"`
9221
9222 - `"medium"`
9223
9224 - `"high"`
9225
9226 - `"xhigh"`
9227
9228 - `"max"`
9229
9230 - `summary: "concise" or "detailed" or "auto" or null`
9231
9232 The requested reasoning summary format, or `null` when summaries are disabled.
9233
9234 - `"concise"`
9235
9236 Returns a concise reasoning summary when supported.
9237
9238 - `"detailed"`
9239
9240 Returns a detailed reasoning summary when supported.
9241
9242 - `"auto"`
9243
9244 Automatically selects the most detailed summary supported by the model.
9245
9246 - `service_tier: "auto" or "default" or "flex" or 3 more`
9247
9248 The effective service-tier policy for model requests. Defaults to `auto`.
9249
9250 - `"auto"`
9251
9252 - `"default"`
9253
9254 - `"flex"`
9255
9256 - `"priority"`
9257
9258 - `"fast"`
9259
9260 - `"ultrafast"`
9261
9262 - `text: AgentText`
9263
9264 Configuration for text generated by the agent.
9265
9266 - `format: TextFormat`
9267
9268 The effective output format. Defaults to ordinary text.
9269
9270 - `Text object { type }`
9271
9272 Generates ordinary text without a structured-output constraint.
9273
9274 - `type: "text" (default: "text")`
9275
9276 The type of the object. Always `text`.
9277
9278 - `"text"`
9279
9280 - `JSONSchema object { schema, type }`
9281
9282 Constrains generated text to a JSON Schema.
9283
9284 - `schema: map[unknown]`
9285
9286 The JSON Schema that generated text must match.
9287
9288 - `type: "json_schema" (default: "json_schema")`
9289
9290 The type of the object. Always `json_schema`.
9291
9292 - `"json_schema"`
9293
9294 - `verbosity: "low" or "medium" or "high"`
9295
9296 The amount of text produced by the agent. Defaults to `medium`.
9297
9298 - `"low"`
9299
9300 - `"medium"`
9301
9302 - `"high"`
9303
9304 - `tools: array of AgentTool`
9305
9306 Tools available to the agent.
9307
9308 `minItems: 0`, `maxItems: 2000`
9309
9310 - `Function object { defer_loading, description, name, 3 more }`
9311
9312 A function defined by the application.
9313
9314 - `defer_loading: boolean`
9315
9316 Whether the function is deferred and discovered through tool search.
9317
9318 - `description: string`
9319
9320 A description of what the function does.
9321
9322 `minLength: 0`
9323
9324 - `name: string`
9325
9326 The name of the function.
9327
9328 `minLength: 0`
9329
9330 - `parameters: map[unknown]`
9331
9332 A JSON Schema object describing the function's arguments.
9333
9334 - `type: "function" (default: "function")`
9335
9336 The type of the object. Always `function`.
9337
9338 - `"function"`
9339
9340 - `async: optional boolean`
9341
9342 Whether the agent continues without waiting for the function result.
9343
9344 - `ProgrammaticToolCalling object { enabled, type }`
9345
9346 Enables calling tools from model-generated code.
9347
9348 - `enabled: boolean`
9349
9350 Whether tools can be called from model-generated code.
9351
9352 - `type: "programmatic_tool_calling" (default: "programmatic_tool_calling")`
9353
9354 The type of the object. Always `programmatic_tool_calling`.
9355
9356 - `"programmatic_tool_calling"`
9357
9358 - `Mcp object { allowed_tools, connection_origin, credential_id, 5 more }`
9359
9360 Tools provided by a remote MCP server.
9361
9362 - `allowed_tools: array of string or null`
9363
9364 The MCP tools the agent may call.
9365
9366 `minItems: 0`, `maxItems: 2000`
9367
9368 - `connection_origin: "service" or "environment"`
9369
9370 Where outbound MCP HTTP connections originate.
9371
9372 - `"service"`
9373
9374 - `"environment"`
9375
9376 - `credential_id: string or null`
9377
9378 The attached vault credential selected for this MCP server, if any. Optional when exactly one attached credential matches the server URL.
9379
9380 `minLength: 0`
9381
9382 - `request_metadata: map[unknown]`
9383
9384 Metadata included with requests to this MCP server.
9385
9386 - `required: boolean`
9387
9388 Whether this MCP server must initialize before the first turn.
9389
9390 - `server_label: string`
9391
9392 A label used to identify the MCP server in tool calls.
9393
9394 `minLength: 0`
9395
9396 - `transport: McpTransport`
9397
9398 The transport used to connect to the MCP server.
9399
9400 - `HTTP object { server_url, type }`
9401
9402 Connects to an MCP server over HTTP.
9403
9404 - `server_url: string`
9405
9406 The URL of the MCP server.
9407
9408 `minLength: 0`
9409
9410 - `type: "http" (default: "http")`
9411
9412 The type of the object. Always `http`.
9413
9414 - `"http"`
9415
9416 - `Stdio object { args, command, cwd, 2 more }`
9417
9418 Starts an MCP server as a local process.
9419
9420 - `args: array of string`
9421
9422 Arguments passed to the MCP server command.
9423
9424 `minItems: 0`, `maxItems: 2000`
9425
9426 - `command: string`
9427
9428 The command used to start the MCP server.
9429
9430 `minLength: 0`
9431
9432 - `cwd: string`
9433
9434 The working directory used to start the MCP server.
9435
9436 `minLength: 0`
9437
9438 - `env_vars: array of string`
9439
9440 Environment variable names inherited from the execution environment.
9441
9442 `minItems: 0`, `maxItems: 2000`
9443
9444 - `type: "stdio" (default: "stdio")`
9445
9446 The type of the object. Always `stdio`.
9447
9448 - `"stdio"`
9449
9450 - `type: "mcp" (default: "mcp")`
9451
9452 The type of the object. Always `mcp`.
9453
9454 - `"mcp"`
9455
9456 - `WebSearch object { allowed_domains, context_size, location, 2 more }`
9457
9458 Web search.
9459
9460 - `allowed_domains: array of string or null`
9461
9462 Allowed search domains, or `null` when the search is unrestricted.
9463
9464 `minItems: 0`, `maxItems: 2000`
9465
9466 - `context_size: "low" or "medium" or "high"`
9467
9468 The amount of search context made available to the model. Defaults to `medium`.
9469
9470 - `"low"`
9471
9472 - `"medium"`
9473
9474 - `"high"`
9475
9476 - `location: object { city, country, region, timezone } or null`
9477
9478 Approximate location used to localize search results, if provided.
9479
9480 - `city: string or null`
9481
9482 The city name.
9483
9484 `minLength: 0`
9485
9486 - `country: string or null`
9487
9488 The two-letter ISO country code, such as `US`.
9489
9490 `minLength: 0`
9491
9492 - `region: string or null`
9493
9494 The region or state name.
9495
9496 `minLength: 0`
9497
9498 - `timezone: string or null`
9499
9500 The IANA timezone, such as `America/Los_Angeles`.
9501
9502 `minLength: 0`
9503
9504 - `mode: "disabled" or "cached" or "live"`
9505
9506 The source used for web search results.
9507
9508 - `"disabled"`
9509
9510 - `"cached"`
9511
9512 - `"live"`
9513
9514 - `type: "web_search" (default: "web_search")`
9515
9516 The type of the object. Always `web_search`.
9517
9518 - `"web_search"`
9519
9520 - `ComputerUse object { include_screenshots, type }`
9521
9522 Browser use in an OpenAI-hosted session.
9523
9524 - `include_screenshots: boolean`
9525
9526 Whether computer tool outputs include screenshots.
9527
9528 - `type: "computer_use" (default: "computer_use")`
9529
9530 The type of the object. Always `computer_use`.
9531
9532 - `"computer_use"`
9533
9534 - `Automations object { type }`
9535
9536 Lets the agent manage its own scheduled wakeups.
9537
9538 - `type: "automations" (default: "automations")`
9539
9540 The type of the object. Always `automations`.
9541
9542 - `"automations"`
9543
9544 - `compaction: optional object { async }`
9545
9546 The effective context compaction settings.
9547
9548 - `async: boolean`
9549
9550 Whether context is compacted in the background. Defaults to false.
9551
9552 - `experimental: optional object { time_awareness }`
9553
9554 The effective experimental settings for the agent.
9555
9556 - `time_awareness: boolean`
9557
9558 Whether the model receives periodic current-time reminders.
9559
9560 - `created_at: integer`
9561
9562 The Unix timestamp, in seconds, when the session was created.
9563
9564 `format: int64`
9565
9566 - `environment: Environment`
9567
9568 The execution environment for the session.
9569
9570 - `None object { type }`
9571
9572 The session talks to CCA without selecting or provisioning an execution environment.
9573
9574 - `type: "none" (default: "none")`
9575
9576 The type of the object. Always `none`.
9577
9578 - `"none"`
9579
9580 - `OpenAIHosted object { id, capability_directories, desktop, 7 more }`
9581
9582 An environment hosted by OpenAI.
9583
9584 - `id: string`
9585
9586 The public ID of the environment.
9587
9588 `minLength: 0`
9589
9590 - `capability_directories: array of string`
9591
9592 Directories that contain capabilities exposed to the agent.
9593
9594 `minItems: 0`, `maxItems: 2000`
9595
9596 - `desktop: object { enabled }`
9597
9598 The effective desktop configuration.
9599
9600 - `enabled: boolean`
9601
9602 Whether the environment provisions a desktop and browser proxy.
9603
9604 - `files: array of HostedEnvironmentFile`
9605
9606 Files available in the environment, excluding their contents.
9607
9608 `minItems: 0`, `maxItems: 50`
9609
9610 - `HostedEnvironmentFileID object { id, file_id, path, 2 more }`
9611
9612 A file copied from the OpenAI Files API.
9613
9614 - `id: string`
9615
9616 The session-scoped ID of the file in the execution environment.
9617
9618 `minLength: 0`
9619
9620 - `file_id: string`
9621
9622 The ID of the uploaded file.
9623
9624 `minLength: 0`
9625
9626 - `path: string`
9627
9628 The file's absolute path inside the environment.
9629
9630 `minLength: 0`
9631
9632 - `size_bytes: integer`
9633
9634 The decoded file size in bytes.
9635
9636 `format: int64`, `minimum: 0`
9637
9638 - `type: "file_id" (default: "file_id")`
9639
9640 The type of the object. Always `file_id`.
9641
9642 - `"file_id"`
9643
9644 - `Inline object { id, path, size_bytes, type }`
9645
9646 A file supplied inline when the session was created.
9647
9648 - `id: string`
9649
9650 The session-scoped ID of the file in the execution environment.
9651
9652 `minLength: 0`
9653
9654 - `path: string`
9655
9656 The file's absolute path inside the environment.
9657
9658 `minLength: 0`
9659
9660 - `size_bytes: integer`
9661
9662 The decoded file size in bytes.
9663
9664 `format: int64`, `minimum: 0`
9665
9666 - `type: "inline" (default: "inline")`
9667
9668 The type of the object. Always `inline`.
9669
9670 - `"inline"`
9671
9672 - `network: object { access, allowed_domains }`
9673
9674 The effective network access policy for the environment.
9675
9676 - `access: "enabled" or "disabled" or "restricted"`
9677
9678 The environment's network access mode.
9679
9680 - `"enabled"`
9681
9682 Allows unrestricted network access.
9683
9684 - `"disabled"`
9685
9686 Disables network access.
9687
9688 - `"restricted"`
9689
9690 Applies the configured domain restrictions.
9691
9692 - `allowed_domains: array of string`
9693
9694 Domains the environment may access when network access is restricted.
9695
9696 `minItems: 0`, `maxItems: 2000`
9697
9698 - `packages: object { npm, python, system }`
9699
9700 Packages installed in the environment.
9701
9702 - `npm: array of string`
9703
9704 npm packages installed globally in the environment.
9705
9706 `minItems: 0`, `maxItems: 16384`
9707
9708 - `python: array of string`
9709
9710 Python packages installed in the environment.
9711
9712 `minItems: 0`, `maxItems: 16384`
9713
9714 - `system: array of string`
9715
9716 System packages installed in the environment.
9717
9718 `minItems: 0`, `maxItems: 16384`
9719
9720 - `plugins: array of HostedPlugin`
9721
9722 Plugins installed in the environment, excluding their archive contents.
9723
9724 `minItems: 0`, `maxItems: 2000`
9725
9726 - `description: string`
9727
9728 The installed plugin description.
9729
9730 `minLength: 0`
9731
9732 - `name: string`
9733
9734 The installed plugin name.
9735
9736 `minLength: 0`
9737
9738 - `type: "inline" (default: "inline")`
9739
9740 The type of the object. Always `inline`.
9741
9742 - `"inline"`
9743
9744 - `skills: array of HostedSkill`
9745
9746 Skills installed in the environment, excluding their archive contents.
9747
9748 `minItems: 0`, `maxItems: 2000`
9749
9750 - `HostedSkillReference object { description, name, skill_id, 2 more }`
9751
9752 A skill installed from the Skills API.
9753
9754 - `description: string`
9755
9756 The installed skill description.
9757
9758 `minLength: 0`
9759
9760 - `name: string`
9761
9762 The installed skill name.
9763
9764 `minLength: 0`
9765
9766 - `skill_id: string`
9767
9768 The referenced skill ID.
9769
9770 `minLength: 0`
9771
9772 - `type: "skill_reference" (default: "skill_reference")`
9773
9774 The type of the object. Always `skill_reference`.
9775
9776 - `"skill_reference"`
9777
9778 - `version: string`
9779
9780 The concrete skill version installed for this session.
9781
9782 `minLength: 0`
9783
9784 - `Inline object { description, name, type }`
9785
9786 A skill installed from an inline ZIP archive.
9787
9788 - `description: string`
9789
9790 The installed skill description.
9791
9792 `minLength: 0`
9793
9794 - `name: string`
9795
9796 The installed skill name.
9797
9798 `minLength: 0`
9799
9800 - `type: "inline" (default: "inline")`
9801
9802 The type of the object. Always `inline`.
9803
9804 - `"inline"`
9805
9806 - `type: "openai_hosted" (default: "openai_hosted")`
9807
9808 The type of the object. Always `openai_hosted`.
9809
9810 - `"openai_hosted"`
9811
9812 - `container_size: optional "small" or "medium" or "large" or null`
9813
9814 The effective CPU and memory tier, or null when unknown or outside the public tiers.
9815
9816 - `"small"`
9817
9818 - `"medium"`
9819
9820 - `"large"`
9821
9822 - `SelfHosted object { id, capability_directories, remote_url, 2 more }`
9823
9824 An environment hosted by the application.
9825
9826 - `id: string`
9827
9828 The public ID of the environment.
9829
9830 `minLength: 0`
9831
9832 - `capability_directories: array of string`
9833
9834 Directories that contain capabilities exposed to the agent.
9835
9836 `minItems: 0`, `maxItems: 2000`
9837
9838 - `remote_url: string`
9839
9840 Pass this URL unchanged to `codex exec-server --remote` when connecting this environment.
9841
9842 `minLength: 0`
9843
9844 - `type: "self_hosted" (default: "self_hosted")`
9845
9846 The type of the object. Always `self_hosted`.
9847
9848 - `"self_hosted"`
9849
9850 - `workspace_directory: string`
9851
9852 The absolute project directory inside the environment. Defaults to `/workspace`.
9853
9854 `minLength: 0`
9855
9856 - `error: string or null`
9857
9858 The error that caused the session to fail, if any.
9859
9860 `minLength: 0`
9861
9862 - `last_active_at: integer`
9863
9864 The Unix timestamp, in seconds, when the session was last active.
9865
9866 `format: int64`
9867
9868 - `metadata: map[string]`
9869
9870 Custom string key-value pairs attached to the session.
9871
9872 - `object: "agent.session" (default: "agent.session")`
9873
9874 The object type. Always `agent.session`.
9875
9876 - `"agent.session"`
9877
9878 - `required_actions: array of McpApprovalRequest { request, request_id, turn_id, type } or ComputerUseApprovalRequest { request, request_id, turn_id, type } or FunctionCall { arguments, call_id, name, 2 more } or EnvironmentConnection { environment_id, type }`
9879
9880 Actions that must be completed before the session can continue.
9881
9882 `minItems: 0`, `maxItems: 2000`
9883
9884 - `McpApprovalRequest object { request, request_id, turn_id, type }`
9885
9886 Respond to an MCP tool-call approval request.
9887
9888 - `request: object { arguments, message, name, 2 more }`
9889
9890 Information for presenting an MCP approval.
9891
9892 - `arguments: unknown`
9893
9894 The tool arguments as JSON, or null when CCA does not provide them.
9895
9896 - `message: string`
9897
9898 `minLength: 0`
9899
9900 - `name: string or null`
9901
9902 The tool name, or null when CCA does not provide it.
9903
9904 `minLength: 0`
9905
9906 - `server_label: string`
9907
9908 `minLength: 0`
9909
9910 - `type: "mcp_tool_call" (default: "mcp_tool_call")`
9911
9912 The type of the object. Always `mcp_tool_call`.
9913
9914 - `"mcp_tool_call"`
9915
9916 - `request_id: string`
9917
9918 The opaque approval ID to echo when responding.
9919
9920 `minLength: 0`
9921
9922 - `turn_id: string`
9923
9924 The turn that requested approval.
9925
9926 `minLength: 0`
9927
9928 - `type: "mcp_approval_request" (default: "mcp_approval_request")`
9929
9930 The type of the object. Always `mcp_approval_request`.
9931
9932 - `"mcp_approval_request"`
9933
9934 - `ComputerUseApprovalRequest object { request, request_id, turn_id, type }`
9935
9936 Respond to a computer-use request.
9937
9938 - `request: BrowserAuthentication { credential_origin, fields, options, 2 more } or BrowserOriginAccess { origin, reason, type }`
9939
9940 The information needed to render the request.
9941
9942 - `BrowserAuthentication object { credential_origin, fields, options, 2 more }`
9943
9944 A registered form awaiting the application's response.
9945
9946 - `credential_origin: string or null`
9947
9948 The registered form or frame origin where values will be entered.
9949
9950 `minLength: 0`
9951
9952 - `fields: array of object { id, label, required, type }`
9953
9954 Controls to render. All submitted values are sensitive.
9955
9956 `minItems: 0`, `maxItems: 2000`
9957
9958 - `id: string`
9959
9960 The field ID to submit as field_id in a fields entry.
9961
9962 `minLength: 0`
9963
9964 - `label: string`
9965
9966 The label to display beside the control.
9967
9968 `minLength: 0`
9969
9970 - `required: boolean`
9971
9972 Whether this control requires a nonempty value.
9973
9974 - `type: string`
9975
9976 The rendering type, such as email, password, or text.
9977
9978 `minLength: 0`
9979
9980 - `options: array of object { id, field_ids, label }`
9981
9982 Sign-in methods. Empty for a plain form.
9983
9984 `minItems: 0`, `maxItems: 2000`
9985
9986 - `id: string`
9987
9988 The option ID to submit as selected_option.
9989
9990 `minLength: 0`
9991
9992 - `field_ids: array of string`
9993
9994 IDs from the registered fields that this method accepts.
9995
9996 `minItems: 0`, `maxItems: 2000`
9997
9998 - `label: string`
9999
10000 The method label to display.
10001
10002 `minLength: 0`
10003
10004 - `reason: string or null`
10005
10006 Why the agent needs the user to sign in.
10007
10008 `minLength: 0`
10009
10010 - `type: "browser_authentication" (default: "browser_authentication")`
10011
10012 The type of the object. Always `browser_authentication`.
10013
10014 - `"browser_authentication"`
10015
10016 - `BrowserOriginAccess object { origin, reason, type }`
10017
10018 A browser origin awaiting the application's approval decision.
10019
10020 - `origin: string`
10021
10022 The origin the browser needs permission to access.
10023
10024 `minLength: 0`
10025
10026 - `reason: string or null`
10027
10028 The browser's explanation for this request, or null when unavailable.
10029
10030 `minLength: 0`
10031
10032 - `type: "browser_origin_access" (default: "browser_origin_access")`
10033
10034 The type of the object. Always `browser_origin_access`.
10035
10036 - `"browser_origin_access"`
10037
10038 - `request_id: string`
10039
10040 The registered request ID to echo when responding.
10041
10042 `minLength: 0`
10043
10044 - `turn_id: string`
10045
10046 The turn that requested approval.
10047
10048 `minLength: 0`
10049
10050 - `type: "computer_use_approval_request" (default: "computer_use_approval_request")`
10051
10052 The type of the object. Always `computer_use_approval_request`.
10053
10054 - `"computer_use_approval_request"`
10055
10056 - `FunctionCall object { arguments, call_id, name, 2 more }`
10057
10058 Run a function tool and submit its result.
10059
10060 - `arguments: unknown`
10061
10062 The arguments supplied by the model.
10063
10064 - `call_id: string`
10065
10066 The ID to include when submitting the function result.
10067
10068 `minLength: 0`
10069
10070 - `name: string`
10071
10072 The function name.
10073
10074 `minLength: 0`
10075
10076 - `turn_id: string`
10077
10078 The ID of the turn that requested the function call.
10079
10080 `minLength: 0`
10081
10082 - `type: "function_call" (default: "function_call")`
10083
10084 The type of the object. Always `function_call`.
10085
10086 - `"function_call"`
10087
10088 - `EnvironmentConnection object { environment_id, type }`
10089
10090 Reconnect a session environment.
10091
10092 - `environment_id: string`
10093
10094 The ID of the environment to reconnect.
10095
10096 `minLength: 0`
10097
10098 - `type: "environment_connection" (default: "environment_connection")`
10099
10100 The type of the object. Always `environment_connection`.
10101
10102 - `"environment_connection"`
10103
10104 - `status: "idle" or "in_progress" or "requires_action" or 2 more`
10105
10106 The current status of the session.
10107
10108 - `"idle"`
10109
10110 The session has no turn in progress and is ready for input. A hosted environment may still be provisioning.
10111
10112 - `"in_progress"`
10113
10114 The session is processing a turn.
10115
10116 - `"requires_action"`
10117
10118 The session is waiting for one or more required actions.
10119
10120 - `"failed"`
10121
10122 The session failed.
10123
10124 - `"budget_reached"`
10125
10126 The session is paused because its spending limit was reached.
10127
10128 - `usage: TokenUsage or null`8927 - `usage: TokenUsage or null`
10129 8928
10130 Best-effort token usage for the session, or null if unknown. Recorded usage may change.8929 Best-effort token usage for the session, or null if unknown. Recorded usage may change.