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 configure the environment variables.

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, change two environment variables, 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.

How to configure it

Codex CLI reads its connection details from two environment variables. Set them, then reopen your terminal or source your config file to apply them.

export OPENAI_BASE_URL="https://provider-domain/v1"
export OPENAI_API_KEY="your-key"

Once set, run something simple — like asking it to read and summarize a local file — to confirm you're getting a normal response, which means the config is live. To make it permanent, add the export lines to your shell's startup script (.zshrc or .bashrc); it takes effect the next time you open a new terminal window or restart your shell.

What to check before choosing one

1

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.

2

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.

3

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.

GPT-5.5 pricingHow to connect and useChannel types explainedBrowse all relays