⚠️ No Longer Working (January 2026): This configuration was working when originally created, but is now broken due to Codex deprecating the Chat Completions API (wire_api = "chat") in favor of OpenAI's Responses API. Since DeepSeek only supports Chat Completions, this integration no longer works reliably. Tool calls fail with message format errors.
- Before: DeepSeek worked with Codex using
wire_api = "chat" - Now: Codex is deprecating
wire_api = "chat", and the code path has bugs that won't be fixed - Result: Tool calls fail with errors like "insufficient tool messages following tool_calls message"
# Default model - OpenAI
model = "gpt-5.1-codex"
# DeepSeek provider definitions
[model_providers.deepseek]
name = "DeepSeek"
base_url = "https://api.deepseek.com/v1"
env_key = "DEEPSEEK_API_KEY"
wire_api = "chat"
[model_providers.deepseek-reasoner]
name = "DeepSeek Reasoner"
base_url = "https://api.deepseek.com/v1"
env_key = "DEEPSEEK_API_KEY"
wire_api = "chat"
# Profile for DeepSeek Chat (V3.2 non-thinking)
[profiles.deepseek]
model = "deepseek-chat"
model_provider = "deepseek"
# Profile for DeepSeek Reasoner (V3.2 thinking mode)
[profiles.deepseek-r1]
model = "deepseek-reasoner"
model_provider = "deepseek-reasoner"# Default - uses OpenAI gpt-5.1-codex
codex
# Switch to DeepSeek V3.2 Chat
codex --profile deepseek
codex -p deepseek
# Switch to DeepSeek V3.2 Reasoner
codex --profile deepseek-r1
codex -p deepseek-r1- Set your DeepSeek API key:
export DEEPSEEK_API_KEY="your-deepseek-api-key"- Add to your shell profile (
~/.bashrc,~/.zshrc, etc.):
export DEEPSEEK_API_KEY="your-deepseek-api-key"- Place the config in
~/.codex/config.toml
# Deprecation warning
Support for the "chat" wire API is deprecated and will soon be removed.
# Tool call error
An assistant message with 'tool_calls' must be followed by tool messages
responding to each 'tool_call_id'. (insufficient tool messages following
tool_calls message)
# Reasoner error
Missing `reasoning_content` field in the assistant message
Since Codex + DeepSeek no longer works, consider:
seeing this error