mixrouter
  1. openai
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. openai

流式/chat/completions

POST
https://api.mixrouter.com/v1/chat/completions
参数类型和取值,参考非流式请求。对于复杂的prompt,一般情况下,推荐使用流式请求

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": "gpt-4o-mini",
    "messages": [
        {
            "role": "user",
            "content": [
                {
                    "type": "text",
                    "text": "1+2+3+4+...+100=?"
                }
            ]
        }
    ],
    "temperature": 0.8,
    "top_p": 0.1,
    "max_tokens": 300,
    "stream": true
}

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": "gpt-4o-mini",
    "messages": [
        {
            "role": "user",
            "content": [
                {
                    "type": "text",
                    "text": "1+2+3+4+...+100=?"
                }
            ]
        }
    ],
    "temperature": 0.8,
    "top_p": 0.1,
    "max_tokens": 300,
    "stream": true
}'

Responses

🟢200OK
text/event-stream
Body

Example
data: {
    "id": "chatcmpl-CkXO3FQ4V9scuDlyQP5vjMKJQbDsS",
    "object": "chat.completion.chunk",
    "created": 1765207463,
    "model": "gpt-4o-mini-2024-07-18",
    "service_tier": "default",
    "system_fingerprint": "fp_11f3029f6b",
    "choices": [
        {
            "index": 0,
            "delta": {
                "role": "assistant",
                "content": "",
                "refusal": null
            },
            "logprobs": null,
            "finish_reason": null
        }
    ],
    "usage": null,
    "obfuscation": "aXPLCOxE4"
}

data: {
    "id": "chatcmpl-CkXO3FQ4V9scuDlyQP5vjMKJQbDsS",
    "object": "chat.completion.chunk",
    "created": 1765207463,
    "model": "gpt-4o-mini-2024-07-18",
    "service_tier": "default",
    "system_fingerprint": "fp_11f3029f6b",
    "choices": [
        {
            "index": 0,
            "delta": {
                "content": "The"
            },
            "logprobs": null,
            "finish_reason": null
        }
    ],
    "usage": null,
    "obfuscation": "WbXUKunM"
}

data: {
    "id": "chatcmpl-CkXO3FQ4V9scuDlyQP5vjMKJQbDsS",
    "object": "chat.completion.chunk",
    "created": 1765207463,
    "model": "gpt-4o-mini-2024-07-18",
    "service_tier": "default",
    "system_fingerprint": "fp_11f3029f6b",
    "choices": [
        {
            "index": 0,
            "delta": {
                "content": " sum"
            },
            "logprobs": null,
            "finish_reason": null
        }
    ],
    "usage": null,
    "obfuscation": "bJZ2kXQ"
}

data: {
    "id": "chatcmpl-CkXO3FQ4V9scuDlyQP5vjMKJQbDsS",
    "object": "chat.completion.chunk",
    "created": 1765207463,
    "model": "gpt-4o-mini-2024-07-18",
    "service_tier": "default",
    "system_fingerprint": "fp_11f3029f6b",
    "choices": [
        {
            "index": 0,
            "delta": {
                "content": " of"
            },
            "logprobs": null,
            "finish_reason": null
        }
    ],
    "usage": null,
    "obfuscation": "CENruyS2"
}

data: {
    "id": "chatcmpl-CkXO3FQ4V9scuDlyQP5vjMKJQbDsS",
    "object": "chat.completion.chunk",
    "created": 1765207463,
    "model": "gpt-4o-mini-2024-07-18",
    "service_tier": "default",
    "system_fingerprint": "fp_11f3029f6b",
    "choices": [
        {
            "index": 0,
            "delta": {
                "content": " the"
            },
            "logprobs": null,
            "finish_reason": null
        }
    ],
    "usage": null,
    "obfuscation": "gSoETyk"
}

data: {
    "id": "chatcmpl-CkXO3FQ4V9scuDlyQP5vjMKJQbDsS",
    "object": "chat.completion.chunk",
    "created": 1765207463,
    "model": "gpt-4o-mini-2024-07-18",
    "service_tier": "default",
    "system_fingerprint": "fp_11f3029f6b",
    "choices": [
        {
            "index": 0,
            "delta": {
                "content": " first"
            },
            "logprobs": null,
            "finish_reason": null
        }
    ],
    "usage": null,
    "obfuscation": "WNusL"
}

data: {
    "id": "chatcmpl-CkXO3FQ4V9scuDlyQP5vjMKJQbDsS",
    "object": "chat.completion.chunk",
    "created": 1765207463,
    "model": "gpt-4o-mini-2024-07-18",
    "service_tier": "default",
    "system_fingerprint": "fp_11f3029f6b",
    "choices": [
        {
            "index": 0,
            "delta": {
                "content": " \\("
            },
            "logprobs": null,
            "finish_reason": null
        }
    ],
    "usage": null,
    "obfuscation": "bnhigWj"
}

data: {
    "id": "chatcmpl-CkXO3FQ4V9scuDlyQP5vjMKJQbDsS",
    "object": "chat.completion.chunk",
    "created": 1765207463,
    "model": "gpt-4o-mini-2024-07-18",
    "service_tier": "default",
    "system_fingerprint": "fp_11f3029f6b",
    "choices": [
        {
            "index": 0,
            "delta": {
                "content": " n"
            },
            "logprobs": null,
            "finish_reason": null
        }
    ],
    "usage": null,
    "obfuscation": "Hm203w7Qd"
}

data: {
    "id": "chatcmpl-CkXO3FQ4V9scuDlyQP5vjMKJQbDsS",
    "object": "chat.completion.chunk",
    "created": 1765207463,
    "model": "gpt-4o-mini-2024-07-18",
    "service_tier": "default",
    "system_fingerprint": "fp_11f3029f6b",
    "choices": [
        {
            "index": 0,
            "delta": {
                "content": " \\"
            },
            "logprobs": null,
            "finish_reason": null
        }
    ],
    "usage": null,
    "obfuscation": "sfSx9WRb"
}

data: {
    "id": "chatcmpl-CkXO3FQ4V9scuDlyQP5vjMKJQbDsS",
    "object": "chat.completion.chunk",
    "created": 1765207463,
    "model": "gpt-4o-mini-2024-07-18",
    "service_tier": "default",
    "system_fingerprint": "fp_11f3029f6b",
    "choices": [
        {
            "index": 0,
            "delta": {
                "content": ")"
            },
            "logprobs": null,
            "finish_reason": null
        }
    ],
    "usage": null,
    "obfuscation": "TBjAkkB
Modified at 2025-12-10 08:45:08
Previous
chat/completions
Next
responses
Built with