Codex CLI Custom API Endpoint: Choosing and Configuring a Relay
Codex CLI is OpenAI's command-line coding assistant, and plenty of developers reach it through a relay instead of official access. Of the 551 relays we currently track, 316 offer Codex-related models or a dedicated group — this article covers what to check before choosing one and how to point Codex at it.
What Codex CLI is, and why route it through a relay
Codex CLI is a terminal-based coding assistant that can read and write local code, run commands, and help debug. It calls OpenAI's model API, and going through official channels usually means needing an international payment method plus dealing with connectivity that isn't always reliable from every region. A relay strips that barrier out — pay however you already can, get a base_url and a key, add a short provider entry to your Codex config, and you're connected. That's also why, for a lot of people, a relay is their first real introduction to this whole space — they just wanted Codex CLI to work.
One thing specific to Codex
Many relays run a dedicated "Codex-only" group that's usually priced better than the general GPT group — but that group typically only recognizes requests from the official Codex CLI client (the backend checks request signatures like the User-Agent header). Cursor, Cline, and other third-party editors hitting that same group will most likely error out or get rejected outright. Ask before you buy whether the group actually supports the client you plan to use — don't find out after you've already funded your account.
Codex CLI custom model provider configuration
To send codex-cli traffic through a relay, define the relay as a custom model provider in your user-level ~/.codex/config.toml and select it with model_provider. The provider entry takes a display name, the relay's base_url, and env_key, the name of the environment variable that holds your API key.
# ~/.codex/config.toml
model = "model-name-your-relay-serves"
model_provider = "myrelay"
[model_providers.myrelay]
name = "My relay"
base_url = "https://provider-domain/v1"
env_key = "MYRELAY_API_KEY"export MYRELAY_API_KEY="your-key"Add the export line to your shell's startup script (.zshrc or .bashrc) so it persists, then open a new terminal and run something simple, like asking Codex to summarize a local file, to confirm you get a normal response. Two details from OpenAI's configuration docs are worth knowing: responses (the OpenAI Responses API) is the only supported wire_api value, so the relay has to support that API and not only the older chat-completions format; and Codex ignores model_providers in a project-level .codex/config.toml, so define the provider in your user-level file.
If you only want to repoint the built-in OpenAI provider at a proxy or router, the docs also describe a top-level openai_base_urlsetting in the same file, so you don't need to define a new provider.
For the full field-by-field reference, see theconfig.toml field guide on codexreset.ai; for installing and upgrading Codex CLI, seecodexreset.ai.
What to check before choosing one
Does it clearly label a Codex group?
Some relays call out a distinct "Codex-only" or "Codex group," meaning they've done targeted work on that channel — often only recognizing the official CLI's request signature. Not having a labeled group doesn't necessarily mean it's unsupported, but it's worth asking before you sign up.
Is the pricing transparent?
Codex-related models can vary in price by several multiples depending on the channel group. Transparent providers will tell you whether a given price is a straight official pass-through or a subscription-slicing channel, so the price difference actually makes sense.
Can they explain where the channel comes from?
Ask support or check the docs — can they clearly explain what's backing this Codex group? Vague answers that just say "stable and reliable" without explaining the source are a reason to be cautious.
Our tracked data
We currently track 551 relays, of which 316 offer Codex-related models or a dedicated group, and a separate 170 run a dedicated Claude Code group. To see directly which providers support Codex and compare their pricing and channel sources, check theGPT-5.5 price comparison pageor use the filters on the homepage.
FAQ
Some relays list Codex in their model catalog, but it doesn't work in Cursor. Why?
Some relays' dedicated Codex groups only recognize requests from the official Codex CLI client (based on signals like the User-Agent header). A third-party editor or tool hitting that same endpoint may get rejected outright. This is a limitation of the channel itself, not a misconfiguration on your end — confirm which clients a group actually supports before you buy.
What does "316 relays support Codex" on this site actually mean?
It means that of the 551 relays we track, 316 list Codex-related models or a dedicated group in their catalog or docs, based on our own data collection. The exact scope and limitations of what each one supports still depend on that provider's own documentation.
Is a Codex relay the same thing as a regular GPT relay?
The underlying interface is often shared (both are typically OpenAI-format compatible), but Codex-specific groups are usually configured or client-restricted for coding workloads specifically, which is why relays tend to list them separately — pricing and availability can differ from the general GPT group too.