⚠️ 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:
Looks like many of us are seeing the DeepSeek API down — I’ve experienced the same. Maybe we can follow a systematic troubleshooting guide whenever the API goes down:
If everything above looks correct but it’s still down, wait a while — sometimes the service may be overloaded or under maintenance (others have reported similar outages).
Optionally, implement fallback logic or retry mechanism in your code so your application can handle temporary downtime gracefully or follow step by steps instructions as given on deepseek api down related blog.
If others have additional tips — logging, rate‑limit checks or alternate endpoints — sharing them here might help the community avoid hours of frustration 🙂