Codex app
One Connect command covers the Codex app, CLI, and IDE extension. Deeper mechanics live in the Desktop reference.
anyray-connect --tools codex
This writes the Anyray provider into ~/.codex/config.toml, shared by the Codex app, CLI,
and IDE extension, so plain codex routes through the gateway:
model_provider = "anyray"
[model_providers.anyray]
name = "Anyray Gateway"
base_url = "https://gateway.example.com/v1"
wire_api = "responses"
A running app, CLI session, or IDE window keeps its old config until restarted.
anyray-connect doctor --verify
Auth follows how your seat was enrolled; there is nothing to pick in Codex:
| Enrollment | How it authenticates | Billed as |
|---|---|---|
| API key | Codex sends your personal gateway key; the gateway selects the server-held provider key. | api-key, full cost and savings, no seat fee |
| ChatGPT sign-in | Codex keeps its own ChatGPT login; the gateway passes it through (never sees your password). | subscription seat |
Codex speaks the OpenAI Responses API, so requests hit POST
/v1/responses. If a model picker omits custom-provider models, set ANYRAY_CODEX_MODEL to the
model id and rerun Connect.
Tool-output trimming
Connect installs no Codex trimming hook: Codex's PostToolUse replacement uses
decision: "block", which rejects the tool promise after the tool already ran, so a successful
shell, patch, or MCP side effect could look failed and be repeated. Apply and --revert remove
the retired hook, preserving foreign hooks. Retrieval through anyray_retrieve still works.
Codex asks for approval before every MCP tool call, and an unattended codex exec run fails the
call instead of asking. Connect pre-approves anyray_retrieve alone in config.toml, so Codex
runs it without asking; the other Anyray tools keep Codex's normal prompt.
anyray-connect doctor flags a Codex install that is missing the approval.