Claude Code Relay
  1. Claude Code相关
Claude Code Relay
  • 用户相关
    • 用户登录
      POST
    • 用户注册
      POST
    • 用户信息
      GET
    • 更新用户信息
      PUT
    • 发送邮箱验证码
      POST
  • 任务相关
    • 获取任务列表
      GET
  • Claude Code相关
    • 健康检查
      GET
    • 对话接口
      POST
  • 管理员接口
    • 用户列表
      GET
    • 日志
      GET
    • 概览
      GET
  • 账号相关
    • 获取账号列表
      GET
    • 创建新账号
      POST
    • 测试账号
      POST
  • oauth
    • 生成授权链接
      GET
    • 验证并生成token
      POST
  • 分组相关
    • 分组列表
      GET
    • 创建分组
      POST
    • 更新分组
      PUT
    • 删除分组
      DELETE
  • API KEY管理
    • 秘钥列表
      GET
    • 创建秘钥
      POST
    • 删除秘钥
      DELETE
    • 更新状态
      PUT
  • 日志相关
    • 获取我的日志记录
  • 系统相关
    • 手动重置统计数据
    • 手动清理过期日志
  • 健康检查
    GET
  • 系统状态
    GET
  1. Claude Code相关

对话接口

开发中
POST
http://127.0.0.1:10081/claude-code/v1/messages

请求参数

Header 参数

Body 参数application/json

示例
{
    "model": "claude-sonnet-4-20250514",
    "messages": [
        {
            "role": "user",
            "content": [
                {
                    "type": "text",
                    "text": "hi"
                }
            ]
        }
    ],
    "temperature": 1,
    "system": [
        {
            "type": "text",
            "text": "You are Claude Code, Anthropic's official CLI for Claude.",
            "cache_control": {
                "type": "ephemeral"
            }
        }
    ],
    "metadata": {
        "user_id": "20b98a014e3182f9ce654e6c105432083cca392beb1416f6406508b56dc5f"
    },
    "max_tokens": 64000,
    "stream": true
}

请求示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'http://127.0.0.1:10081/claude-code/v1/messages' \
--header 'Authorization: Bearer cr_c31a3f943713c9921a32e57b918ac5c46523ab391208b38b7b5b9f558ccc83fc' \
--header 'x-api-key: cr_c31a3f943713c9921a32e57b918ac5c46523ab391208b38b7b5b9f558ccc83fc' \
--header 'User-Agent: claude-cli/1.0.44 (external, cli)' \
--header 'Connection: keep-alive' \
--header 'Accept: application/json' \
--header 'Accept-Encoding: br, gzip, deflate' \
--header 'X-Stainless-Retry-Count: 0' \
--header 'X-Stainless-Timeout: 60' \
--header 'X-Stainless-Lang: js' \
--header 'X-Stainless-Package-Version: 0.55.1' \
--header 'X-Stainless-OS: MacOS' \
--header 'X-Stainless-Arch: arm64' \
--header 'X-Stainless-Runtime: node' \
--header 'X-Stainless-Runtime-Version: v20.18.1' \
--header 'anthropic-dangerous-direct-browser-access: true' \
--header 'anthropic-version: 2023-06-01' \
--header 'x-app: cli' \
--header 'anthropic-beta: claude-code-20250219,interleaved-thinking-2025-05-14,fine-grained-tool-streaming-2025-05-14' \
--header 'x-stainless-helper-method: stream' \
--header 'accept-language: *' \
--header 'sec-fetch-mode: cors' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "claude-sonnet-4-20250514",
    "messages": [
        {
            "role": "user",
            "content": [
                {
                    "type": "text",
                    "text": "hi"
                }
            ]
        }
    ],
    "temperature": 1,
    "system": [
        {
            "type": "text",
            "text": "You are Claude Code, Anthropic'\''s official CLI for Claude.",
            "cache_control": {
                "type": "ephemeral"
            }
        }
    ],
    "metadata": {
        "user_id": "20b98a014e3182f9ce654e6c105432083cca392beb1416f6406508b56dc5f"
    },
    "max_tokens": 64000,
    "stream": true
}'

返回响应

🟢200成功
application/json
Body

示例
{}
修改于 2025-08-11 00:56:22
上一页
健康检查
下一页
用户列表
Built with