Skip to content

添加 Anthropic API 协议支持 | Add Anthropic API Protocol Support #2322

@domonic18

Description

@domonic18

例行检查

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

Issue: 添加 Anthropic API 协议支持 | Add Anthropic API Protocol Support

问题描述 (Problem Description)

中文

原始问题:

  1. Claude Code 发送 Anthropic 协议请求到 one-api 系统
  2. One-api 系统不支持 /anthropic 路由,导致请求无法处理
  3. 即使请求能够到达,one-api 也无法正确转发 Anthropic 协议到 DeepSeek 的 anthropic 端点

期望结果:

  • Claude Code 通过 Anthropic 协议请求 one-api
  • One-api 识别 anthropic 协议请求并路由到对应渠道
  • 请求直通到 DeepSeek 的 anthropic 端点: https://api.deepseek.com/anthropic/v1/messages
  • 响应保持 anthropic 格式直接返回给 Claude Code

English

Current Problem:

  1. Claude Code sends Anthropic protocol requests to the one-api system
  2. One-api system does not support /anthropic routing, causing requests to fail
  3. Even if requests can reach, one-api cannot correctly forward Anthropic protocol to DeepSeek's anthropic endpoint

Expected Result:

  • Claude Code can request one-api using Anthropic protocol
  • One-api recognizes anthropic protocol requests and routes to corresponding channels
  • Requests pass through to DeepSeek's anthropic endpoint: https://api.deepseek.com/anthropic/v1/messages
  • Responses maintain anthropic format and return directly to Claude Code

解决方案 (Solution)

为 one-api 添加原生 Anthropic API 支持,包括:

  • 添加 /anthropic/v1/messages 路由端点
  • 实现 Anthropic 协议适配器
  • 支持请求直通到第三方 anthropic 端点

标签: enhancement, api-support
优先级: medium

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions