Introducing ModelTunnel AI Native Cloud: Better frontier models, faster runs, lower costs →

Codex

Codex CLI supports any OpenAI-compatible provider. Add ModelTunnel to its config to run Codex on DeepSeek, GLM, Kimi, Qwen and the other ModelTunnel models.

1. Set your API key

export DEEPNEXUS_API_KEY="sk-dn-..."

Add the line to ~/.zshrc or ~/.bashrc to make it permanent.

2. Configure the provider

Edit ~/.codex/config.toml:

model = "deepseek-v4-pro"
model_provider = "deepnexus"

[model_providers.deepnexus]
name = "ModelTunnel"
base_url = "https://modeltunnel.ai/v1"
env_key = "DEEPNEXUS_API_KEY"
wire_api = "chat"

3. Run

codex

Switch model for a single run with codex -m kimi-k3, or use profiles:

[profiles.fast]
model = "deepseek-v4.1-flash"
model_provider = "deepnexus"

[profiles.deep]
model = "deepseek-v4-pro"
model_provider = "deepnexus"
codex --profile fast

Add the MCP server (optional)

[mcp_servers.deepnexus]
url = "https://modeltunnel.ai/mcp"
bearer_token_env_var = "DEEPNEXUS_API_KEY"
TaskModel
Large refactors, debuggingdeepseek-v4-pro, kimi-k3
Everyday editsglm-5.3, qwen3.8-max
Quick questions, scriptsdeepseek-v4.1-flash
Codex · ModelTunnel