mixrouter
  1. anthropic
mixrouter
  • mixrouter接口说明
  • 已支持的模型列表
  • 大模型官方文档
  • gemini
    • openai格式
      • openai格式
      • gemini-开启thinking
    • google原生格式
      • google格式
  • anthropic
    • openai格式
      POST
    • anthropic格式
      POST
  • openai
    • chat/completions
      POST
    • 流式/chat/completions
      POST
    • responses
      POST
  • deepseek
    • chat/completions
      POST
  • qwen
    • chat/completions(开启thinking)
      POST
    • chat/completions
      POST
  • 豆包
    • chat/completions
      POST
    • 提交视频生成任务
      POST
    • 获取视频生成任务结果
      GET
  1. anthropic

openai格式

POST
https://api.mixrouter.com/v1/chat/completions

Request

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

Example
{
    "model": "claude-opus-4-5-20251101",
    "messages": [
        {
            "role": "user",
            "content": [
                {
                    "type": "text",
                    "text": "1+2+3+4+...+100=?"
                }
            ]
        }
    ],
    "temperature": 0.8,
    "top_p": 0.1,
    "max_tokens": 300,
    "steam": false
}

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.mixrouter.com/v1/chat/completions' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "claude-opus-4-5-20251101",
    "messages": [
        {
            "role": "user",
            "content": [
                {
                    "type": "text",
                    "text": "1+2+3+4+...+100=?"
                }
            ]
        }
    ],
    "temperature": 0.8,
    "top_p": 0.1,
    "max_tokens": 300,
    "steam": false
}'

Responses

🟢200OK
application/json
Body

Example
{
    "id": "msg_01YHGPdhsgE5NjPyVF8tfKkK",
    "model": "claude-opus-4-5-20251101",
    "object": "chat.completion",
    "created": 1765209435,
    "choices": [
        {
            "index": 0,
            "message": {
                "role": "assistant",
                "content": "<budget:thinking>\nThis is a simple arithmetic series problem. I need to find the sum 1+2+3+...+100.\n</budget:thinking>\n\nUsing the formula for the sum of an arithmetic series: S = n(n+1)/2\n\nFor n = 100:\nS = 100 × 101 / 2 = **5050**"
            },
            "finish_reason": "stop"
        }
    ],
    "usage": {
        "prompt_tokens": 21,
        "completion_tokens": 87,
        "total_tokens": 108,
        "prompt_tokens_details": {
            "cached_tokens": 0,
            "text_tokens": 0,
            "audio_tokens": 0,
            "image_tokens": 0
        },
        "completion_tokens_details": {
            "text_tokens": 0,
            "audio_tokens": 0,
            "reasoning_tokens": 0
        },
        "output_tokens_details": {
            "text_tokens": 0,
            "audio_tokens": 0,
            "reasoning_tokens": 0
        },
        "input_tokens": 0,
        "output_tokens": 0,
        "input_tokens_details": null,
        "claude_cache_creation_5_m_tokens": 0,
        "claude_cache_creation_1_h_tokens": 0
    }
}
Modified at 2025-12-10 08:45:51
Previous
google格式
Next
anthropic格式
Built with