DurinDoor
Providers

Codex App-Server

Route requests through a local codex app-server over WebSocket. Unverified and experimental.

Codex App-Server (codex-app-server, alias cxa) drives one turn per request against a codex app-server process you run yourself. The Codex CLI owns its own sign-in (~/.codex/auth.json). DurinDoor itself never reads or replays that token; its only credential is the WebSocket capability token you give it. See Isolation below for what the app-server process itself can reach.

This provider is unverified. No live account run backs it. Treat every claim here as the documented protocol, not tested behavior.

Read this first

  • OpenAI documents the WebSocket transport as experimental and unsupported. The app-server interface itself is documented at learn.chatgpt.com/docs/app-server. OpenAI's guidance for automation is the Codex SDK. The protocol can change without notice.
  • It re-serves a ChatGPT subscription through the gateway. Every client of this DurinDoor instance spends the quota of whichever account the Codex CLI is signed in to. Do not expose it to people who should not use that account, and check OpenAI's terms for your plan before you do.

The existing OpenAI Codex provider is separate and still replays an OAuth token to the Responses API.

Set up

Start the app-server on a private network, with a capability token, and never publish its port:

codex app-server --listen ws://127.0.0.1:1456 --ws-auth capability-token --ws-token-file ~/.codex-appserver-token

Then configure DurinDoor through the environment. Connection rows cannot set these values, so stored data cannot redirect the token.

VariableMeaning
DURINDOOR_CODEX_APPSERVER_WSws:// or wss:// URL, without embedded credentials. Required. A ws:// URL must point at a loopback host unless the opt-in below is set.
DURINDOOR_CODEX_APPSERVER_ALLOW_INSECURE_WStrue, 1 or yes allows a cleartext ws:// URL to a non-loopback host. Prefer wss://.
DURINDOOR_CODEX_APPSERVER_WS_TOKENCapability token.
DURINDOOR_CODEX_APPSERVER_WS_TOKEN_FILEFile holding the token, used when the variable above is unset.
DURINDOOR_CODEX_APPSERVER_CWDWorking directory for thread/start. Default /tmp.
DURINDOOR_CODEX_APPSERVER_APPROVALApproval policy. Default on-request; codex's own prompts are denied unless auto-approve is set.
DURINDOOR_CODEX_APPSERVER_SANDBOXSandbox mode. Default read-only. workspace-write and other wider modes need an explicit value. Read-only still lets codex read files the app-server user can read.
DURINDOOR_CODEX_APPSERVER_TURN_TIMEOUT_MSOverall limit for one turn. Default 600000.
DURINDOOR_CODEX_APPSERVER_AUTO_APPROVEtrue, 1 or yes approves codex's own command and file-change prompts. Permission-grant prompts are always declined. Default is to deny them all.

Add the provider once under Providers so a connection row exists; it needs no key. With no URL or token set, requests fail with HTTP 503 codex_app_server_unconfigured.

Isolation

Anyone who can call this gateway can start turns on that app-server, and even a read-only sandbox lets codex read files that the app-server's OS user can read. That includes the Codex CLI's own sign-in file, so a gateway caller could ask codex to show it. Run the app-server as a dedicated OS user (or in its own container) whose only credential is the codex login it needs, and which has no access to the DurinDoor data directory, its database, or other local credential files. Do not share the instance with people who should not hold that account. Treat workspace-write, never approvals and auto-approve as deliberate choices for a trusted setup.

What it does

  • Request format is chat completions. History is flattened into one text turn. Images are not sent.
  • Models are the text models of the codex provider. A -none, -low, -medium, -high or -xhigh suffix sets the reasoning effort; otherwise reasoning_effort from the request is used.
  • Reasoning deltas arrive as reasoning_content. Token usage comes from the turn/completed notification when present.
  • Request tools are advertised as dynamic tools, which is an experimental app-server field. When codex calls one, DurinDoor returns it as a tool_calls finish. Your client runs the tool and sends the result in the next request.
  • Connection and turn errors arrive as an in-band error event, with the capability token removed.

Not verified

No live app-server, account, model list, tool round trip, usage accounting or error shape has been run against this provider. Tests use a mocked WebSocket. Version drift in the app-server protocol, the item/tool/call request and the usage field names is untested.

On this page

Edit on GitHub