~/.codex/config.toml. The two most common integration methods are shown below.
One-click import (recommended)
The DimiLinks console can send a GPT key directly to CC Switch:- On the API Keys page, click “Import to CC Switch” for a key with no model restriction or a restriction to GPT models.
- CC Switch automatically adds a
Codexprovider with the base URLhttps://dimilinks.com/v1. - Before starting Codex, run
cc-switch use codexto route Codex through the DimiLinks OpenAI-compatible endpoint.
Configure ~/.codex/config.toml manually
To manage it yourself, edit ~/.codex/config.toml and add a provider:
provider = "dimilinks" at the top level of the configuration.
Switch temporarily with environment variables
Recommended models
| Use case | Model ID |
|---|---|
| Coding assistant | gpt-5.6-terra, gpt-5.5 |
| General chat / long context | gpt-5.5, gpt-5.6-luna |
| Low-cost batch tasks | gpt-5.4-mini |
GET https://dimilinks.com/v1/models as the authoritative model catalog.
Troubleshooting
401 Invalid token: Check whether shell quoting truncatedapi_key/OPENAI_API_KEY.404: This occurs when the base URL is set tohttps://dimilinks.com/without/v1. The OpenAI-compatible endpoint requires/v1.429 rate_limit_rpm: Reduce concurrency.OPENAI_MAX_RETRIESalready backs off by default, but you can increase it.- Keep an official OpenAI account available as well: Keep another provider in
config.tomland switch withprovider usewhen needed.