一、API Error:400 The content[].thinking in the thinking mode must be passed back to the API.

尝试一:

        猜测是CCSwitch中Deepseek的json文件配置有误,所以删除CCSwitch中的Deepseek订阅并重新配置了一遍,发现在全局powershell中可以正常运行Claude,但是在VSCode中无法运行,报错信息相同。

尝试二:

         我在deepseek官网的API开放平台中删除了旧API,并配置了新的API,结果出现了下一个报错信息。

二、API Error: 400 Failed to deserialize the JSON body into the target type: messages[1].role: unknown variant system, expected user or assistant at line 1 column 562

         因为全局powershell的Claude是好用的,所以我将这个问题抛给了VSCode的终端powershell:

VSCode里的Claude插件在我问问题后一直报错,帮我看看是什么问题?    

以下是Claude的回答:

 

方案一的官方渠道肯定走不通,所以选择方案2。

尝试并发现仍然报错。

继续问Claude。

这个也跑不通。

大概的意思是:

DeepSeek 的 /anthropic 兼容接口不完全支持 Anthropic Messages API 的完整格式。它不接受 messages 数组中出现 role: "system" 的消息,只接受 user 和 assistant

尝试一:

更新VSCode和CCSwitch,并将Claude Code 退回到上一版本。

更新后:

说明就是VSCode和CCSwitch的版本太老了;同时Claude Code在2026-05-28半夜更新了。

三、结论

VSCode和CCSwitch版本过旧,更新并重启;Claude Code回退到2.1.153,并禁止自动更新即可。

后续Claude Code的配置,参考下一篇博文:

见下一篇博文

最新报错API Error: 400 Failed to deserialize the JSON body into the target type: messages[1].role: unknown variant `system`, expected `user` or `assistant` at line 1 column 560

懒得自己配置的话可以交给opencode,见下一篇博文:

【Claude】Win11系统VSCode环境中Claude+Deepseek报错的全自动解决方式

Logo

欢迎加入DeepSeek 技术社区。在这里,你可以找到志同道合的朋友,共同探索AI技术的奥秘。

更多推荐