SpyBara
Go Premium Account
2026
19 Feb 2026, 20:37
14 May 2026, 21:00 14 May 2026, 07:00 13 May 2026, 00:57 12 May 2026, 01:59 11 May 2026, 18:00 7 May 2026, 20:02 7 May 2026, 17:08 5 May 2026, 23:00 2 May 2026, 06:45 2 May 2026, 00:48 1 May 2026, 18:29 30 Apr 2026, 18:36 29 Apr 2026, 12:40 29 Apr 2026, 00:50 25 Apr 2026, 06:37 25 Apr 2026, 00:42 24 Apr 2026, 18:20 24 Apr 2026, 12:28 23 Apr 2026, 18:31 23 Apr 2026, 12:28 23 Apr 2026, 00:46 22 Apr 2026, 18:29 22 Apr 2026, 00:42 21 Apr 2026, 18:29 21 Apr 2026, 12:30 21 Apr 2026, 06:45 20 Apr 2026, 18:26 20 Apr 2026, 06:53 18 Apr 2026, 18:18 17 Apr 2026, 00:44 16 Apr 2026, 18:31 16 Apr 2026, 00:46 15 Apr 2026, 18:31 15 Apr 2026, 06:44 14 Apr 2026, 18:31 14 Apr 2026, 12:29 13 Apr 2026, 18:37 13 Apr 2026, 00:44 12 Apr 2026, 06:38 10 Apr 2026, 18:23 9 Apr 2026, 00:33 8 Apr 2026, 18:32 8 Apr 2026, 00:40 7 Apr 2026, 00:40 2 Apr 2026, 18:23 31 Mar 2026, 06:35 31 Mar 2026, 00:39 28 Mar 2026, 06:26 28 Mar 2026, 00:36 27 Mar 2026, 18:23 27 Mar 2026, 00:39 26 Mar 2026, 18:27 25 Mar 2026, 18:24 23 Mar 2026, 18:22 20 Mar 2026, 00:35 18 Mar 2026, 12:23 18 Mar 2026, 00:36 17 Mar 2026, 18:24 17 Mar 2026, 00:33 16 Mar 2026, 18:25 16 Mar 2026, 12:23 14 Mar 2026, 00:32 13 Mar 2026, 18:15 13 Mar 2026, 00:34 11 Mar 2026, 00:31 9 Mar 2026, 00:34 8 Mar 2026, 18:10 8 Mar 2026, 00:35 7 Mar 2026, 18:10 7 Mar 2026, 06:14 7 Mar 2026, 00:33 6 Mar 2026, 00:38 5 Mar 2026, 18:41 5 Mar 2026, 06:22 5 Mar 2026, 00:34 4 Mar 2026, 18:18 4 Mar 2026, 06:20 3 Mar 2026, 18:20 3 Mar 2026, 00:35 27 Feb 2026, 18:15 24 Feb 2026, 06:27 24 Feb 2026, 00:33 23 Feb 2026, 18:27 21 Feb 2026, 00:33 20 Feb 2026, 12:16 19 Feb 2026, 20:53 19 Feb 2026, 20:37
2 May 2026, 00:48
14 May 2026, 21:00 14 May 2026, 07:00 13 May 2026, 00:57 12 May 2026, 01:59 11 May 2026, 18:00 7 May 2026, 20:02 7 May 2026, 17:08 5 May 2026, 23:00 2 May 2026, 06:45 2 May 2026, 00:48 1 May 2026, 18:29 30 Apr 2026, 18:36 29 Apr 2026, 12:40 29 Apr 2026, 00:50 25 Apr 2026, 06:37 25 Apr 2026, 00:42 24 Apr 2026, 18:20 24 Apr 2026, 12:28 23 Apr 2026, 18:31 23 Apr 2026, 12:28 23 Apr 2026, 00:46 22 Apr 2026, 18:29 22 Apr 2026, 00:42 21 Apr 2026, 18:29 21 Apr 2026, 12:30 21 Apr 2026, 06:45 20 Apr 2026, 18:26 20 Apr 2026, 06:53 18 Apr 2026, 18:18 17 Apr 2026, 00:44 16 Apr 2026, 18:31 16 Apr 2026, 00:46 15 Apr 2026, 18:31 15 Apr 2026, 06:44 14 Apr 2026, 18:31 14 Apr 2026, 12:29 13 Apr 2026, 18:37 13 Apr 2026, 00:44 12 Apr 2026, 06:38 10 Apr 2026, 18:23 9 Apr 2026, 00:33 8 Apr 2026, 18:32 8 Apr 2026, 00:40 7 Apr 2026, 00:40 2 Apr 2026, 18:23 31 Mar 2026, 06:35 31 Mar 2026, 00:39 28 Mar 2026, 06:26 28 Mar 2026, 00:36 27 Mar 2026, 18:23 27 Mar 2026, 00:39 26 Mar 2026, 18:27 25 Mar 2026, 18:24 23 Mar 2026, 18:22 20 Mar 2026, 00:35 18 Mar 2026, 12:23 18 Mar 2026, 00:36 17 Mar 2026, 18:24 17 Mar 2026, 00:33 16 Mar 2026, 18:25 16 Mar 2026, 12:23 14 Mar 2026, 00:32 13 Mar 2026, 18:15 13 Mar 2026, 00:34 11 Mar 2026, 00:31 9 Mar 2026, 00:34 8 Mar 2026, 18:10 8 Mar 2026, 00:35 7 Mar 2026, 18:10 7 Mar 2026, 06:14 7 Mar 2026, 00:33 6 Mar 2026, 00:38 5 Mar 2026, 18:41 5 Mar 2026, 06:22 5 Mar 2026, 00:34 4 Mar 2026, 18:18 4 Mar 2026, 06:20 3 Mar 2026, 18:20 3 Mar 2026, 00:35 27 Feb 2026, 18:15 24 Feb 2026, 06:27 24 Feb 2026, 00:33 23 Feb 2026, 18:27 21 Feb 2026, 00:33 20 Feb 2026, 12:16 19 Feb 2026, 20:53 19 Feb 2026, 20:37
Fri 1 18:29 Sat 2 00:48 Sat 2 06:45 Tue 5 23:00 Thu 7 17:08 Thu 7 20:02 Mon 11 18:00 Tue 12 01:59 Wed 13 00:57 Thu 14 07:00 Thu 14 21:00

app-server.md +554 −62

Details

1# Codex App Server1# Codex App Server

2 2 

3Embed Codex into your product with the app-server protocol

4 

5Codex app-server is the interface Codex uses to power rich clients (for example, the Codex VS Code extension). Use it when you want a deep integration inside your own product: authentication, conversation history, approvals, and streamed agent events. The app-server implementation is open source in the Codex GitHub repository ([openai/codex/codex-rs/app-server](https://github.com/openai/codex/tree/main/codex-rs/app-server)). See the [Open Source](https://developers.openai.com/codex/open-source) page for the full list of open-source Codex components.3Codex app-server is the interface Codex uses to power rich clients (for example, the Codex VS Code extension). Use it when you want a deep integration inside your own product: authentication, conversation history, approvals, and streamed agent events. The app-server implementation is open source in the Codex GitHub repository ([openai/codex/codex-rs/app-server](https://github.com/openai/codex/tree/main/codex-rs/app-server)). See the [Open Source](https://developers.openai.com/codex/open-source) page for the full list of open-source Codex components.

6 4 

7If you are automating jobs or running Codex in CI, use the5If you are automating jobs or running Codex in CI, use the


14Supported transports:12Supported transports:

15 13 

16- `stdio` (`--listen stdio://`, default): newline-delimited JSON (JSONL).14- `stdio` (`--listen stdio://`, default): newline-delimited JSON (JSONL).

17- `websocket` (`--listen ws://IP:PORT`, experimental): one JSON-RPC message per WebSocket text frame.15- `websocket` (`--listen ws://IP:PORT`, experimental and unsupported): one JSON-RPC message per WebSocket text frame.

16- `off` (`--listen off`): don't expose a local transport.

17 

18When you run with `--listen ws://IP:PORT`, the same listener also serves basic HTTP health probes:

19 

20- `GET /readyz` returns `200 OK` once the listener accepts new connections.

21- `GET /healthz` returns `200 OK` when the request doesn't include an `Origin` header.

22- Requests with an `Origin` header are rejected with `403 Forbidden`.

23 

24WebSocket transport is experimental and unsupported. Loopback listeners such as `ws://127.0.0.1:PORT` are appropriate for localhost and SSH port-forwarding workflows. Non-loopback WebSocket listeners currently allow unauthenticated connections by default during rollout, so configure WebSocket auth before exposing one remotely.

25 

26Supported WebSocket auth flags:

27 

28- `--ws-auth capability-token --ws-token-file /absolute/path`

29- `--ws-auth capability-token --ws-token-sha256 HEX`

30- `--ws-auth signed-bearer-token --ws-shared-secret-file /absolute/path`

31 

32For signed bearer tokens, you can also set `--ws-issuer`, `--ws-audience`, and `--ws-max-clock-skew-seconds`. Clients present the credential as `Authorization: Bearer <token>` during the WebSocket handshake, and app-server enforces auth before JSON-RPC `initialize`.

33 

34Prefer `--ws-token-file` over passing raw bearer tokens on the command line. Use `--ws-token-sha256` only when the client keeps the raw high-entropy token in a separate local secret store; the hash is only a verifier, and clients still need the original token.

18 35 

19In WebSocket mode, app-server uses bounded queues. When request ingress is full, the server rejects new requests with JSON-RPC error code `-32001` and message `"Server overloaded; retry later."` Clients should retry with an exponentially increasing delay and jitter.36In WebSocket mode, app-server uses bounded queues. When request ingress is full, the server rejects new requests with JSON-RPC error code `-32001` and message `"Server overloaded; retry later."` Clients should retry with an exponentially increasing delay and jitter.

20 37 


23Requests include `method`, `params`, and `id`:40Requests include `method`, `params`, and `id`:

24 41 

25```json42```json

26{ "method": "thread/start", "id": 10, "params": { "model": "gpt-5.1-codex" } }43{ "method": "thread/start", "id": 10, "params": { "model": "gpt-5.4" } }

27```44```

28 45 

29Responses echo the `id` with either `result` or `error`:46Responses echo the `id` with either `result` or `error`:


101 },118 },

