Skip to content

Codex subscription

Have a ChatGPT Plus or Pro plan? Use it as a model source through the Codex backend. routeplane providers login openai-codex runs the same OAuth flow OpenAI’s Codex CLI uses, stores the refreshing token, and attaches it to requests on the openai-codex provider — so your ChatGPT subscription covers the tokens, with no OPENAI_API_KEY.

**`openai-codex` is not `openai`.** This is a separate provider. It reaches ChatGPT's Codex backend (`chatgpt.com/backend-api/codex`), speaks the **Responses API only**, and is authenticated solely by your subscription's OAuth — it does *not* share endpoints or credentials with the standard `openai` (API-key) provider. For pay-per-token access to the public OpenAI API, use the `openai` provider with a key instead.
Terminal window
routeplane providers login openai-codex

This opens OpenAI’s authorize page in your browser (PKCE, on a pinned loopback port), and on approval stores the credential under $XDG_DATA_HOME/routeplane/oauth-tokens.json. The token auto-refreshes — log in once. To remove it:

Terminal window
routeplane providers logout openai-codex
**Already signed in to Codex?** The login menu offers **"Import an existing session from the vendor CLI"** — Routeplane adopts the credential the Codex CLI already stored (macOS Keychain or `$CODEX_HOME/auth.json`), with no fresh browser sign-in. The imported token refreshes like any other.

Credentials are keyed by (provider, label). Use --label to keep more than one account:

Terminal window
routeplane providers login openai-codex --label work

No routeplane.yaml block is required — openai-codex is built in, and the stored credential is found at request time. Address a model your plan exposes by its registry id:

Terminal window
routeplane route openai-codex:gpt-5-codex

Then start Routeplane and send a request. Use the provider-qualified id openai-codex:<model> to pin the request to your subscription; see Models for the exact ids the Codex backend serves.

  • Codex — point the Codex CLI at Routeplane (a harness), distinct from using your plan as a model source here.
  • Model fallback — fail over from your subscription to another source on overload.