Skip to content

BUG: deepseek-v4-pro on zen/go /v1/messages returns 400 Empty input messages for string content (flash works on same request) #42091

Closed as not planned

Description

@TuTouPower

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 for deepseek-v4-flash)
  • Trigger: messages[].content is 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

  1. github-actions commented on Aug 12, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

  2. heimoshuiyu commented on Aug 12, 2026

    @heimoshuiyu
    Contributor

    v4 pro does not officially support Anthropic interface yet

  3. lyjx29 commented on Aug 13, 2026

    @lyjx29

    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/messages endpoint and serializes user content as 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 — meaning deepseek-v4-pro cannot be used as the model in Claude Code at all, while deepseek-v4-flash works 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-pro until 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!

  4. hairyf commented on Aug 13, 2026

    @hairyf

    Also hitting this from the Responses side: with deepseek-v4-pro on /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/messages endpoint — 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-proxy

  5. heimoshuiyu commented on Aug 13, 2026

    @heimoshuiyu
    Contributor

    @lyjx29 @hairyf now deepseek-v4-pro on opencode-go support anthropic / responses API

  6. github-actions commented on Oct 13, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions