Codex

Use the OpenAI Codex CLI with Tokener.ai as a custom model provider.

Updated 2026-08-22
Edit on GitHub

The Codex CLI speaks the OpenAI Responses API. Tokener.ai serves that API at POST /responses, so Codex runs against Tokener.ai with your API key and any chat model from the Models catalog.

Configure

Add the provider to ~/.codex/config.toml and make it the default:

TOML
model = "<model-id>"
model_provider = "tokener"
 
[model_providers.tokener]
name = "Tokener.ai"
base_url = "https://api.tokener.dev/v1"
env_key = "TOKENER_API_KEY"
wire_api = "responses"

Set TOKENER_API_KEY to a key created in API keys:

Shell
export TOKENER_API_KEY=sk-...

To keep your current default provider and use Tokener.ai for a single run, drop the two top-level lines and select the provider on the command line:

Shell
codex --config model_provider=tokener --config model=<model-id>

Models

Set any chat model id from the Models catalog. Launchers using Codex command authentication can load the API key's model list from Gateway.

Codex requests bill against your organization's credits like any other traffic on the model API.