mirror of
https://github.com/deepseek-ai/DeepSeek-V3.git
synced 2026-11-05 00:47:48 +00:00
[GH-ISSUE #1369] [BUG] Anthropic endpoint: system field as content block array causes 'unknown variant system' error with Claude Code v2.1.154+ #909
Labels
No labels
closed-as-stale
enhancement
question
spam
stale
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
deepseek-ai/DeepSeek-V3#909
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @james-huangzhen on GitHub (May 29, 2026).
Original GitHub issue: https://github.com/deepseek-ai/DeepSeek-V3/issues/1369
Description
When using Claude Code v2.1.154+ with DeepSeek's
/anthropicendpoint (https://api.deepseek.com/anthropic), requests fail with HTTP 400:Root Cause
Claude Code v2.1.154 changed the
systemfield from a plain string to an array of text content blocks withcache_control— both are valid per the Anthropic Messages API specification:Before v2.1.154 (string format):
After v2.1.154 (content block array format):
DeepSeek's
/anthropicendpoint appears to only handlesystemas a string. When it receives the array format, the internal format conversion (Anthropic → OpenAI) incorrectly places the text content blocks into themessagesarray asrole: "system"entries, which then fails validation.Steps to Reproduce
npm install -g @anthropic-ai/claude-codeclaudeand send any messageEvidence
systemas a plain string — the array/content-block format is never mentioned or testedcache_controlis documented as "Ignored" in the compatibility table, suggesting incomplete Anthropic API implementationExpected Behavior
The
/anthropicendpoint should acceptsystemas both a string AND an array of text content blocks (with or withoutcache_control), consistent with the Anthropic Messages API specification.Workaround
Downgrade Claude Code to v2.1.153:
npm install -g @anthropic-ai/claude-code@2.1.153Environment
https://api.deepseek.com/anthropicdeepseek-v4-pro