102});119});

103send({ method: "initialized", params: {} });120send({ method: "initialized", params: {} });

104send({ method: "thread/start", id: 1, params: { model: "gpt-5.1-codex" } });121send({ method: "thread/start", id: 1, params: { model: "gpt-5.4" } });

105```122```

106 123 

107## Core primitives124## Core primitives


118- **Start (or resume) a thread**: Call `thread/start` for a new conversation, `thread/resume` to continue an existing one, or `thread/fork` to branch history into a new thread id.135- **Start (or resume) a thread**: Call `thread/start` for a new conversation, `thread/resume` to continue an existing one, or `thread/fork` to branch history into a new thread id.

119- **Begin a turn**: Call `turn/start` with the target `threadId` and user input. Optional fields override model, personality, `cwd`, sandbox policy, and more.136- **Begin a turn**: Call `turn/start` with the target `threadId` and user input. Optional fields override model, personality, `cwd`, sandbox policy, and more.

120- **Steer an active turn**: Call `turn/steer` to append user input to the currently in-flight turn without creating a new turn.137- **Steer an active turn**: Call `turn/steer` to append user input to the currently in-flight turn without creating a new turn.

121- **Stream events**: After `turn/start`, keep reading notifications on stdout: `item/started`, `item/completed`, `item/agentMessage/delta`, tool progress, and other updates.138- **Stream events**: After `turn/start`, keep reading notifications on stdout: `thread/archived`, `thread/unarchived`, `item/started`, `item/completed`, `item/agentMessage/delta`, tool progress, and other updates.

122- **Finish the turn**: The server emits `turn/completed` with final status when the model finishes or after a `turn/interrupt` cancellation.139- **Finish the turn**: The server emits `turn/completed` with final status when the model finishes or after a `turn/interrupt` cancellation.

123 140 

124## Initialization141## Initialization

125 142 

126Clients must send a single `initialize` request per transport connection before invoking any other method on that connection, then acknowledge with an `initialized` notification. Requests sent before initialization receive a `Not initialized` error, and repeated `initialize` calls on the same connection return `Already initialized`.143Clients must send a single `initialize` request per transport connection before invoking any other method on that connection, then acknowledge with an `initialized` notification. Requests sent before initialization receive a `Not initialized` error, and repeated `initialize` calls on the same connection return `Already initialized`.

127 144 

128The server returns the user agent string it will present to upstream services. Set `clientInfo` to identify your integration.145The server returns the user agent string it will present to upstream services plus `platformFamily` and `platformOs` values that describe the runtime target. Set `clientInfo` to identify your integration.

129 146 

130`initialize.params.capabilities` also supports per-connection notification opt-out via `optOutNotificationMethods`, which is a list of exact method names to suppress for that connection. Matching is exact (no wildcards/prefixes). Unknown method names are accepted and ignored.147`initialize.params.capabilities` also supports per-connection notification opt-out via `optOutNotificationMethods`, which is a list of exact method names to suppress for that connection. Matching is exact (no wildcards/prefixes). Unknown method names are accepted and ignored.

131 148 


161 },178 },

162 "capabilities": {179 "capabilities": {

163 "experimentalApi": true,180 "experimentalApi": true,

164 "optOutNotificationMethods": [181 "optOutNotificationMethods": ["thread/started", "item/agentMessage/delta"]

165 "codex/event/session_configured",

166 "item/agentMessage/delta"

167 ]

168 }182 }

169 }183 }

170}184}


203- `thread/start` - create a new thread; emits `thread/started` and automatically subscribes you to turn/item events for that thread.217- `thread/start` - create a new thread; emits `thread/started` and automatically subscribes you to turn/item events for that thread.

204- `thread/resume` - reopen an existing thread by id so later `turn/start` calls append to it.218- `thread/resume` - reopen an existing thread by id so later `turn/start` calls append to it.

205- `thread/fork` - fork a thread into a new thread id by copying stored history; emits `thread/started` for the new thread.219- `thread/fork` - fork a thread into a new thread id by copying stored history; emits `thread/started` for the new thread.

206- `thread/read` - read a stored thread by id without resuming it; set `includeTurns` to return full turn history.220- `thread/read` - read a stored thread by id without resuming it; set `includeTurns` to return full turn history. Returned `thread` objects include runtime `status`.

207- `thread/list` - page through stored thread logs; supports cursor-based pagination plus `modelProviders`, `sourceKinds`, `archived`, and `cwd` filters.221- `thread/list` - page through stored thread logs; supports cursor-based pagination plus `modelProviders`, `sourceKinds`, `archived`, `cwd`, and `searchTerm` filters. Returned `thread` objects include runtime `status`.

222- `thread/turns/list` - page through a stored thread's turn history without resuming it.

208- `thread/loaded/list` - list the thread ids currently loaded in memory.223- `thread/loaded/list` - list the thread ids currently loaded in memory.

209- `thread/archive` - move a threads log file into the archived directory; returns `{}` on success.224- `thread/name/set` - set or update a thread's user-facing name for a loaded thread or a persisted rollout; emits `thread/name/updated`.

210- `thread/unarchive` - restore an archived thread rollout back into the active sessions directory; returns the restored `thread`.225- `thread/goal/set` - set the goal for a loaded thread (experimental; requires `capabilities.experimentalApi`); emits `thread/goal/updated`.

226- `thread/goal/get` - read the current goal for a loaded thread (experimental; requires `capabilities.experimentalApi`).

227- `thread/goal/clear` - clear the goal for a loaded thread (experimental; requires `capabilities.experimentalApi`); emits `thread/goal/cleared`.

228- `thread/metadata/update` - patch SQLite-backed stored thread metadata; currently supports persisted `gitInfo`.

229- `thread/archive` - move a thread's log file into the archived directory; returns `{}` on success and emits `thread/archived`.

230- `thread/unsubscribe` - unsubscribe this connection from thread turn/item events. If this was the last subscriber, the server unloads the thread after a no-subscriber inactivity grace period and emits `thread/closed`.

231- `thread/unarchive` - restore an archived thread rollout back into the active sessions directory; returns the restored `thread` and emits `thread/unarchived`.

232- `thread/status/changed` - notification emitted when a loaded thread's runtime `status` changes.

211- `thread/compact/start` - trigger conversation history compaction for a thread; returns `{}` immediately while progress streams via `turn/*` and `item/*` notifications.233- `thread/compact/start` - trigger conversation history compaction for a thread; returns `{}` immediately while progress streams via `turn/*` and `item/*` notifications.

234- `thread/shellCommand` - run a user-initiated shell command against a thread. This runs outside the sandbox with full access and doesn't inherit the thread sandbox policy.

235- `thread/backgroundTerminals/clean` - stop all running background terminals for a thread (experimental; requires `capabilities.experimentalApi`).

212- `thread/rollback` - drop the last N turns from the in-memory context and persist a rollback marker; returns the updated `thread`.236- `thread/rollback` - drop the last N turns from the in-memory context and persist a rollback marker; returns the updated `thread`.

213- `turn/start` - add user input to a thread and begin Codex generation; responds with the initial `turn` and streams events. For `collaborationMode`, `settings.developer_instructions: null` means "use built-in instructions for the selected mode."237- `turn/start` - add user input to a thread and begin Codex generation; responds with the initial `turn` and streams events. For `collaborationMode`, `settings.developer_instructions: null` means "use built-in instructions for the selected mode."

238- `thread/inject_items` - append raw Responses API items to a loaded thread's model-visible history without starting a user turn.

214- `turn/steer` - append user input to the active in-flight turn for a thread; returns the accepted `turnId`.239- `turn/steer` - append user input to the active in-flight turn for a thread; returns the accepted `turnId`.

215- `turn/interrupt` - request cancellation of an in-flight turn; success is `{}` and the turn ends with `status: "interrupted"`.240- `turn/interrupt` - request cancellation of an in-flight turn; success is `{}` and the turn ends with `status: "interrupted"`.

216- `review/start` - kick off the Codex reviewer for a thread; emits `enteredReviewMode` and `exitedReviewMode` items.241- `review/start` - kick off the Codex reviewer for a thread; emits `enteredReviewMode` and `exitedReviewMode` items.

217- `command/exec` - run a single command under the server sandbox without starting a thread/turn.242- `command/exec` - run a single command under the server sandbox without starting a thread/turn.

