OpenAI Codex CLI integration
Use DeepSeek in OpenAI Codex CLI with Tokuse
Codex CLI supports custom OpenAI-compatible providers. Use wire_api = "chat" with Tokuse. The responses endpoint currently returns convert_request_failed for the DeepSeek channel, so a responses config will not work. Keep the base URL at https://tokuse.com/v1.
Settings
- Provider ID
- tokuse
- Base URL
- https://tokuse.com/v1
- Model
- deepseek-flash
- Wire API
- chat
- Env key
- TOKUSE_API_KEY
- OpenAI auth
- false
Setup steps
- Create a Tokuse API key in the Tokuse console.
- Add the [model_providers.tokuse] block to ~/.codex/config.toml.
- Export TOKUSE_API_KEY in the shell that starts Codex.
- Run codex. Use codex -m deepseek-v4-pro when a task needs the heavier model.
- Keep any existing provider blocks; switch model_provider to tokuse only when you want DeepSeek.
~/.codex/config.toml
model = "deepseek-flash"
model_provider = "tokuse"
[model_providers.tokuse]
name = "Tokuse"
base_url = "https://tokuse.com/v1"
env_key = "TOKUSE_API_KEY"
wire_api = "chat"
requires_openai_auth = falseShell
export TOKUSE_API_KEY="sk-your-tokuse-key"
codex
# Optional heavier model:
codex -m deepseek-v4-proBefore production use
- Keep the Tokuse key on the server or in the tool's secret store.
- Use the base URL exactly as shown in Settings; do not append a full endpoint path.
- Verify the model alias in the current Tokuse catalog.
- Test errors, timeout behavior, and cost with a small workload first.