一、灵子
2026-05-29报错完整信息:
API Error: 400 Failed to deserialize the JSON body into the target type: messages1.role: unknown variant `system`, expected `user` or `assistant` at line 1 column 560
因为要解决这个报错我查了很多国内外的帖子,但大多数都是提问求助的没有多少给出solution的,给出solution的我也看不懂(bushi),内耗了好久之后终于想到了另一个办法,用终端接opencode或者codex,让他们操作电脑帮我解决问题不就好了。
所以这里以opencode的加载和配置为例记录一下,如果各位有报错没配置明白的就直接让opencode/codex全自动帮忙吧。
二、配置
2.1、部署opencode
opencode官网:Go | OpenCode
win11系统下安装只需要一行代码,在管理员模式的powershell下,运行:
bash
npm install -g opencode-ai
其他系统或同系统其他的安装方式,进官网简介查看即可:

配置好以后重启管理员模式下的powershell,输入opencode并回车:

2.2、连接订阅的API
在opencode对话框中输入/connect回车。

在光标search里输入deepseek:

回车输入你的Deepseek-v4-pro的API-Key,输入完回车:

选deepseek-v4-pro:

就可以运行opencode了,之后你就像使用Claude一样使用它帮你解决问题就行了。