243- `command/exec/write` - write `stdin` bytes to a running `command/exec` session or close `stdin`.

244- `command/exec/resize` - resize a running PTY-backed `command/exec` session.

245- `command/exec/terminate` - stop a running `command/exec` session.

246- `command/exec/outputDelta` (notify) - emitted for base64-encoded stdout/stderr chunks from a streaming `command/exec` session.

218- `model/list` - list available models (set `includeHidden: true` to include entries with `hidden: true`) with effort options, optional `upgrade`, and `inputModalities`.247- `model/list` - list available models (set `includeHidden: true` to include entries with `hidden: true`) with effort options, optional `upgrade`, and `inputModalities`.

248- `modelProvider/capabilities/read` - read provider capability bounds for model/provider combinations (experimental; requires `capabilities.experimentalApi`).

219- `experimentalFeature/list` - list feature flags with lifecycle stage metadata and cursor pagination.249- `experimentalFeature/list` - list feature flags with lifecycle stage metadata and cursor pagination.

250- `experimentalFeature/enablement/set` - patch in-memory runtime enablement for supported feature keys such as `apps` and `plugins`.

220- `collaborationMode/list` - list collaboration mode presets (experimental, no pagination).251- `collaborationMode/list` - list collaboration mode presets (experimental, no pagination).

221- `skills/list` - list skills for one or more `cwd` values (supports `forceReload` and optional `perCwdExtraUserRoots`).252- `skills/list` - list skills for one or more `cwd` values (supports `forceReload` and optional `perCwdExtraUserRoots`).

253- `skills/changed` (notify) - emitted when watched local skill files change.

254- `marketplace/add` - add a remote plugin marketplace and persist it into the user's marketplace config.

255- `marketplace/upgrade` - refresh a configured Git marketplace, or all configured Git marketplaces when you omit the marketplace name.

256- `plugin/list` - list discovered plugin marketplaces and plugin state, including install/auth policy metadata, marketplace load errors, featured plugin ids, and local, Git, or remote plugin source metadata.

257- `plugin/read` - read one plugin by marketplace path or remote marketplace name and plugin name, including bundled skills, apps, and MCP server names when those details are available.

258- `plugin/install` - install a plugin from a marketplace path or remote marketplace name.

259- `plugin/uninstall` - uninstall an installed plugin.

222- `app/list` - list available apps (connectors) with pagination plus accessibility/enabled metadata.260- `app/list` - list available apps (connectors) with pagination plus accessibility/enabled metadata.

223- `skills/config/write` - enable or disable skills by path.261- `skills/config/write` - enable or disable skills by path.

224- `mcpServer/oauth/login` - start an OAuth login for a configured MCP server; returns an authorization URL and emits `mcpServer/oauthLogin/completed` on completion.262- `mcpServer/oauth/login` - start an OAuth login for a configured MCP server; returns an authorization URL and emits `mcpServer/oauthLogin/completed` on completion.

225- `tool/requestUserInput` - prompt the user with 1-3 short questions for a tool call (experimental); questions can set `isOther` for a free-form option.263- `tool/requestUserInput` - prompt the user with 1-3 short questions for a tool call (experimental); questions can set `isOther` for a free-form option.

226- `config/mcpServer/reload` - reload MCP server configuration from disk and queue a refresh for loaded threads.264- `config/mcpServer/reload` - reload MCP server configuration from disk and queue a refresh for loaded threads.

227- `mcpServerStatus/list` - list MCP servers, tools, resources, and auth status (cursor + limit pagination).265- `mcpServerStatus/list` - list MCP servers, tools, resources, and auth status (cursor + limit pagination). Use `detail: "full"` for full data or `detail: "toolsAndAuthOnly"` to omit resources.

228- `feedback/upload` - submit a feedback report (classification + optional reason/logs + conversation id).266- `mcpServer/resource/read` - read a single MCP resource through an initialized MCP server.

267- `mcpServer/tool/call` - call a tool on a thread's configured MCP server.

268- `mcpServer/startupStatus/updated` (notify) - emitted when a configured MCP server's startup status changes for a loaded thread.

269- `windowsSandbox/setupStart` - start Windows sandbox setup for `elevated` or `unelevated` mode; returns quickly and later emits `windowsSandbox/setupCompleted`.

270- `feedback/upload` - submit a feedback report (classification + optional reason/logs + conversation id, plus optional `extraLogFiles` attachments).

229- `config/read` - fetch the effective configuration on disk after resolving configuration layering.271- `config/read` - fetch the effective configuration on disk after resolving configuration layering.

272- `externalAgentConfig/detect` - detect external-agent artifacts that can be migrated with `includeHome` and optional `cwds`; each detected item includes `cwd` (`null` for home).

273- `externalAgentConfig/import` - apply selected external-agent migration items by passing explicit `migrationItems` with `cwd` (`null` for home). Supported item types include config, skills, `AGENTS.md`, plugins, MCP server config, subagents, hooks, commands, and sessions; plugin imports emit `externalAgentConfig/import/completed`.

230- `config/value/write` - write a single configuration key/value to the user's `config.toml` on disk.274- `config/value/write` - write a single configuration key/value to the user's `config.toml` on disk.

231- `config/batchWrite` - apply configuration edits atomically to the user's `config.toml` on disk.275- `config/batchWrite` - apply configuration edits atomically to the user's `config.toml` on disk.

