◉ TOKNADO

Integrations / Codex CLI

Codex CLI + TOKNADO

How to point Codex CLI at TOKNADO (custom base URL and provider)

Codex CLI reads its settings from ~/.codex/config.toml and lets you define your own model provider with a base URL and an environment variable for the key. That is how you route Codex through an OpenAI-compatible gateway like TOKNADO.

There is one version-dependent detail worth knowing up front: Codex's wire protocol setting. We cover it below so you don't lose an hour to a mismatch.

Start free trial Jump to setup

What you need

Setup: Codex CLI with TOKNADO

  1. Export your key

    Codex reads the key from the environment variable you name in the provider block, so no secret sits in the config file.

    export TOKNADO_API_KEY=YOUR_TOKNADO_API_KEY
  2. Add a TOKNADO provider to config.toml

    Custom provider IDs can't reuse Codex's built-in IDs (openai, ollama, lmstudio), so use a distinct name such as toknado.

    # ~/.codex/config.toml
    model = "toknado/auto"
    model_provider = "toknado"
    
    [model_providers.toknado]
    name = "TOKNADO"
    base_url = "https://toknado.up.railway.app/v1"
    env_key = "TOKNADO_API_KEY"
    wire_api = "chat"
  3. Run Codex

    Start it normally, or select the provider for a single run with -c.

    codex
    
    # one-off override without editing config.toml
    codex -c model_provider="toknado" -c model="toknado/auto"
  4. Optional: keep OpenAI as default with a profile

    If you still use Codex with OpenAI, define a profile and switch with --profile instead of changing your defaults.

    codex --profile toknado

Notes for real-world use

Troubleshooting Codex CLI + TOKNADO

SymptomWhat to check
Still contacting api.openai.comA profile or project .codex/config.toml is overriding your provider. Check precedence, or pass -c model_provider="toknado".
401 unauthorizedTOKNADO_API_KEY isn't set in the shell Codex runs from. Run echo $TOKNADO_API_KEY and restart the terminal.
404 on requestsCheck base_url ends with the API path (usually /v1) and doesn't include /chat/completions.
Config error about provider IDYou used a reserved ID. Rename the provider to something like toknado.
Model not foundUse the exact model ID shown in the TOKNADO dashboard.

FAQ

Can Codex CLI use a custom base URL?

Yes. Define a provider under [model_providers.<id>] in ~/.codex/config.toml with base_url and env_key, then set model_provider to its ID.

What is env_key?

The name of the environment variable Codex reads your API key from, so the key isn't stored in the file.

Does Codex need the Responses API?

It depends on the Codex version. Gateways that implement Chat Completions are used with wire_api = "chat" where your version supports it. Verify against your installed version's docs.

How do I switch between OpenAI and TOKNADO?

Use profiles (codex --profile toknado) or the -c model_provider=... override.

Point Codex CLI at TOKNADO

One OpenAI-compatible endpoint, a managed model pool behind it, and usage you can see in the Storm Console. 3-day trial, up to 250 requests per rolling hour.

Start free trial See pricing Setup guide

Hourly limits apply over the previous 60 minutes. Service is best effort; upstream availability can reduce throughput.

More tools that work with TOKNADO