docs.emix.ai
language
language
  • 🇺🇸 English
  • 🇨🇳 Chinese
language
language
  • 🇺🇸 English
  • 🇨🇳 Chinese
Market
File Upload API
Market
File Upload API
  1. Claude
  • 开始使用
  • Market
  • Image Models
    • Seedream
      • Seedream4.5 文生图
      • Seedream4.5 图片编辑
      • Seedream5.0 Lite 文生图
      • Seedream5.0 Lite 图片编辑
      • Seedream5.0 Pro 文生图
      • Seedream5.0 Pro 图片编辑
    • Google
      • Google Nano Banana
      • Nano Banana Pro 图生图
      • 使用 nano-banana-2 生成内容
      • Nano Banana 2 Lite
    • Grok Imagine
      • Grok Imagine 文生图
      • Grok Imagine 图生图
    • GPT Image
      • GPT Image1.5 文生图
      • GPT Image1.5 图生图
      • GPT Image 2 文生图
      • GPT Image 2 图生图
    • Wan
      • Wan 2.7 Image
      • Wan 2.7 Image Pro
  • Video Models
    • Grok Imagine
      • Grok Imagine 文生视频
      • Grok Imagine 图生视频
      • 放大 Grok Imagine 视频
      • 扩展 Grok Imagine 视频
      • Grok Imagine Video 1.5 Preview
    • Kling
      • Kling-2.6 文生视频
      • Kling-2.6 图生视频
      • Kling AI Avatar Standard
      • Kling AI Avatar Pro
      • Kling V2.1 Master 图生视频
      • Kling V2.1 Master 文生视频
      • Kling V2.1 Pro
      • Kling V2.1 Standard
      • Kling-2.6 motion-control
      • Kling-3.0 motion-control
      • Kling 3.0
    • Bytedance
      • Bytedance Seedance 2.0
      • Bytedance Seedance 2.0 Fast
      • Bytedance Seedance 2.0 Mini
    • Wan
      • Wan 2.6 - 图转视频
      • Wan 2.6 - 文转视频
      • Wan 2.6 - 视频转视频
      • Wan 2.7 - 文转视频
      • Wan 2.7 - 图转视频
      • Wan 2.7 - 视频编辑
      • Wan 2.7 - 参考生视频
    • Veo3.1 API
      • VEO 3.1 文生视频
      • VEO 3.1 图生视频
      • VEO 3.1 参考生视频
    • HappyHorse
      • HappyHorse 1.1 图生视频
      • HappyHorse 1.1 文生视频
      • HappyHorse 1.1 参考图生成视频
    • Gemini Omni
      • Gemini Omni 生视频
      • Gemini Omni Audio 生语音
      • Gemini Omni Character 生角色
  • Chat Models
    • Claude
      • Claude Code 对接 emix.ai 使用指南
      • Claude Sonnet 5
        POST
    • Gemini
      • Gemini 3.5 Flash (openai)
    • Grok
      • Grok 4.5
      • Grok 4.3
  • 获取任务详情
    GET
  1. Claude

Claude Sonnet 5

POST
/claude/v1/messages

Streaming Support#

当请求中设置 stream: true 时,接口会以 SSE 的形式返回结果。Claude 的函数调用会通过 tool_use 内容块和 input_json_delta 增量片段进行流式输出。
Streaming Response Format:
Content-Type: text/event-stream
常见事件包括 message_start、content_block_start、content_block_delta、message_delta 和 message_stop
函数调用会以 tool_use 内容块的形式返回
函数调用场景下最终的 stop_reason 通常为 tool_use

Features#

使用 messages 进行标准对话。
使用 tools 和 input_schema 进行函数调用。
支持 Claude 原生事件流返回。
支持项目中的 thinking 开关。

Request Notes#

在 model 字段中传入当前模型名称。
使用 messages 传递对话上下文。
使用 tools 声明可调用函数。
设置 stream: true 可获得 SSE 流式返回。

Authentication#

该接口使用鉴权配置中的 X-Api-Key 和 anthropic-version,不作为普通请求参数填写。

Request

Authorization
Bearer Token
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
or
Body Params application/jsonRequired

Examples

Responses

🟢200
application/json
请求成功。
Bodyapplication/json

🟠400
🟠401
Request Request Example
Shell
JavaScript
Java
Swift
curl --location 'https://api.emix.ai/claude/v1/messages' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
    "model": "claude-sonnet-5",
    "messages": [
        {
            "role": "user",
            "content": "What is the weather like in Boston today?"
        }
    ],
    "tools": [
        {
            "name": "get_current_weather",
            "description": "Get the current weather in a given location",
            "input_schema": {
                "type": "object",
                "properties": {
                    "location": {
                        "type": "string",
                        "description": "The city and state, e.g. Boston, MA"
                    }
                },
                "required": [
                    "location"
                ]
            }
        }
    ],
    "thinkingFlag": true,
    "stream": false,
    "max_tokens": 4096
}'
Response Response Example
200 - 成功示例
{
    "role": "assistant",
    "usage": {
        "cache_creation": {
            "ephemeral_1h_input_tokens": 0,
            "ephemeral_5m_input_tokens": 0
        },
        "output_tokens": 57,
        "service_tier": "standard",
        "cache_creation_input_tokens": 0,
        "input_tokens": 600,
        "cache_read_input_tokens": 0,
        "inference_geo": "not_available"
    },
    "stop_reason": "tool_use",
    "model": "claude-opus-4-5-20251101",
    "id": "msg_01VSoxV4a8YWB3DBh9TdM63W",
    "credits_consumed": 0.25,
    "type": "message",
    "content": [
        {
            "input": {
                "location": "Beijing, China"
            },
            "caller": {
                "type": "direct"
            },
            "name": "get_current_weather",
            "id": "toolu_018gdqs2FHxrRjQHLZv1qvbF",
            "type": "tool_use"
        }
    ]
}
Previous
Claude Code 对接 emix.ai 使用指南
Next
Gemini 3.5 Flash (openai)
Built with