232- `configRequirements/read` - fetch requirements from `requirements.toml` and/or MDM, including allow-lists and residency requirements (or `null` if you havent set any up).276- `configRequirements/read` - fetch requirements from `requirements.toml` and/or MDM, including allow-lists, pinned `featureRequirements`, and residency/network requirements (or `null` if you haven't set any up).

277- `fs/readFile`, `fs/writeFile`, `fs/createDirectory`, `fs/getMetadata`, `fs/readDirectory`, `fs/remove`, `fs/copy`, `fs/watch`, `fs/unwatch`, and `fs/changed` (notify) - operate on absolute filesystem paths through the app-server v2 filesystem API.

278 

279Plugin summaries include a `source` union. Local plugins return

280`{ "type": "local", "path": ... }`, Git-backed marketplace entries return

281`{ "type": "git", "url": ..., "path": ..., "refName": ..., "sha": ... }`,

282and remote catalog entries return `{ "type": "remote" }`. For remote-only

283catalog entries, `PluginMarketplaceEntry.path` can be `null`; pass

284`remoteMarketplaceName` instead of `marketplacePath` when reading or installing

285those plugins.

233 286 

234## Models287## Models

235 288 


241{ "method": "model/list", "id": 6, "params": { "limit": 20, "includeHidden": false } }294{ "method": "model/list", "id": 6, "params": { "limit": 20, "includeHidden": false } }

242{ "id": 6, "result": {295{ "id": 6, "result": {

243 "data": [{296 "data": [{

244 "id": "gpt-5.2-codex",297 "id": "gpt-5.4",

245 "model": "gpt-5.2-codex",298 "model": "gpt-5.4",

246 "upgrade": "gpt-5.3-codex",299 "displayName": "GPT-5.4",

247 "displayName": "GPT-5.2 Codex",

248 "hidden": false,300 "hidden": false,

249 "defaultReasoningEffort": "medium",301 "defaultReasoningEffort": "medium",

250 "reasoningEffort": [{302 "supportedReasoningEfforts": [{

251 "effort": "low",303 "reasoningEffort": "low",

252 "description": "Lower latency"304 "description": "Lower latency"

253 }],305 }],

254 "inputModalities": ["text", "image"],306 "inputModalities": ["text", "image"],


261 313 

262Each model entry can include:314Each model entry can include:

263 315 

264- `reasoningEffort` - supported effort options for the model.316- `supportedReasoningEfforts` - supported effort options for the model.

265- `defaultReasoningEffort` - suggested default effort for clients.317- `defaultReasoningEffort` - suggested default effort for clients.

266- `upgrade` - optional recommended upgrade model id for migration prompts in clients.318- `upgrade` - optional recommended upgrade model id for migration prompts in clients.

319- `upgradeInfo` - optional upgrade metadata for migration prompts in clients.

267- `hidden` - whether the model is hidden from the default picker list.320- `hidden` - whether the model is hidden from the default picker list.

268- `inputModalities` - supported input types for the model (for example `text`, `image`).321- `inputModalities` - supported input types for the model (for example `text`, `image`).

269- `supportsPersonality` - whether the model supports personality-specific instructions such as `/personality`.322- `supportsPersonality` - whether the model supports personality-specific instructions such as `/personality`.


298## Threads351## Threads

299 352 

300- `thread/read` reads a stored thread without subscribing to it; set `includeTurns` to include turns.353- `thread/read` reads a stored thread without subscribing to it; set `includeTurns` to include turns.

301- `thread/list` supports cursor pagination plus `modelProviders`, `sourceKinds`, `archived`, and `cwd` filtering.354- `thread/turns/list` pages through a stored thread's turn history without resuming it.

355- `thread/list` supports cursor pagination plus `modelProviders`, `sourceKinds`, `archived`, `cwd`, and `searchTerm` filtering.

302- `thread/loaded/list` returns the thread IDs currently in memory.356- `thread/loaded/list` returns the thread IDs currently in memory.

303- `thread/archive` moves the thread's persisted JSONL log into the archived directory.357- `thread/archive` moves the thread's persisted JSONL log into the archived directory.

358- `thread/metadata/update` patches stored thread metadata, currently including persisted `gitInfo`.

359- `thread/unsubscribe` unsubscribes the current connection from a loaded thread and can trigger `thread/closed` after an inactivity grace period.

304- `thread/unarchive` restores an archived thread rollout back into the active sessions directory.360- `thread/unarchive` restores an archived thread rollout back into the active sessions directory.

305- `thread/compact/start` triggers compaction and returns `{}` immediately.361- `thread/compact/start` triggers compaction and returns `{}` immediately.

306- `thread/rollback` drops the last N turns from the in-memory context and records a rollback marker in the thread's persisted JSONL log.362- `thread/rollback` drops the last N turns from the in-memory context and records a rollback marker in the thread's persisted JSONL log.

363- `thread/inject_items` appends raw Responses API items to a loaded thread's model-visible history without starting a user turn.

307 364 

308### Start or resume a thread365### Start or resume a thread

309 366 


311 368 

312```json369```json

313{ "method": "thread/start", "id": 10, "params": {370{ "method": "thread/start", "id": 10, "params": {

314 "model": "gpt-5.1-codex",371 "model": "gpt-5.4",

315 "cwd": "/Users/me/project",372 "cwd": "/Users/me/project",

316 "approvalPolicy": "never",373 "approvalPolicy": "never",

317 "sandbox": "workspaceWrite",374 "sandbox": "workspaceWrite",

318 "personality": "friendly"375 "personality": "friendly",

376 "serviceName": "my_app_server_client"

319} }377} }

320{ "id": 10, "result": {378{ "id": 10, "result": {

321 "thread": {379 "thread": {

322 "id": "thr_123",380 "id": "thr_123",

323 "preview": "",381 "preview": "",

382 "ephemeral": false,

324 "modelProvider": "openai",383 "modelProvider": "openai",

325 "createdAt": 1730910000384 "createdAt": 1730910000

326 }385 }


328{ "method": "thread/started", "params": { "thread": { "id": "thr_123" } } }387{ "method": "thread/started", "params": { "thread": { "id": "thr_123" } } }

329```388```

330 389 

390`serviceName` is optional. Set it when you want app-server to tag thread-level metrics with your integration's service name.

391 

331To continue a stored session, call `thread/resume` with the `thread.id` you recorded earlier. The response shape matches `thread/start`. You can also pass the same configuration overrides supported by `thread/start`, such as `personality`:392To continue a stored session, call `thread/resume` with the `thread.id` you recorded earlier. The response shape matches `thread/start`. You can also pass the same configuration overrides supported by `thread/start`, such as `personality`:

332 393 

333```json394```json


335 "threadId": "thr_123",396 "threadId": "thr_123",

336 "personality": "friendly"397 "personality": "friendly"

337} }398} }

338{ "id": 11, "result": { "thread": { "id": "thr_123" } } }399{ "id": 11, "result": { "thread": { "id": "thr_123", "name": "Bug bash notes", "ephemeral": false } } }

339```400```

340 401 

341Resuming a thread doesn't update `thread.updatedAt` (or the rollout file's modified time) by itself. The timestamp updates when you start a turn.402Resuming a thread doesn't update `thread.updatedAt` (or the rollout file's modified time) by itself. The timestamp updates when you start a turn.


354{ "method": "thread/started", "params": { "thread": { "id": "thr_456" } } }415{ "method": "thread/started", "params": { "thread": { "id": "thr_456" } } }

355```416```

356 417 

418When a user-facing thread title has been set, app-server hydrates `thread.name` on `thread/list`, `thread/read`, `thread/resume`, `thread/unarchive`, and `thread/rollback` responses. `thread/start` and `thread/fork` may omit `name` (or return `null`) until a title is set later.

419 

357### Read a stored thread (without resuming)420### Read a stored thread (without resuming)

358 421 

359Use `thread/read` when you want stored thread data but don't want to resume the thread or subscribe to its events.422Use `thread/read` when you want stored thread data but don't want to resume the thread or subscribe to its events.

360 423 

361- `includeTurns` - when `true`, the response includes the thread's turns; when `false` or omitted, you get the thread summary only.424- `includeTurns` - when `true`, the response includes the thread's turns; when `false` or omitted, you get the thread summary only.

425- Returned `thread` objects include runtime `status` (`notLoaded`, `idle`, `systemError`, or `active` with `activeFlags`).

362 426 

363```json427```json

364{ "method": "thread/read", "id": 19, "params": { "threadId": "thr_123", "includeTurns": true } }428{ "method": "thread/read", "id": 19, "params": { "threadId": "thr_123", "includeTurns": true } }

365{ "id": 19, "result": { "thread": { "id": "thr_123", "turns": [] } } }429{ "id": 19, "result": { "thread": { "id": "thr_123", "name": "Bug bash notes", "ephemeral": false, "status": { "type": "notLoaded" }, "turns": [] } } }

366```430```

367 431 

368Unlike `thread/resume`, `thread/read` doesn't load the thread into memory or emit `thread/started`.432Unlike `thread/resume`, `thread/read` doesn't load the thread into memory or emit `thread/started`.

369 433 

434### List thread turns

435 

436Use `thread/turns/list` to page a stored thread's turn history without resuming it. Results default to newest-first so clients can fetch older turns with `nextCursor`. The response also includes `backwardsCursor`; pass it as `cursor` with `sortDirection: "asc"` to fetch turns newer than the first item from the earlier page.

437 

438```json

439{ "method": "thread/turns/list", "id": 20, "params": {

440 "threadId": "thr_123",

441 "limit": 50,

442 "sortDirection": "desc"

443} }

444{ "id": 20, "result": {

445 "data": [],

446 "nextCursor": "older-turns-cursor-or-null",

447 "backwardsCursor": "newer-turns-cursor-or-null"

448} }

449```

450 

370### List threads (with pagination & filters)451### List threads (with pagination & filters)

371 452 

372`thread/list` lets you render a history UI. Results default to newest-first by `createdAt`. Filters apply before pagination. Pass any combination of:453`thread/list` lets you render a history UI. Results default to newest-first by `createdAt`. Filters apply before pagination. Pass any combination of:


378- `sourceKinds` - restrict results to specific thread sources. When omitted or `[]`, the server defaults to interactive sources only: `cli` and `vscode`.459- `sourceKinds` - restrict results to specific thread sources. When omitted or `[]`, the server defaults to interactive sources only: `cli` and `vscode`.

379- `archived` - when `true`, list archived threads only. When `false` or omitted, list non-archived threads (default).460- `archived` - when `true`, list archived threads only. When `false` or omitted, list non-archived threads (default).

380- `cwd` - restrict results to threads whose session current working directory exactly matches this path.461- `cwd` - restrict results to threads whose session current working directory exactly matches this path.

462- `searchTerm` - search stored thread summaries and metadata before pagination.

381 463 

382`sourceKinds` accepts the following values:464`sourceKinds` accepts the following values:

383 465 


402} }484} }

403{ "id": 20, "result": {485{ "id": 20, "result": {

404 "data": [486 "data": [

405 { "id": "thr_a", "preview": "Create a TUI", "modelProvider": "openai", "createdAt": 1730831111, "updatedAt": 1730831111 },487 { "id": "thr_a", "preview": "Create a TUI", "ephemeral": false, "modelProvider": "openai", "createdAt": 1730831111, "updatedAt": 1730831111, "name": "TUI prototype", "status": { "type": "notLoaded" } },

406 { "id": "thr_b", "preview": "Fix tests", "modelProvider": "openai", "createdAt": 1730750000, "updatedAt": 1730750000 }488 { "id": "thr_b", "preview": "Fix tests", "ephemeral": true, "modelProvider": "openai", "createdAt": 1730750000, "updatedAt": 1730750000, "status": { "type": "notLoaded" } }

407 ],489 ],

408 "nextCursor": "opaque-token-or-null"490 "nextCursor": "opaque-token-or-null"

409} }491} }


411 493 

412When `nextCursor` is `null`, you have reached the final page.494When `nextCursor` is `null`, you have reached the final page.

413 495 

496### Update stored thread metadata

497 

498Use `thread/metadata/update` to patch stored thread metadata without resuming the thread. Today this supports persisted `gitInfo`; omitted fields are left unchanged, and explicit `null` clears a stored value.

499 

500```json

501{ "method": "thread/metadata/update", "id": 21, "params": {

502 "threadId": "thr_123",

503 "gitInfo": { "branch": "feature/sidebar-pr" }

504} }

505{ "id": 21, "result": {

506 "thread": {

507 "id": "thr_123",

508 "gitInfo": { "sha": null, "branch": "feature/sidebar-pr", "originUrl": null }

509 }

510} }

511```

512 

513### Track thread status changes

514 

515`thread/status/changed` is emitted whenever a loaded thread's runtime status changes. The payload includes `threadId` and the new `status`.

516 

517```json

518{

519 "method": "thread/status/changed",

520 "params": {

521 "threadId": "thr_123",

522 "status": { "type": "active", "activeFlags": ["waitingOnApproval"] }

523 }

524}

525```

526 

414### List loaded threads527### List loaded threads

415 528 

416`thread/loaded/list` returns thread IDs currently loaded in memory.529`thread/loaded/list` returns thread IDs currently loaded in memory.


420{ "id": 21, "result": { "data": ["thr_123", "thr_456"] } }533{ "id": 21, "result": { "data": ["thr_123", "thr_456"] } }

421```534```

422 535 

536### Unsubscribe from a loaded thread

537 

538`thread/unsubscribe` removes the current connection's subscription to a thread. The response status is one of:

539 

540- `unsubscribed` when the connection was subscribed and is now removed.

541- `notSubscribed` when the connection wasn't subscribed to that thread.

542- `notLoaded` when the thread isn't loaded.

543 

544If this was the last subscriber, the server keeps the thread loaded until it has no subscribers and no thread activity for 30 minutes. When the grace period expires, app-server unloads the thread and emits a `thread/status/changed` transition to `notLoaded` plus `thread/closed`.

545 

546```json

547{ "method": "thread/unsubscribe", "id": 22, "params": { "threadId": "thr_123" } }

548{ "id": 22, "result": { "status": "unsubscribed" } }

549```

550 

551If the thread later expires:

552 

553```json

554{ "method": "thread/status/changed", "params": {

555 "threadId": "thr_123",

556 "status": { "type": "notLoaded" }

557} }

558{ "method": "thread/closed", "params": { "threadId": "thr_123" } }

559```

560 

423### Archive a thread561### Archive a thread

424 562 

425Use `thread/archive` to move the persisted thread log (stored as a JSONL file on disk) into the archived sessions directory.563Use `thread/archive` to move the persisted thread log (stored as a JSONL file on disk) into the archived sessions directory.


427```json565```json

428{ "method": "thread/archive", "id": 22, "params": { "threadId": "thr_b" } }566{ "method": "thread/archive", "id": 22, "params": { "threadId": "thr_b" } }

429{ "id": 22, "result": {} }567{ "id": 22, "result": {} }

568{ "method": "thread/archived", "params": { "threadId": "thr_b" } }

430```569```

431 570 

432Archived threads won't appear in future calls to `thread/list` unless you pass `archived: true`.571Archived threads won't appear in future calls to `thread/list` unless you pass `archived: true`.


437 576 

438```json577```json

439{ "method": "thread/unarchive", "id": 24, "params": { "threadId": "thr_b" } }578{ "method": "thread/unarchive", "id": 24, "params": { "threadId": "thr_b" } }

440{ "id": 24, "result": { "thread": { "id": "thr_b" } } }579{ "id": 24, "result": { "thread": { "id": "thr_b", "name": "Bug bash notes" } } }

580{ "method": "thread/unarchived", "params": { "threadId": "thr_b" } }

441```581```

442 582 

443### Trigger thread compaction583### Trigger thread compaction


451{ "id": 25, "result": {} }591{ "id": 25, "result": {} }

452```592```

453 593 

594### Run a thread shell command

595 

596Use `thread/shellCommand` for user-initiated shell commands that belong to a thread. The request returns immediately with `{}` while progress streams through standard `turn/*` and `item/*` notifications.

597 

598This API runs outside the sandbox with full access and doesn't inherit the thread sandbox policy. Clients should expose it only for explicit user-initiated commands.

599 

600If the thread already has an active turn, the command runs as an auxiliary action on that turn and its formatted output is injected into the turn's message stream. If the thread is idle, app-server starts a standalone turn for the shell command.

601 

602```json

603{ "method": "thread/shellCommand", "id": 26, "params": { "threadId": "thr_b", "command": "git status --short" } }

604{ "id": 26, "result": {} }

605```

606 

607### Clean background terminals

608 

609Use `thread/backgroundTerminals/clean` to stop all running background terminals associated with a thread. This method is experimental and requires `capabilities.experimentalApi = true`.

610 

611```json

612{ "method": "thread/backgroundTerminals/clean", "id": 27, "params": { "threadId": "thr_b" } }

613{ "id": 27, "result": {} }

614```

615 

616### Roll back recent turns

617 

618Use `thread/rollback` to remove the last `numTurns` entries from the in-memory context and persist a rollback marker in the rollout log. The returned `thread` includes `turns` populated after the rollback.

619 

620```json

621{ "method": "thread/rollback", "id": 28, "params": { "threadId": "thr_b", "numTurns": 1 } }

622{ "id": 28, "result": { "thread": { "id": "thr_b", "name": "Bug bash notes", "ephemeral": false } } }

623```

624 

454## Turns625## Turns

455 626 

456The `input` field accepts a list of items:627The `input` field accepts a list of items:


480}651}

481```652```

482 653 

654On macOS, `includePlatformDefaults: true` appends a curated platform-default Seatbelt policy for restricted-read sessions. This improves tool compatibility without broadly allowing all of `/System`.

655 

483Examples:656Examples:

484 657 

485```json658```json


512 "writableRoots": ["/Users/me/project"],685 "writableRoots": ["/Users/me/project"],

513 "networkAccess": true686 "networkAccess": true

514 },687 },

515 "model": "gpt-5.1-codex",688 "model": "gpt-5.4",

516 "effort": "medium",689 "effort": "medium",

517 "summary": "concise",690 "summary": "concise",

518 "personality": "friendly",691 "personality": "friendly",


526{ "id": 30, "result": { "turn": { "id": "turn_456", "status": "inProgress", "items": [], "error": null } } }699{ "id": 30, "result": { "turn": { "id": "turn_456", "status": "inProgress", "items": [], "error": null } } }

527```700```

528 701 

702### Inject items into a thread

703 

704Use `thread/inject_items` to append prebuilt Responses API items to a loaded thread's prompt history without starting a user turn. These items are persisted to the rollout and included in subsequent model requests.

705 

706```json

707{ "method": "thread/inject_items", "id": 31, "params": {

708 "threadId": "thr_123",

709 "items": [

710 {

711 "type": "message",

712 "role": "assistant",

713 "content": [{ "type": "output_text", "text": "Previously computed context." }]

714 }

715 ]

716} }

717{ "id": 31, "result": {} }

718```

719 

529### Steer an active turn720### Steer an active turn

530 721 

531Use `turn/steer` to append more user input to the active in-flight turn.722Use `turn/steer` to append more user input to the active in-flight turn.


655- The server rejects empty `command` arrays.846- The server rejects empty `command` arrays.

656- `sandboxPolicy` accepts the same shape used by `turn/start` (for example, `dangerFullAccess`, `readOnly`, `workspaceWrite`, `externalSandbox`).847- `sandboxPolicy` accepts the same shape used by `turn/start` (for example, `dangerFullAccess`, `readOnly`, `workspaceWrite`, `externalSandbox`).

657- When omitted, `timeoutMs` falls back to the server default.848- When omitted, `timeoutMs` falls back to the server default.

849- Set `tty: true` for PTY-backed sessions, and use `processId` when you plan to follow up with `command/exec/write`, `command/exec/resize`, or `command/exec/terminate`.

850- Set `streamStdoutStderr: true` to receive `command/exec/outputDelta` notifications while the command is running.

851 

852### Read admin requirements (`configRequirements/read`)

853 

854Use `configRequirements/read` to inspect the effective admin requirements loaded from `requirements.toml` and/or MDM.

855 

856```json

857{ "method": "configRequirements/read", "id": 52, "params": {} }

858{ "id": 52, "result": {

859 "requirements": {

860 "allowedApprovalPolicies": ["onRequest", "unlessTrusted"],

861 "allowedSandboxModes": ["readOnly", "workspaceWrite"],

862 "featureRequirements": {

863 "personality": true,

864 "unified_exec": false

865 },

866 "network": {

867 "enabled": true,

868 "allowedDomains": ["api.openai.com"],

869 "allowUnixSockets": ["/tmp/example.sock"],

870 "dangerouslyAllowAllUnixSockets": false

871 }

872 }

873} }

874```

875 

876`result.requirements` is `null` when no requirements are configured. See the docs on [`requirements.toml`](https://developers.openai.com/codex/config-reference#requirementstoml) for details on supported keys and values.

877 

878### Windows sandbox setup (`windowsSandbox/setupStart`)

879 

880Custom Windows clients can trigger sandbox setup asynchronously instead of blocking on startup checks.

881 

882```json

883{ "method": "windowsSandbox/setupStart", "id": 53, "params": { "mode": "elevated" } }

884{ "id": 53, "result": { "started": true } }

885```

886 

887App-server starts setup in the background and later emits a completion notification:

888 

889```json

890{

891 "method": "windowsSandbox/setupCompleted",

892 "params": { "mode": "elevated", "success": true, "error": null }

893}

894```

895 

896Modes:

897 

898- `elevated` - run the elevated Windows sandbox setup path.

899- `unelevated` - run the legacy setup/preflight path.

900 

901## Filesystem

902 

903The v2 filesystem APIs operate on absolute paths. Use `fs/watch` when a client needs to invalidate UI state after a file or directory changes.

904 

905```json

906{ "method": "fs/watch", "id": 54, "params": {

907 "watchId": "0195ec6b-1d6f-7c2e-8c7a-56f2c4a8b9d1",

908 "path": "/Users/me/project/.git/HEAD"

909} }

910{ "id": 54, "result": { "path": "/Users/me/project/.git/HEAD" } }

911{ "method": "fs/changed", "params": {

912 "watchId": "0195ec6b-1d6f-7c2e-8c7a-56f2c4a8b9d1",

913 "changedPaths": ["/Users/me/project/.git/HEAD"]

914} }

915{ "method": "fs/unwatch", "id": 55, "params": {

916 "watchId": "0195ec6b-1d6f-7c2e-8c7a-56f2c4a8b9d1"

917} }

918{ "id": 55, "result": {} }

919```

920 

921Watching a file emits `fs/changed` for that file path, including updates delivered by replace or rename operations.

658 922 

659## Events923## Events

660 924 

661Event notifications are the server-initiated stream for thread lifecycles, turn lifecycles, and the items within them. After you start or resume a thread, keep reading the active transport stream for `thread/started`, `turn/*`, and `item/*` notifications.925Event notifications are the server-initiated stream for thread lifecycles, turn lifecycles, and the items within them. After you start or resume a thread, keep reading the active transport stream for `thread/started`, `thread/archived`, `thread/unarchived`, `thread/closed`, `thread/status/changed`, `turn/*`, `item/*`, and `serverRequest/resolved` notifications.

662 926 

663### Notification opt-out927### Notification opt-out

664 928 


666 930 

667- Exact-match only: `item/agentMessage/delta` suppresses only that method.931- Exact-match only: `item/agentMessage/delta` suppresses only that method.

668- Unknown method names are ignored.932- Unknown method names are ignored.

669- Applies to both legacy (`codex/event/*`) and v2 (`thread/*`, `turn/*`, `item/*`, etc.) notifications.933- Applies to the current `thread/*`, `turn/*`, `item/*`, and related v2 notifications.

670- Doesn't apply to requests, responses, or errors.934- Doesn't apply to requests, responses, or errors.

671 935 

672### Fuzzy file search events (experimental)936### Fuzzy file search events (experimental)


676- `fuzzyFileSearch/sessionUpdated` - `{ sessionId, query, files }` with the current matches for the active query.940- `fuzzyFileSearch/sessionUpdated` - `{ sessionId, query, files }` with the current matches for the active query.

677- `fuzzyFileSearch/sessionCompleted` - `{ sessionId }` once indexing and matching for that query completes.941- `fuzzyFileSearch/sessionCompleted` - `{ sessionId }` once indexing and matching for that query completes.

678 942 

943### Windows sandbox setup events

944 

945- `windowsSandbox/setupCompleted` - `{ mode, success, error }` emitted after a `windowsSandbox/setupStart` request finishes.

946 

679### Turn events947### Turn events

680 948 

681- `turn/started` - `{ turn }` with the turn id, empty `items`, and `status: "inProgress"`.949- `turn/started` - `{ turn }` with the turn id, empty `items`, and `status: "inProgress"`.


691`ThreadItem` is the tagged union carried in turn responses and `item/*` notifications. Common item types include:959`ThreadItem` is the tagged union carried in turn responses and `item/*` notifications. Common item types include:

692 960 

693- `userMessage` - `{id, content}` where `content` is a list of user inputs (`text`, `image`, or `localImage`).961- `userMessage` - `{id, content}` where `content` is a list of user inputs (`text`, `image`, or `localImage`).

694- `agentMessage` - `{id, text}` containing the accumulated agent reply.962- `agentMessage` - `{id, text, phase?}` containing the accumulated agent reply. When present, `phase` uses Responses API wire values (`commentary`, `final_answer`).

695- `plan` - `{id, text}` containing proposed plan text in plan mode. Treat the final `plan` item from `item/completed` as authoritative.963- `plan` - `{id, text}` containing proposed plan text in plan mode. Treat the final `plan` item from `item/completed` as authoritative.

696- `reasoning` - `{id, summary, content}` where `summary` holds streamed reasoning summaries and `content` holds raw reasoning blocks.964- `reasoning` - `{id, summary, content}` where `summary` holds streamed reasoning summaries and `content` holds raw reasoning blocks.

697- `commandExecution` - `{id, command, cwd, status, commandActions, aggregatedOutput?, exitCode?, durationMs?}`.965- `commandExecution` - `{id, command, cwd, status, commandActions, aggregatedOutput?, exitCode?, durationMs?}`.

698- `fileChange` - `{id, changes, status}` describing proposed edits; `changes` list `{path, kind, diff}`.966- `fileChange` - `{id, changes, status}` describing proposed edits; `changes` list `{path, kind, diff}`.

699- `mcpToolCall` - `{id, server, tool, status, arguments, result?, error?}`.967- `mcpToolCall` - `{id, server, tool, status, arguments, result?, error?}`.

968- `dynamicToolCall` - `{id, tool, arguments, status, contentItems?, success?, durationMs?}` for client-executed dynamic tool invocations.

700- `collabToolCall` - `{id, tool, status, senderThreadId, receiverThreadId?, newThreadId?, prompt?, agentStatus?}`.969- `collabToolCall` - `{id, tool, status, senderThreadId, receiverThreadId?, newThreadId?, prompt?, agentStatus?}`.

701- `webSearch` - `{id, query, action?}` for web search requests issued by the agent.970- `webSearch` - `{id, query, action?}` for web search requests issued by the agent.

702- `imageView` - `{id, path}` emitted when the agent invokes the image viewer tool.971- `imageView` - `{id, path}` emitted when the agent invokes the image viewer tool.


753Order of messages:1022Order of messages:

754 1023 

7551. `item/started` shows the pending `commandExecution` item with `command`, `cwd`, and other fields.10241. `item/started` shows the pending `commandExecution` item with `command`, `cwd`, and other fields.

7562. `item/commandExecution/requestApproval` includes `itemId`, `threadId`, `turnId`, optional `reason`, optional `command`, optional `cwd`, optional `commandActions`, and optional `proposedExecpolicyAmendment`.10252. `item/commandExecution/requestApproval` includes `itemId`, `threadId`, `turnId`, optional `reason`, optional `command`, optional `cwd`, optional `commandActions`, optional `proposedExecpolicyAmendment`, optional `networkApprovalContext`, and optional `availableDecisions`. When `initialize.params.capabilities.experimentalApi = true`, the payload can also include experimental `additionalPermissions` describing requested per-command sandbox access. Any filesystem paths inside `additionalPermissions` are absolute on the wire.

7573. Client responds with one of the command execution approval decisions above.10263. Client responds with one of the command execution approval decisions above.

7584. `item/completed` returns the final `commandExecution` item with `status: completed | failed | declined`.10274. `serverRequest/resolved` confirms that the pending request has been answered or cleared.

10285. `item/completed` returns the final `commandExecution` item with `status: completed | failed | declined`.

1029 

1030When `networkApprovalContext` is present, the prompt is for managed network access (not a general shell-command approval). The current v2 schema exposes the target `host` and `protocol`; clients should render a network-specific prompt and not rely on `command` being a user-meaningful shell command preview.

1031 

1032Codex groups concurrent network approval prompts by destination (`host`, protocol, and port). The app-server may therefore send one prompt that unblocks multiple queued requests to the same destination, while different ports on the same host are treated separately.

759 1033 

760### File change approvals1034### File change approvals

761 1035 


7641. `item/started` emits a `fileChange` item with proposed `changes` and `status: "inProgress"`.10381. `item/started` emits a `fileChange` item with proposed `changes` and `status: "inProgress"`.

7652. `item/fileChange/requestApproval` includes `itemId`, `threadId`, `turnId`, optional `reason`, and optional `grantRoot`.10392. `item/fileChange/requestApproval` includes `itemId`, `threadId`, `turnId`, optional `reason`, and optional `grantRoot`.

7663. Client responds with one of the file change approval decisions above.10403. Client responds with one of the file change approval decisions above.

7674. `item/completed` returns the final `fileChange` item with `status: completed | failed | declined`.10414. `serverRequest/resolved` confirms that the pending request has been answered or cleared.

10425. `item/completed` returns the final `fileChange` item with `status: completed | failed | declined`.

1043 

1044### `tool/requestUserInput`

1045 

1046When the client responds to `item/tool/requestUserInput`, app-server emits `serverRequest/resolved` with `{ threadId, requestId }`. If the pending request is cleared by turn start, turn completion, or turn interruption before the client answers, the server emits the same notification for that cleanup.

1047 

1048### Dynamic tool calls (experimental)

1049 

1050`dynamicTools` on `thread/start` and the corresponding `item/tool/call` request or response flow are experimental APIs.

1051 

1052When a dynamic tool is invoked during a turn, app-server emits:

1053 

10541. `item/started` with `item.type = "dynamicToolCall"`, `status = "inProgress"`, plus `tool` and `arguments`.

10552. `item/tool/call` as a server request to the client.

10563. The client response payload with returned content items.

10574. `item/completed` with `item.type = "dynamicToolCall"`, the final `status`, and any returned `contentItems` or `success` value.

768 1058 

769### MCP tool-call approvals (apps)1059### MCP tool-call approvals (apps)

770 1060 

771App (connector) tool calls can also require approval. When an app tool call has side effects, the server may elicit approval with `tool/requestUserInput` and options such as **Accept**, **Decline**, and **Cancel**. If the user declines or cancels, the related `mcpToolCall` item completes with an error instead of running the tool.1061App (connector) tool calls can also require approval. When an app tool call has side effects, the server may elicit approval with `tool/requestUserInput` and options such as **Accept**, **Decline**, and **Cancel**. Destructive tool annotations always trigger approval even when the tool also advertises less-privileged hints. If the user declines or cancels, the related `mcpToolCall` item completes with an error instead of running the tool.

772 1062 

773## Skills1063## Skills

774 1064 


850} }1140} }

