Status: [UNTESTED] Endpoints found: http://localhost:8001/v1/chat/completions http://localhost:8001/v1/models http://localhost:8001/v1/accounts http://localhost:8001/v1/accounts/acc_1/deactivate http://localhost:8001/v1/accounts/acc_1/activate Source: https://github.com/279458179/claude2api # Claude2API 将 Claude 网页版转换为 OpenAI 兼容的 API 接口。 ## 功能特性 - OpenAI 兼容 API 接口 - 支持流式响应 (SSE) - 账号池管理 - **Web 管理后台** - 代理支持 - Docker 一键部署 ## 快速开始 ### 1. 获取 Session Key 1. 登录 [claude.ai](https://claude.ai) 2. 按 `F12` 打开开发者工具 3. 切换到 `Application` 标签页 4. 展开 `Cookies` -> 点击 `https://claude.ai` 5. 找到 `sessionKey` 字段,复制其值 ### 2. Docker 部署 ```bash # 克隆项目 git clone https://github.com/279458179/claude2api.git cd claude2api # 创建配置目录 mkdir -p data cp config.example.json data/config.json # 编辑配置文件,添加 session_key vim data/config.json # 启动服务 docker compose up -d # 查看日志 docker compose logs -f # 停止服务 docker compose down ``` 服务将在 `http://localhost:8001` 启动。 ### 3. 管理后台 部署完成后,访问管理后台添加账号: - **管理后台地址**: `http://localhost:8001/admin/login` - **默认密码**: `admin123` 登录后可在管理后台: - 添加/删除账号 - 启用/禁用账号 - 配置代理 - 修改管理员密码 - 测试 API 接口 ### 4. 配置说明 #### 单账号配置 编辑 `data/config.json`: ```json { "accounts": [ { "session_key": "YOUR_SESSION_KEY_HERE", "name": "My Account", "active": true } ], "proxy": { "enabled": false, "http": "", "https": "" }, "server": { "host": "0.0.0.0", "port": 8000 } } ``` #### 多账号配置 在 `accounts` 数组中添加多个账号即可: ```json { "accounts": [ { "session_key": "SESSION_KEY_1", "name": "Account 1", "active": true }, { "session_key": "SESSION_KEY_2", "name": "Account 2", "active": true }, { "session_key": "SES