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

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": 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": "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": false
}'

Responses

🟢200Success
application/json
Body

Example
{
  "id": "chatcmpl-CkWalgbzgOgR6Vvg5sEsX3U3V8Qvg",
  "object": "chat.completion",
  "created": 1765204407,
  "model": "gpt-4o-mini-2024-07-18",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "The sum of the integers from 1 to 100 can be calculated using the formula for the sum of an arithmetic series:\n\n\\[\nS_n = \\frac{n}{2} \\times (a + l)\n\\]\n\nwhere:\n- \\( n \\) is the number of terms,\n- \\( a \\) is the first term,\n- \\( l \\) is the last term.\n\nFor the series from 1 to 100:\n- \\( n = 100 \\)\n- \\( a = 1 \\)\n- \\( l = 100 \\)\n\nPlugging these values into the formula:\n\n\\[\nS_{100} = \\frac{100}{2} \\times (1 + 100) = 50 \\times 101 = 5050\n\\]\n\nTherefore, the sum of the integers from 1 to 100 is \\( 5050 \\).",
        "refusal": null,
        "annotations": []
      },
      "logprobs": null,
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 19,
    "completion_tokens": 177,
    "total_tokens": 196,
    "prompt_tokens_details": {
      "cached_tokens": 0,
      "audio_tokens": 0
    },
    "completion_tokens_details": {
      "reasoning_tokens": 0,
      "audio_tokens": 0,
      "accepted_prediction_tokens": 0,
      "rejected_prediction_tokens": 0
    }
  },
  "service_tier": "default",
  "system_fingerprint": "fp_11f3029f6b"
}
Modified at 2025-12-10 09:11:40
Previous
anthropic格式
Next
流式/chat/completions
Built with