Skip to main content
Codex CLI supports custom providers through ~/.codex/config.toml. The two most common integration methods are shown below. The DimiLinks console can send a GPT key directly to CC Switch:
  1. On the API Keys page, click “Import to CC Switch” for a key with no model restriction or a restriction to GPT models.
  2. CC Switch automatically adds a Codex provider with the base URL https://dimilinks.com/v1.
  3. Before starting Codex, run cc-switch use codex to route Codex through the DimiLinks OpenAI-compatible endpoint.
See One-click import into CC Switch / Cherry Studio for the deep-link structure.

Configure ~/.codex/config.toml manually

To manage it yourself, edit ~/.codex/config.toml and add a provider:
[providers.dimilinks]
name = "DimiLinks"
base_url = "https://dimilinks.com/v1"
api_key = "sk-..."
default_model = "gpt-5.5"
Then switch to it in Codex:
codex provider use dimilinks
codex
To use DimiLinks by default, set provider = "dimilinks" at the top level of the configuration.

Switch temporarily with environment variables

export OPENAI_BASE_URL="https://dimilinks.com/v1"
export OPENAI_API_KEY="sk-..."
codex
This is useful for temporary troubleshooting or CI.
Use caseModel ID
Coding assistantgpt-5.6-terra, gpt-5.5
General chat / long contextgpt-5.5, gpt-5.6-luna
Low-cost batch tasksgpt-5.4-mini
Treat GET https://dimilinks.com/v1/models as the authoritative model catalog.

Troubleshooting

  • 401 Invalid token: Check whether shell quoting truncated api_key / OPENAI_API_KEY.
  • 404: This occurs when the base URL is set to https://dimilinks.com/ without /v1. The OpenAI-compatible endpoint requires /v1.
  • 429 rate_limit_rpm: Reduce concurrency. OPENAI_MAX_RETRIES already backs off by default, but you can increase it.
  • Keep an official OpenAI account available as well: Keep another provider in config.toml and switch with provider use when needed.