851```1141```

852 1142 

1143The server also emits `skills/changed` notifications when watched local skill files change. Treat this as an invalidation signal and rerun `skills/list` with your current params when needed.

1144 

853To enable or disable a skill by path:1145To enable or disable a skill by path:

854 1146 

855```json1147```json


865 1157 

866## Apps (connectors)1158## Apps (connectors)

867 1159 

868Use `app/list` to fetch available apps. In the CLI/TUI, `/apps` is the user-facing picker; in custom clients, call `app/list` directly. Each entry includes both `isAccessible` (available to the user) and `isEnabled` (enabled in `config.toml`) so clients can distinguish install/access from local enabled state.1160Use `app/list` to fetch available apps. In the CLI/TUI, `/apps` is the user-facing picker; in custom clients, call `app/list` directly. Each entry includes both `isAccessible` (available to the user) and `isEnabled` (enabled in `config.toml`) so clients can distinguish install/access from local enabled state. App entries can also include optional `branding`, `appMetadata`, and `labels` fields.

869 1161 

870```json1162```json

871{ "method": "app/list", "id": 50, "params": {1163{ "method": "app/list", "id": 50, "params": {


881 "name": "Demo App",1173 "name": "Demo App",

882 "description": "Example connector for documentation.",1174 "description": "Example connector for documentation.",

883 "logoUrl": "https://example.com/demo-app.png",1175 "logoUrl": "https://example.com/demo-app.png",

1176 "logoUrlDark": null,

1177 "distributionChannel": null,

1178 "branding": null,

1179 "appMetadata": null,

1180 "labels": null,

884 "installUrl": "https://chatgpt.com/apps/demo-app/demo-app",1181 "installUrl": "https://chatgpt.com/apps/demo-app/demo-app",

885 "isAccessible": true,1182 "isAccessible": true,

886 "isEnabled": true1183 "isEnabled": true


906 "name": "Demo App",1203 "name": "Demo App",

907 "description": "Example connector for documentation.",1204 "description": "Example connector for documentation.",

908 "logoUrl": "https://example.com/demo-app.png",1205 "logoUrl": "https://example.com/demo-app.png",

1206 "logoUrlDark": null,

1207 "distributionChannel": null,

1208 "branding": null,

1209 "appMetadata": null,

1210 "labels": null,

909 "installUrl": "https://chatgpt.com/apps/demo-app/demo-app",1211 "installUrl": "https://chatgpt.com/apps/demo-app/demo-app",

910 "isAccessible": true,1212 "isAccessible": true,

911 "isEnabled": true1213 "isEnabled": true


938}1240}

939```1241```

940 1242 

1243### Config RPC examples for app settings

1244 

1245Use `config/read`, `config/value/write`, and `config/batchWrite` to inspect or update app controls in `config.toml`.

1246 

1247Read the effective app config shape (including `_default` and per-tool overrides):

1248 

1249```json

1250{ "method": "config/read", "id": 60, "params": { "includeLayers": false } }

1251{ "id": 60, "result": {

1252 "config": {

1253 "apps": {

1254 "_default": {

1255 "enabled": true,

1256 "destructive_enabled": true,

1257 "open_world_enabled": true

1258 },

1259 "google_drive": {

1260 "enabled": true,

1261 "destructive_enabled": false,

1262 "default_tools_approval_mode": "prompt",

1263 "tools": {

1264 "files/delete": { "enabled": false, "approval_mode": "approve" }

1265 }

1266 }

1267 }

1268 }

1269} }

1270```

1271 

1272Update a single app setting:

1273 

1274```json

1275{

1276 "method": "config/value/write",

1277 "id": 61,

1278 "params": {

1279 "keyPath": "apps.google_drive.default_tools_approval_mode",

1280 "value": "prompt",

1281 "mergeStrategy": "replace"

1282 }

1283}

1284```

1285 

1286Apply multiple app edits atomically:

1287 

1288```json

1289{

1290 "method": "config/batchWrite",

1291 "id": 62,

1292 "params": {

1293 "edits": [

1294 {

1295 "keyPath": "apps._default.destructive_enabled",

1296 "value": false,

1297 "mergeStrategy": "upsert"

1298 },

1299 {

1300 "keyPath": "apps.google_drive.tools.files/delete.approval_mode",

1301 "value": "approve",

1302 "mergeStrategy": "upsert"

1303 }

1304 ]

1305 }

1306}

1307```

1308 

1309### Detect and import external agent config

1310 

1311Use `externalAgentConfig/detect` to discover external-agent artifacts that can be migrated, then pass the selected entries to `externalAgentConfig/import`.

1312 

1313Detection example:

1314 

1315```json

1316{ "method": "externalAgentConfig/detect", "id": 63, "params": {

1317 "includeHome": true,

1318 "cwds": ["/Users/me/project"]

1319} }

1320{ "id": 63, "result": {

1321 "items": [

1322 {

1323 "itemType": "AGENTS_MD",

1324 "description": "Import /Users/me/project/CLAUDE.md to /Users/me/project/AGENTS.md.",

1325 "cwd": "/Users/me/project"

1326 },

1327 {

1328 "itemType": "SKILLS",

1329 "description": "Copy skill folders from /Users/me/.claude/skills to /Users/me/.agents/skills.",

1330 "cwd": null

1331 }

1332 ]

1333} }

1334```

1335 

1336Import example:

1337 

1338```json

1339{ "method": "externalAgentConfig/import", "id": 64, "params": {

1340 "migrationItems": [

1341 {

1342 "itemType": "AGENTS_MD",

1343 "description": "Import /Users/me/project/CLAUDE.md to /Users/me/project/AGENTS.md.",

1344 "cwd": "/Users/me/project"

1345 }

1346 ]

1347} }

1348{ "id": 64, "result": {} }

1349```

1350 

1351When a request includes plugin imports, the server emits `externalAgentConfig/import/completed` after the import finishes. This notification may arrive immediately after the response or after background remote imports complete.

1352 

1353Supported `itemType` values are `AGENTS_MD`, `CONFIG`, `SKILLS`, `PLUGINS`,

1354and `MCP_SERVER_CONFIG`. For `PLUGINS` items, `details.plugins` lists each

1355`marketplaceName` and the `pluginNames` Codex can try to migrate. Detection

1356returns only items that still have work to do. For example, Codex skips AGENTS

1357migration when `AGENTS.md` already exists and is non-empty, and skill imports

1358don't overwrite existing skill directories.

1359 

1360When detecting plugins from `.claude/settings.json`, Codex reads configured

1361marketplace sources from `extraKnownMarketplaces`. If `enabledPlugins` contains

1362plugins from `claude-plugins-official` but the marketplace source is missing,

1363Codex infers `anthropics/claude-plugins-official` as the source.

1364 

941## Auth endpoints1365## Auth endpoints

942 1366 

943The JSON-RPC auth/account surface exposes request/response methods plus server-initiated notifications (no `id`). Use these to determine auth state, start or cancel logins, logout, and inspect ChatGPT rate limits.1367The JSON-RPC auth/account surface exposes request/response methods plus server-initiated notifications (no `id`). Use these to determine auth state, start or cancel logins, logout, inspect ChatGPT rate limits, and notify workspace owners about depleted credits or usage limits.

944 1368 

945### Authentication modes1369### Authentication modes

946 1370 

947Codex supports three authentication modes. `account/updated.authMode` shows the active mode, and `account/read` also reports it.1371Codex supports these authentication modes. `account/updated.authMode` shows the active mode and includes the current ChatGPT `planType` when available. `account/read` also reports account and plan details.

948 1372 

949- **API key (`apikey`)** - the caller supplies an OpenAI API key and Codex stores it for API requests.1373- **API key (`apikey`)** - the caller supplies an OpenAI API key with `type: "apiKey"`, and Codex stores it for API requests.

950- **ChatGPT managed (`chatgpt`)** - Codex owns the ChatGPT OAuth flow, persists tokens, and refreshes them automatically.1374- **ChatGPT managed (`chatgpt`)** - Codex owns the ChatGPT OAuth flow, persists tokens, and refreshes them automatically. Start with `type: "chatgpt"` for the browser flow or `type: "chatgptDeviceCode"` for the device-code flow.

951- **ChatGPT external tokens (`chatgptAuthTokens`)** - a host app supplies `idToken` and `accessToken` directly. Codex stores these tokens in memory, and the host app must refresh them when asked.1375- **ChatGPT external tokens (`chatgptAuthTokens`)** - experimental and intended for host apps that already own the user's ChatGPT auth lifecycle. The host app supplies an `accessToken`, `chatgptAccountId`, and optional `chatgptPlanType` directly, and must refresh the token when asked.

952 1376 

953### API overview1377### API overview

954 1378 

955- `account/read` - fetch current account info; optionally refresh tokens.1379- `account/read` - fetch current account info; optionally refresh tokens.

956- `account/login/start` - begin login (`apiKey`, `chatgpt`, or `chatgptAuthTokens`).1380- `account/login/start` - begin login (`apiKey`, `chatgpt`, `chatgptDeviceCode`, or experimental `chatgptAuthTokens`).

957- `account/login/completed` (notify) - emitted when a login attempt finishes (success or error).1381- `account/login/completed` (notify) - emitted when a login attempt finishes (success or error).

958- `account/login/cancel` - cancel a pending ChatGPT login by `loginId`.1382- `account/login/cancel` - cancel a pending managed ChatGPT login by `loginId`.

959- `account/logout` - sign out; triggers `account/updated`.1383- `account/logout` - sign out; triggers `account/updated`.

960- `account/updated` (notify) - emitted whenever auth mode changes (`authMode`: `apikey`, `chatgpt`, `chatgptAuthTokens`, or `null`).1384- `account/updated` (notify) - emitted whenever auth mode changes (`authMode`: `apikey`, `chatgpt`, `chatgptAuthTokens`, or `null`) and includes `planType` when available.

961- `account/chatgptAuthTokens/refresh` (server request) - request fresh externally managed ChatGPT tokens after an authorization error.1385- `account/chatgptAuthTokens/refresh` (server request) - request fresh externally managed ChatGPT tokens after an authorization error.

962- `account/rateLimits/read` - fetch ChatGPT rate limits.1386- `account/rateLimits/read` - fetch ChatGPT rate limits.

963- `account/rateLimits/updated` (notify) - emitted whenever a user's ChatGPT rate limits change.1387- `account/rateLimits/updated` (notify) - emitted whenever a user's ChatGPT rate limits change.

1388- `account/sendAddCreditsNudgeEmail` - ask ChatGPT to email a workspace owner about depleted credits or a reached usage limit.

964- `mcpServer/oauthLogin/completed` (notify) - emitted after a `mcpServer/oauth/login` flow finishes; payload includes `{ name, success, error? }`.1389- `mcpServer/oauthLogin/completed` (notify) - emitted after a `mcpServer/oauth/login` flow finishes; payload includes `{ name, success, error? }`.

1390- `mcpServer/startupStatus/updated` (notify) - emitted when a configured MCP server's startup status changes for a loaded thread; payload includes `{ name, status, error }`.

965 1391 

966### 1) Check auth state1392### 1) Check auth state

967 1393 


1033 ```1459 ```

1034 1460 

1035 ```json1461 ```json

1036 { "method": "account/updated", "params": { "authMode": "apikey" } }1462 {

1463 "method": "account/updated",

1464 "params": { "authMode": "apikey", "planType": null }

1465 }

1037 ```1466 ```

1038 1467 

1039### 3) Log in with ChatGPT (browser flow)1468### 3) Log in with ChatGPT (browser flow)


1065 ```1494 ```

1066 1495 

1067 ```json1496 ```json

1068 { "method": "account/updated", "params": { "authMode": "chatgpt" } }1497 {

1498 "method": "account/updated",

1499 "params": { "authMode": "chatgpt", "planType": "plus" }

1500 }

1069 ```1501 ```

1070 1502 

1071### 3b) Log in with externally managed ChatGPT tokens (`chatgptAuthTokens`)1503### 3b) Log in with ChatGPT (device-code flow)

1072 1504 

1073Use this mode when a host application owns the user’s ChatGPT auth lifecycle and supplies tokens directly.1505Use this flow when your client owns the sign-in ceremony or when a browser callback is brittle.

1506 

15071. Start:

1508 

1509 ```json

1510 {

1511 "method": "account/login/start",

1512 "id": 4,

1513 "params": { "type": "chatgptDeviceCode" }

1514 }

1515 ```

1516 

1517 ```json

1518 {

1519 "id": 4,

1520 "result": {

1521 "type": "chatgptDeviceCode",

1522 "loginId": "<uuid>",

1523 "verificationUrl": "https://auth.openai.com/codex/device",

1524 "userCode": "ABCD-1234"

1525 }

1526 }

1527 ```

15282. Show `verificationUrl` and `userCode` to the user; the frontend owns the UX.

15293. Wait for notifications:

1530 

1531 ```json

1532 {

1533 "method": "account/login/completed",

1534 "params": { "loginId": "<uuid>", "success": true, "error": null }

1535 }

1536 ```

1537 

1538 ```json

1539 {

1540 "method": "account/updated",

1541 "params": { "authMode": "chatgpt", "planType": "plus" }

1542 }

1543 ```

1544 

1545### 3c) Log in with externally managed ChatGPT tokens (`chatgptAuthTokens`)

1546 

1547Use this experimental mode only when a host application owns the user's ChatGPT auth lifecycle and supplies tokens directly. Clients must set `capabilities.experimentalApi = true` during `initialize` before using this login type.

1074 1548 

10751. Send:15491. Send:

1076 1550 


1080 "id": 7,1554 "id": 7,

1081 "params": {1555 "params": {

1082 "type": "chatgptAuthTokens",1556 "type": "chatgptAuthTokens",

1083 "idToken": "<jwt>",1557 "accessToken": "<jwt>",

1084 "accessToken": "<jwt>"1558 "chatgptAccountId": "org-123",

1559 "chatgptPlanType": "business"

1085 }1560 }

1086 }1561 }

1087 ```1562 ```


1102 ```json1577 ```json

1103 {1578 {

1104 "method": "account/updated",1579 "method": "account/updated",

1105 "params": { "authMode": "chatgptAuthTokens" }1580 "params": { "authMode": "chatgptAuthTokens", "planType": "business" }

1106 }1581 }

1107 ```1582 ```

1108 1583 


1114 "id": 8,1589 "id": 8,

1115 "params": { "reason": "unauthorized", "previousAccountId": "org-123" }1590 "params": { "reason": "unauthorized", "previousAccountId": "org-123" }

1116}1591}

1117{ "id": 8, "result": { "idToken": "<jwt>", "accessToken": "<jwt>" } }1592{ "id": 8, "result": { "accessToken": "<jwt>", "chatgptAccountId": "org-123", "chatgptPlanType": "business" } }

1118```1593```

1119 1594 

1120The server retries the original request after a successful refresh response. Requests time out after about 10 seconds.1595The server retries the original request after a successful refresh response. Requests time out after about 10 seconds.


1131```json1606```json

1132{ "method": "account/logout", "id": 5 }1607{ "method": "account/logout", "id": 5 }

1133{ "id": 5, "result": {} }1608{ "id": 5, "result": {} }

1134{ "method": "account/updated", "params": { "authMode": null } }1609{ "method": "account/updated", "params": { "authMode": null, "planType": null } }

1135```1610```

1136 1611 

1137### 6) Rate limits (ChatGPT)1612### 6) Rate limits (ChatGPT)


1143 "limitId": "codex",1618 "limitId": "codex",

1144 "limitName": null,1619 "limitName": null,

1145 "primary": { "usedPercent": 25, "windowDurationMins": 15, "resetsAt": 1730947200 },1620 "primary": { "usedPercent": 25, "windowDurationMins": 15, "resetsAt": 1730947200 },

1146 "secondary": null1621 "secondary": null,

1622 "rateLimitReachedType": null

1147 },1623 },

1148 "rateLimitsByLimitId": {1624 "rateLimitsByLimitId": {

1149 "codex": {1625 "codex": {

1150 "limitId": "codex",1626 "limitId": "codex",

1151 "limitName": null,1627 "limitName": null,

1152 "primary": { "usedPercent": 25, "windowDurationMins": 15, "resetsAt": 1730947200 },1628 "primary": { "usedPercent": 25, "windowDurationMins": 15, "resetsAt": 1730947200 },

1153 "secondary": null1629 "secondary": null,

1630 "rateLimitReachedType": null

1154 },1631 },

1155 "codex_other": {1632 "codex_other": {

1156 "limitId": "codex_other",1633 "limitId": "codex_other",

1157 "limitName": "codex_other",1634 "limitName": "codex_other",

1158 "primary": { "usedPercent": 42, "windowDurationMins": 60, "resetsAt": 1730950800 },1635 "primary": { "usedPercent": 42, "windowDurationMins": 60, "resetsAt": 1730950800 },

1159 "secondary": null1636 "secondary": null,

1637 "rateLimitReachedType": null

1160 }1638 }

1161 }1639 }

1162} }1640} }


1177- `usedPercent` is current usage within the quota window.1655- `usedPercent` is current usage within the quota window.

1178- `windowDurationMins` is the quota window length.1656- `windowDurationMins` is the quota window length.

1179- `resetsAt` is a Unix timestamp (seconds) for the next reset.1657- `resetsAt` is a Unix timestamp (seconds) for the next reset.

1658- `planType` is included when the backend returns the ChatGPT plan associated with a bucket.

1659- `credits` is included when the backend returns remaining workspace credit details.

1660- `rateLimitReachedType` identifies the backend-classified limit state when one has been reached.

1661 

1662### 7) Notify a workspace owner about a limit

1663 

1664Use `account/sendAddCreditsNudgeEmail` to ask ChatGPT to email a workspace owner when credits are depleted or a usage limit has been reached.

1665 

1666```json

1667{ "method": "account/sendAddCreditsNudgeEmail", "id": 7, "params": { "creditType": "credits" } }

1668{ "id": 7, "result": { "status": "sent" } }

1669```

1670 

1671Use `creditType: "credits"` when workspace credits are depleted, or `creditType: "usage_limit"` when the workspace usage limit has been reached. If the owner was already notified recently, the response status is `cooldown_active`.