Token Supply

Setup guide

Use Codex with a custom API endpoint

Yes. Codex works with Token Supply. Keep the Codex CLI, app, or VS Code extension you already use. Point the provider at Token Supply, set a plan key, and keep the Responses API.

~/.codex/config.toml · ~/.codex/auth.json

Create account Open docs

Four files and a restart

  1. Create a plan key

    Register, add credit, and create an OpenAI-plan key. Copy ts_live_... once.

  2. Edit config.toml

    Set model_provider, model, reasoning effort, and a Token Supply provider block.

  3. Add auth.json

    Store the Token Supply key as OPENAI_API_KEY.

  4. Restart Codex

    Select the configured model. A short test request should appear in Usage.

Who this is for

Codex CLI, Codex App, and VS Code extension users who already run an OpenAI-plan key and want the Responses API left intact.

What you need

Use a key from an OpenAI plan. The model name in the example must belong to that plan.

This setup works for Codex CLI, Codex App, and the Codex VS Code extension.

  • Base URL: https://api.token-supply.com
  • wire_api must be responses. Do not use chat.
  • disable_response_storage and store: false. Codex should not persist Responses on the provider.

Edit config.toml

Open ~/.codex/config.toml. On Windows, open %USERPROFILE%\.codex\config.toml.

Keep the normal Codex provider setup and change the values to Token Supply. Do not put the provider block in a project .codex/config.toml; Codex ignores provider settings there.

~/.codex/config.toml
model_provider = "token_supply"
model = "gpt-5.6-sol"
model_reasoning_effort = "high"
model_reasoning_summary = "auto"
model_context_window = 1050000
disable_response_storage = true
supports_websockets = false

[model_providers.token_supply]
name = "Token Supply"
base_url = "https://api.token-supply.com"
wire_api = "responses"
requires_openai_auth = true
supports_websockets = false

[features]
goals = true

Why this works: wire_api stays responses, so Codex keeps the API it already calls.

  • On Windows, use %USERPROFILE%\.codex for both files.
  • wire_api must be responses. Do not use chat.
  • model_reasoning_effort accepts minimal, low, medium, high, or xhigh for the example model. gpt-6.1-sol accepts low, medium, high, xhigh, or max, and does not accept none or minimal.
  • GPT-6.1 Sol, GPT-6 Sol, GPT-6 Luna, GPT-5.6 Sol, and GPT-5.5 use a 1,050,000 token context window.
  • gpt-6.1-terra is also an OpenAI-plan id. The example model stays gpt-5.6-sol. Its rates are not the rates for other models.

Add the key

Open ~/.codex/auth.json and use your Token Supply key as the OpenAI key.

~/.codex/auth.json
{
  "OPENAI_API_KEY": "ts_live_..."
}

Why this works: The key lives in auth.json, separate from the provider block.

Verify

Restart Codex and select gpt-5.6-sol, or another OpenAI id such as gpt-6.1-sol, gpt-6-sol, gpt-6-luna, or gpt-6.1-terra, on that key's plan. Send a short prompt, then open Usage in Token Supply.

If you want a lower listed rate on the same Codex workflow, compare models in the savings calculator before you change the config.

Open the savings calculator · Reduce coding-agent API costs

Details

Does Codex work with Token Supply?
Yes. Codex CLI, Codex App, and VS Code extension users who already run an OpenAI-plan key and want the Responses API left intact.
Why responses instead of chat?
Codex uses the Responses API. wire_api must be responses or the client will call the wrong path.
Can I keep my current Codex model name?
Use a model included in the Token Supply plan on that key. The name in the snippet is an example.
Where do I put the key on Windows?
Both config.toml and auth.json live under %USERPROFILE%\.codex.

Related