Skip to content

claude code Unexpected value for anthropic-beta header #2975

@lingfengchencn

Description

@lingfengchencn

例行检查

  • 我已确认目前没有类似 issue
  • 我已确认我已升级到最新版本
  • 我已完整查看过项目 README,尤其是常见问题部分
  • 我理解并愿意跟进此 issue,协助测试和提供反馈
  • 我理解并认可上述内容,并理解项目维护者精力有限,不遵循规则的 issue 可能会被无视或直接关闭

问题描述
claude code报错:
 API Error: 400 {"error":{"type":"","message":"Unexpected value(s) prompt-caching-scope-2026-01-05 for the anthropic-beta header. Please consult our documentation at
..com or try again without the header. (request id: 20260220161020361287639vObg69xR)"},"type":"error"}

复现步骤
Claude Code: v2.1.49
model: claude-opus-4-6@default · API Usage Billing
模型为 vertex 的json认证
new api为最新版本 docker pull calciumion/new-api:latest ,

使用 Claude code 配置 完成地址和密钥输入。
启动claude后,输入报错:

Image

log:

new-api  | [ERR] 2026/02/21 - 00:13:53 | 20260220161352684457013BX4S2Ndu | channel error (channel #2, status code: 400): Unexpected value(s) `prompt-caching-scope-2026-01-05`, `structured-outputs-2025-12-15` for the `anthropic-beta` header. Please consult our documentation at docs.anthropic.com or try again without the header.
new-api  | [INFO] 2026/02/21 - 00:13:53 | 20260220161352684457013BX4S2Ndu | record error log: userId=1, channelId=2, modelName=claude-haiku-4-5-20251001, tokenName=krasus, content=status_code=400, Unexpected value(s) `prompt-caching-scope-2026-01-05`, `structured-outputs-2025-12-15` for the `anthropic-beta` header. Please consult our documentation at ***.***.com or try again without the header.
new-api  | [ERR] 2026/02/21 - 00:13:53 | 20260220161352684457013BX4S2Ndu | relay error: Unexpected value(s) `prompt-caching-scope-2026-01-05`, `structured-outputs-2025-12-15` for the `anthropic-beta` header. Please consult our documentation at docs.anthropic.com or try again without the header.
new-api  | [GIN] 2026/02/21 - 00:13:53 | 20260220161352684457013BX4S2Ndu | 400 |  1.092675559s | 120.204.103.203 |    POST /v1/messages?beta=true
new-api  | [ERR] 2026/02/21 - 00:13:54 | 20260220161352709073831Aq2JxWLY | channel error (channel #2, status code: 400): Unexpected value(s) `prompt-caching-scope-2026-01-05` for the `anthropic-beta` header. Please consult our documentation at docs.anthropic.com or try again without the header.
new-api  | [INFO] 2026/02/21 - 00:13:54 | 20260220161352709073831Aq2JxWLY | record error log: userId=1, channelId=2, modelName=claude-opus-4-6@default, tokenName=krasus, content=status_code=400, Unexpected value(s) `prompt-caching-scope-2026-01-05` for the `anthropic-beta` header. Please consult our documentation at ***.***.com or try again without the header.
new-api  | [ERR] 2026/02/21 - 00:13:54 | 20260220161352709073831Aq2JxWLY | relay error: Unexpected value(s) `prompt-caching-scope-2026-01-05` for the `anthropic-beta` header. Please consult our documentation at docs.anthropic.com or try again without the header.

预期结果
如果使用vertex gcloud授权,是可以正常工作的。 希望使用new api也可以正常工作。

相关截图
如果没有的话,请删除此节。

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions