OpenAI API 兼容
请求地址
https://api.xiaomimimo.com/v1/chat/completions
请求头
接口支持以下两种认证方式,请选择其中一种添加到请求头中:
-
方式一:
api-key字段认证,格式:api-key: $MIMO_API_KEY Content-Type: application/json -
方式二:
Authorization: Bearer认证,格式:Authorization: Bearer $MIMO_API_KEY Content-Type: application/json
请求体
Chat 响应对象(非流式输出)
Chat 响应 chunk 对象(流式输出)
curl --location --request POST 'https://api.xiaomimimo.com/v1/chat/completions' \
--header "api-key: $MIMO_API_KEY" \
--header "Content-Type: application/json" \
--data-raw '{
"model": "mimo-v2.5-pro",
"messages": [
{
"role": "system",
"content": "You are MiMo, an AI assistant developed by Xiaomi. Today is date: Tuesday, December 16, 2025. Your knowledge cutoff date is December 2024."
},
{
"role": "user",
"content": "please introduce yourself"
}
],
"max_completion_tokens": 1024,
"temperature": 1.0,
"top_p": 0.95,
"stream": false,
"stop": null,
"frequency_penalty": 0,
"presence_penalty": 0,
"thinking": {
"type": "disabled"
}
}'响应
{
"id": "8b51f9e0515949cb8207fbd35ea6ea5c",
"choices": [
{
"finish_reason": "stop",
"index": 0,
"message": {
"content": "Hello! I'm MiMo, Xiaomi's AI assistant created by the Xiaomi LLM-Core team. I'm here to chat, help answer questions, and assist with various tasks—whether it's providing information, brainstorming ideas, or just having a friendly conversation. Feel free to ask me anything, and I'll do my best to help! 😊",
"role": "assistant",
"tool_calls": null
}
}
],
"created": 1776848906,
"model": "mimo-v2.5-pro",
"object": "chat.completion",
"usage": {
"completion_tokens": 72,
"prompt_tokens": 57,
"total_tokens": 129,
"completion_tokens_details": {
"reasoning_tokens": 0
},
"prompt_tokens_details": null
}
}更新时间 2026 年 06 月 03 日