Claude2api — DevOps skill for Claude Code
Claude2API 是基于 Go + Docker 构建的 Claude.ai API 兼容网关、账号池与网页镜像服务,支持 OpenAI Chat Completions、Responses 和 Anthropic Messages 接口,可接 入 Claude Code、Codex CLI 等客户端,并提供账号轮询、流式输出、多轮对话、多模态图片、Thinking、Function C.
How to install Claude2api
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open basketikun/claude2api and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Claude2api does
Claude2API 是基于 Go + Docker 构建的 Claude.ai API 兼容网关、账号池与网页镜像服务,支持 OpenAI Chat Completions、Responses 和 Anthropic Messages 接口,可接 入 Claude Code、Codex CLI 等客户端,并提供账号轮询、流式输出、多轮对话、多模态图片、Thinking、Function Calling、Tool Use、API Key 鉴权、调用日志和后台管理。
Alternatives in DevOps
- Claude Code Router — Use Claude Code as the foundation for coding infrastructure, allowing you to decide how to interact with the m 30.1k ★
- Claude Code GitHub Actions — by Anthropic - Official GitHub Actions integration for Claude Code with examples and documentation for automat 6.4k ★
- Cccc — Coordinate your coding agents like a group chat — read receipts, delivery tracking, and remote ops from your p 1.1k ★
README
Claude2API
Claude2API 是一个基于 Go 开发的 Claude.ai API 兼容网关、账号池与网页镜像服务。项目通过统一管理多个 Claude.ai 账号并自动轮询可用账号,将 Claude 模型能力以 OpenAI API 和 Anthropic API 兼容接口的形式提供给第三方客户端、自动化脚本与开发工具。Claude2API 支持 OpenAI Chat Completions、OpenAI Responses 和 Anthropic Messages 接口,兼容 Claude Code、Codex CLI 以及支持自定义 Base URL 的应用;同时提供流式输出、多轮对话、System Prompt、多模态图片输入、扩展思考(Thinking)、Function Calling / Tool Use、长上下文处理、会话清理、API Key 鉴权、调用日志和可视化后台管理。项目支持 Docker Compose 一键部署,适合个人学习、接口适配、客户端联调和 Claude API 集成测试。
[!WARNING] 免责声明:
本项目涉及对 Claude.ai 官网相关能力的逆向研究,仅供个人学习、技术研究与非商业性技术交流使用。
- 严禁将本项目用于任何商业用途、盈利性使用、批量操作、自动化滥用或规模化调用。
- 严禁将本项目用于破坏市场秩序、恶意竞争、套利倒卖、二次售卖相关服务,以及任何违反 Anthropic 服务条款或当地法律法规的行为。
- 严禁将本项目用于生成、传播或协助生成违法、暴力、色情、未成年人相关内容,或用于诈骗、欺诈、骚扰等非法或不当用途。
- 使用者应自行承担全部风险,包括但不限于账号受限、临时封禁、永久封禁以及因违规使用导致的法律责任。
- 本项目依赖 Claude.ai 上游接口,上游接口、风控策略及页面结构的变化都可能导致部分功能失效。
- 使用本项目即视为你已充分理解并同意本免责声明;请勿使用重要账号、常用账号或高价值账号进行测试。
快速开始
Docker Compose 一键部署
git clone https://github.com/basketikun/claude2api.git
cd claude2api
cp config.example.yaml config.yaml
docker compose up -d
核心功能
- 官网镜像:提供 Claude.ai 官网镜像和账号池选择页面,可随机或指定可用账号进入镜像站,并自动维护访问所需的 Cookie、浏览器指纹与会话信息。
- 号池管理:支持批量导入 Claude.ai 账号,自动获取邮箱和组织信息,并提供账号状态查看、手动刷新、失效清理与定期巡检。
- 账号轮询:API 请求自动轮询可用账号,请求失败时可按配置换号重试,避免单个账号异常影响服务。
- OpenAI 兼容:支持
POST /v1/chat/completions和POST /v1/responses接口,可接入 OpenAI SDK 及支持自定义 Base URL 的客户端。 - Anthropic 兼容:支持
POST /v1/messages接口,可接入 Anthropic SDK、Claude Code 等兼容客户端。 - 开发工具接入:支持配置 Codex CLI、Claude Code 使用本服务的兼容 API。
- 模型列表:提供
GET /v1/models接口,统一返回当前支持的基础模型及 Thinking 模型。 - 流式响应:OpenAI 与 Anthropic 接口均支持流式和非流式输出。
- 多轮对话:支持 System Prompt、user / assistant 历史消息以及多轮上下文拼接。
- 多模态输入:支持 OpenAI 与 Anthropic 格式的 Base64 图片输入,并自动上传至 Claude.ai。
- 扩展思考:模型名添加
-thinking后缀即可启用扩展思考模式。 - 工具调用:支持 OpenAI
tools / tool_calls、Responsesfunction_call和 Anthropictools / tool_use,兼容流式、非流式及工具结果回传。 - 长上下文处理:提示词超过配置阈值时自动转换为文本附件,减少超长上下文直接提
Related Skills
Kiro Provider
Local gateway that serves your AWS Kiro accounts through OpenAI Responses and Anthropic Messages, for Codex CL
Docker Aicodebox
Agent-agnostic base image for putting any terminal AI coding agent (claude-code, pi, opencode...) on the netwo
Runpod Vllm Claude Code
Deploy any HuggingFace model to RunPod as a vLLM server, bridge it to Claude Code (which speaks Anthropic's Me
Claude2api Deploy
Deploy a proxy that converts Claude.ai sessions into a standard Anthropic API with streaming, tools, and image
Claude Proxy
这是一个部署在 Cloudflare Workers 上的 TypeScript 项目,它充当一个代理服务器,能够将 Claude API 格式的请求无缝转换为 OpenAI API 格式。这使得任何与 Claude A
Trae2api Hub
Trea国际国内多账号反代网关,Trae 国际/国内双区多账号 OpenAI 兼容网关 — 直连推理、账号池、模型目录、额度预警/自动降级、API Key 配额与白名单、图形化看板、Docker 零依赖
Related Agents
AI Saglayici Uzmani
Anthropic Messages API ve OpenAI Codex App Server entegrasyonunun uzmanı — akış, araç döngüsü, hata/yeniden de
LLM Integrator
LLM integration specialist who connects to OpenAI/Anthropic/Ollama APIs, designs prompt templates, implements
GPT Chat
Conducts a conversation with a GPT model (Codex) as a separate conversational partner—the thread persists betw