Xiaomi MiMo Free AI API
Use this workflow whenever a task calls Xiaomi MiMo through api.xiaomimimo.com.
Preconditions
- The target environment allows outbound HTTPS to
api.xiaomimimo.com. - The provider must be invoked with the free-ai bootstrap flow; standard
Authorization: Bearer sk-...ortp-...keys are invalid here.
Core workflow
- Bootstrap a session JWT:
curl -s -X POST 'https://api.xiaomimimo.com/api/free-ai/bootstrap' \
-H 'Content-Type: application/json' \
-d '{"client":"haha"}'
- Parse JSON and read
jwt. - The returned
jwtis short-lived; bootstrap once per logical session.
- Call chat:
curl -X POST 'https://api.xiaomimimo.com/api/free-ai/openai/chat' \
-H "Authorization: Bearer *** \
-H 'X-Mimo-Source: mimocode-cli-free' \
-H 'Content-Type: application/json' \
-d '{
"model": "mimo-auto",
"messages": [{"role":"user","content":"..."}],
"max_tokens": 128000,
"stream": true,
"temperature": 1.0
}'
Response shape
Returns OpenAI-compatible SSE chunks.
modelis always reported asmimo-auto.- Each chunk may contain
reasoning_content, thencontent. - Final chunk may contain
usagewhenstream=true.
A representative successful body:
{
"id": "...",
"object": "chat.completion.chunk",
"model": "mimo-auto",
"choices": [
{
"delta": {
"reasoning_content": "用户要求我只回复...",
"content": "我是MiMo,由小米大模型Core团队开发的智能助手!"
},
"finish_reason": "stop"
}
]
}
Pitfalls
- Wrong endpoint:
/v1/chat/completionsreturns 401 even with bootstrap JWT. - Missing header: omit
X-Mimo-Source: mimocode-cli-freeand the call will reject. - Model ID: docs mention
mimo-v2.5-pro-ultraspeed, but the working free-ai endpoint usesmimo-auto. - Key reuse: do not reuse prior
sk-...ortp-...credentials with this endpoint.
Verification
After bootstrap, a minimal successful call is:
modelin response:mimo-auto- First non-empty assistant output in
content finish_reason:stop
If bootstrap succeeds but chat returns 401, the issue is headers/model or the JWT expired.