docs.emix.ai
language
language
  • πŸ‡ΊπŸ‡Έ English
  • πŸ‡¨πŸ‡³ Chinese
language
language
  • πŸ‡ΊπŸ‡Έ English
  • πŸ‡¨πŸ‡³ Chinese
Market
File Upload API
Market
File Upload API
  1. Claude
  • Getting Started with Emix API (Important)
  • Market
  • Image Models
    • Seedream
      • Seedream4.5 - Text to Image
      • Seedream4.5 - Edit
      • Seedream5.0 Lite - Text to Image
      • Seedream5.0 Lite - Image to Image
      • Seedream5.0 Pro - Text to Image
      • Seedream5.0 Pro - Image to Image
    • Google
      • Google - Nano Banana
      • Google - Nano Banana Pro
      • Google - Nano Banana 2
      • Google - Nano Banana 2 Lite
    • Grok Imagine
      • Grok Imagine - Text to Image
      • Grok Imagine - image to image
    • GPT Image
      • GPT Image-1.5 - Text to Image
      • GPT Image-1.5 - Image to Image
      • GPT Image-2 - Text to Image
      • GPT Image 2 - Image To Image
    • Wan
      • Wan 2.7 Image
      • Wan 2.7 Image Pro
  • Video Models
    • Grok Imagine
      • Grok Imagine Text to Video
      • Grok Imagine Image to Video
      • Grok Imagine - Video Upscale
      • Grok Imagine - Video Extend
      • Grok Imagine Video 1.5 Preview
    • Kling
      • Kling 2.6 Text to Video
      • Kling 2.6 Image to Video
      • Kling AI Avatar Standard
      • Kling AI Avatar Pro
      • Kling V2.1 Master Image to Video
      • Kling V2.1 Master Text to Video
      • 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
    • Veo3.1 API
      • VEO 3.1 Text to video
      • VEO 3.1 Image to video
      • VEO 3.1 Reference to vidoe
    • Wan
      • Wan 2.6 - Image to Video
      • Wan 2.6 - Text to Video
      • Wan 2.6 - Video to Video
      • Wan 2.7 - Text to Video
      • Wan 2.7 - Image to Video
      • Wan 2.7 - Video Edit
      • Wan 2.7 - Reference to Video
    • HappyHorse
      • HappyHorse-1-1 image-to-video
      • HappyHorse-1-1 text-to-video
      • HappyHorse-1-1 reference-to-video
    • Gemini Omni
      • Gemini Omni Video
      • Gemini Omni Audio
      • Gemini Omni Character
  • Chat Models
    • Claude
      • Claude Code + emix.ai Integration Guide
      • Claude Sonnet 5
        POST
    • Gemini
      • Gemini 3.5 Flash (openai)
    • Grok
      • Grok 4.5
      • Grok 4.3
  • Get Task Details
    GET
  1. Claude

Claude Sonnet 5

POST
/claude/v1/messages

Streaming Support#

When stream: true is set in the request, the API returns responses as server-sent events (SSE). Claude tool calling responses stream tool_use blocks and input_json_delta fragments.
Streaming Response Format:
Content-Type: text/event-stream
Event names include message_start, content_block_start, content_block_delta, message_delta, and message_stop
Tool calls are emitted as tool_use content blocks
Final stop reason is often tool_use for function-calling requests

Features#

Standard chat with messages.
Function calling with tools and input_schema.
Optional stream response with Claude events.
Optional project-specific thinking flag.

Request Notes#

Put the current model name in the model field.
Use messages for conversation history.
Use tools to declare callable functions.
Set stream to true for SSE output.

Authentication#

Use the auth configuration for X-Api-Key and anthropic-version. Do not add them as regular request parameters.

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
Request successful.
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 Integration Guide
Next
Gemini 3.5 Flash (openai)
Built with