TL;DR — This error chain means: your client (via cc-switch's local proxy) called a Codex-style
/responsesendpoint, the proxy forwarded to DeepSeek with thinking mode enabled plus tool calls, and DeepSeek rejected the follow-up request because thereasoning_contentfrom the previous assistant turn was not sent back. The proxy is stripping (or never storing) the thinking block. Fixes: (1) disable thinking mode for tool-calling sessions through the proxy, (2) switch that route to a non-thinking model variant, or (3) put the traffic through a router that handles reasoning models correctly — either by round-trippingreasoning_contentor by running them with thinking off.
Decoding the error chain
| Layer | Speaks | What it does to the request |
|---|---|---|
| Your client | Codex-style /responses |
Sends the conversation, including prior tool calls |
| cc-switch local proxy | Translates to chat-completions | Drops reasoning_content — the field is not in the target schema |
| DeepSeek (thinking mode) | Its own thinking-mode contract | Requires each assistant turn's reasoning_content back → HTTP 400 |
cc switch local proxy failed while handling codex endpoint /responses.
provider: deepseek; model: deepseek-v4-flash; upstream_status: http 400;
cause: the `reasoning_content` in the thinking mode must be passed back to the api.
Three layers are talking here:
- Your client speaks the Codex-style
/responsesAPI shape. - cc-switch's local proxy translates that to the provider's chat-completions shape and forwards to DeepSeek.
- DeepSeek runs
deepseek-v4-flashin thinking mode. When a conversation includes tool calls, DeepSeek's API requires each assistant turn'sreasoning_contentto be included when you send the conversation back. The proxy layer translated the message history but dropped that field → HTTP 400.
This is the same underlying contract we documented in the reasoning_content 400 fix — the proxy just adds a translation layer where the field gets lost.
Fix 1: Disable thinking mode on the proxied route
If cc-switch (or your client config) lets you set request parameters per provider, turn thinking mode off for coding/tool sessions. Tool-heavy coding loops rarely benefit enough from exposed reasoning to justify the fragile round-trip.
Fix 2: Use a non-thinking model variant
Route the /responses traffic to a model/mode without the round-trip requirement. Within DeepSeek's lineup that means the standard chat variants rather than reasoner/thinking modes — V4 Pro vs Flash trade-offs here.
Fix 3: Put a contract-aware router in the path
Message-history translation is exactly where thin proxies break. CodeRouter applies Fix 1 for you: it sends DeepSeek and GLM requests with thinking mode disabled wherever the model allows it, and keeps deepseek-reasoner out of automatic routing, so tool-calling sessions through it never carry a reasoning_content to lose. (Kimi K2.6 is the exception: its tool-calling requests run with thinking on, and CodeRouter adds an empty reasoning_content to the earlier tool-call turns it can't replay.) It does not store and replay thinking content, so if you specifically need DeepSeek's thinking mode in tool loops, the history has to be fixed on the client side. If you keep cc-switch for client switching, you can still point its upstream at a router endpoint instead of the raw provider.
Pointing Codex at CodeRouter
Added Nov 21, 2026, and current as of that date. Disclosure: CodeRouter is our product.
For Fix 3 with Codex CLI, add CodeRouter as a model provider in ~/.codex/config.toml:
model = "auto"
model_provider = "coderouter"
[model_providers.coderouter]
name = "CodeRouter"
base_url = "https://www.coderouter.io/api/v1"
env_key = "CODEROUTER_API_KEY"
wire_api = "responses"
Then export CODEROUTER_API_KEY=cr_... (your CodeRouter key) and run codex. The details are in the Codex section of our integration docs.
- DeepSeek requests through CodeRouter run with thinking disabled, so the
reasoning_contentround trip never comes up. If you need DeepSeek's thinking mode itself, CodeRouter isn't the fix. - With
auto(smart routing), CodeRouter picks the model for each request, and it may not be DeepSeek. In Direct mode the model you name answers or you get its error, with no fallback. - Each request is billed at the model's list price with no markup, plus a 5.5% payment fee when you buy credit. Each email inbox gets one free trial: $1 of usage for 7 days with no card, $5 once you add a card (it isn't charged).