Repository navigation
Description
Summary
On the OpenCode Zen gateway https://opencode.ai/zen/go, the Anthropic-compatible endpoint POST /v1/messages fails for deepseek-v4-pro when messages[].content is passed as a string. The exact same request with deepseek-v4-flash returns 200 OK. Switching deepseek-v4-pro to the array form of content also works.
This only affects deepseek-v4-pro on the Anthropic endpoint — the OpenAI-compatible endpoint and deepseek-v4-flash are unaffected.
Environment
| Item | Value |
|---|---|
| Gateway endpoint | https://opencode.ai/zen/go |
| Failing endpoint | POST /v1/messages (Anthropic-compatible) |
| API version header | anthropic-version: 2023-06-01 |
| Failing model | deepseek-v4-pro |
| Control model | deepseek-v4-flash (same request returns 200) |
| Auth | x-api-key: <token> |
Reproduction
# Fails: 400 Empty input messages
curl -s https://opencode.ai/zen/go/v1/messages \
-H "x-api-key: $KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{"model":"deepseek-v4-pro","max_tokens":30,"messages":[{"role":"user","content":"hi"}]}'
# Control: same request with deepseek-v4-flash returns 200 OK
curl -s https://opencode.ai/zen/go/v1/messages \
-H "x-api-key: $KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{"model":"deepseek-v4-flash","max_tokens":30,"messages":[{"role":"user","content":"hi"}]}'Error response
{
"error": {
"param": null,
"type": "invalid_request_error",
"code": "invalid_request_error",
"message": "Error from provider (Console Go): Upstream request failed: [invalid_request_error] Empty input messages"
}
}The error is thrown by the Console Go upstream provider.
Test matrix (same endpoint, same payload, only the model changes)
| Case | deepseek-v4-flash |
deepseek-v4-pro |
|---|---|---|
Anthropic /v1/messages + string content |
200 OK | 400 Empty input messages |
Anthropic /v1/messages + array content |
200 OK | 200 OK |
OpenAI /v1/chat/completions + string content |
200 OK | 200 OK |
Anthropic /v1/messages + stream + array content |
— | 200, SSE works |
Exact trigger condition
- Endpoint: only the Anthropic-compatible
/v1/messages - Model: only
deepseek-v4-pro(same request works fordeepseek-v4-flash) - Trigger:
messages[].contentis a string ("content":"hi"); the array form ("content":[{"type":"text","text":"hi"}]) works
Impact
The Anthropic SDK accepts a string shorthand for content, e.g. client.messages.create(model="deepseek-v4-pro", messages=[{"role":"user","content":"hi"}]). Serialized as string content, this directly triggers the 400. Any string-content Anthropic-SDK call to deepseek-v4-pro fails, while deepseek-v4-flash or the array form does not.
Related
This overlaps with #34331 (same deepseek-v4-pro error observed there), but that issue is broader and predates this specific flash-vs-pro contrast. This report isolates the deepseek-v4-pro-only regression against a working control model.
Workaround: pass content as the array form [{"type":"text","text":"..."}] for deepseek-v4-pro.
Activity
github-actions commentedon Aug 12, 2026
This issue might be a duplicate of existing issues. Please check:
deepseek-v4-proEmpty input messageserror on the Anthropic-compatible/v1/messagesendpoint — covers the same model and error, with additional model-switching context.heimoshuiyu commentedon Aug 12, 2026
v4 pro does not officially support Anthropic interface yet
lyjx29 commentedon Aug 13, 2026
Hi, adding a data point on real-world impact: this exact bug blocks Claude Code on the Go plan.
Claude Code talks to the gateway via the Anthropic
POST /v1/messagesendpoint and serializes usercontentas a plain string (I confirmed this from the request payloads it produces). String-content is precisely what triggers this 400, so the very first request of any Claude Code session fails — meaningdeepseek-v4-procannot be used as the model in Claude Code at all, whiledeepseek-v4-flashworks fine on the same setup.The array-form workaround from the report unfortunately does not help here: Claude Code has no setting to force array-form content.
So Go-plan subscribers running Claude Code have no way to use
deepseek-v4-prountil string-content is handled for this model on/zen/go/v1/messages(or it is added to the officially-supported list). Please consider fixing/prioritizing it — thanks!hairyf commentedon Aug 13, 2026
Also hitting this from the Responses side: with
deepseek-v4-proon/responses, a string-form content is treated as empty (Empty input messages), while array-form content works. Worth noting this isn't only the Anthropic/v1/messagesendpoint — the gateway's request conversion is the common root cause, and the same stack also breaks plain Codex sessions via/responses(see #42090 and #42135). Captures + a local workaround proxy: https://github.com/hairyf/codex-deepseek-subagent-proxyheimoshuiyu commentedon Aug 13, 2026
@lyjx29 @hairyf now deepseek-v4-pro on opencode-go support anthropic / responses API
github-actions commentedon Oct 13, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.