MiMo API Integration Guide
The MiMo API is fully compatible with the OpenAI API format. If you have existing code using the OpenAI Python client, you can switch to MiMo by changing two lines: the base_url and your API key.
Quick Start
pip install openai
from openai import OpenAI
client = OpenAI(
base_url="https://api.xiaomimimo.com/v1",
api_key="your-api-key-here" # from platform.xiaomimimo.com
)
response = client.chat.completions.create(
model="mimo-v2.5-pro",
messages=[
{"role": "system", "content": "You are MiMo, a helpful AI assistant."},
{"role": "user", "content": "Explain the MoE architecture in simple terms."}
]
)
print(response.choices[0].message.content)
That's it. Your existing OpenAI code works with this single change.
Available Models
| Model ID | Description | Input (per 1M) | Output (per 1M) | Context |
|---|---|---|---|---|
mimo-v2.5-pro | Agent-optimized flagship | $1.00 | $3.00 | 1M tokens |
mimo-v2-flash | MoE high-speed reasoning | $0.50 | $1.50 | 56k tokens |
mimo-v2.5-omni | Full-modal (vision/audio/text) | TBD | TBD | TBD |
Authentication
Get your API key from platform.xiaomimimo.com:
- Sign up with email or GitHub
- Navigate to API Keys β Create new key
- Copy the key (it starts with
miMo-sk-) - Set it as an environment variable:
export MIMO_API_KEY="miMo-sk-..."
Pass it via the api_key parameter or the AUTHORIZATION header: Bearer miMo-sk-...
curl Example
curl https://api.xiaomimimo.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MIMO_API_KEY" \
-d '{
"model": "mimo-v2-flash",
"messages": [{"role": "user", "content": "Write a Python function to check if a string is a palindrome."}],
"temperature": 0.7
}'
Token Plan
MiMo offers Token Plan subscriptions for predictable monthly spending:
| Plan | Monthly Tokens | Price |
|---|---|---|
| Starter | 10M tokens | $10 |
| Pro | 100M tokens | $80 |
| Enterprise | Custom | Contact sales |
Tokens are shared across all models and don't expire. Unused tokens roll over. Sign up at platform.xiaomimimo.com.
Rate Limits
| Tier | RPM | TPM |
|---|---|---|
| Free | 10 | 50K |
| Pay-as-you-go | 100 | 500K |
| Token Plan (Pro) | 500 | 2M |
Error Codes
| Code | Meaning | Action |
|---|---|---|
| 401 | Invalid or missing API key | Check key at platform.xiaomimimo.com |
| 429 | Rate limit exceeded | Wait before retrying |
| 500 | Server error | Retry with exponential backoff |
Streaming
MiMo API supports SSE streaming:
response = client.chat.completions.create(
model="mimo-v2.5-pro",
messages=[{"role": "user", "content": "Write a poem about AI."}],
stream=True
)
for chunk in response:
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="")
FAQ: MiMo API key and endpoint
How do I get a MiMo API key?
Sign in at platform.xiaomimimo.com with email or GitHub, open API Keys, create a new key, and copy it. MiMo API keys start with miMo-sk-; store the value as MIMO_API_KEY and pass it in the api_key parameter or as an Authorization: Bearer header.
What is the MiMo API base URL?
The endpoint is https://api.xiaomimimo.com/v1. It is fully compatible with the OpenAI API format, so an existing OpenAI client only needs the base_url and api_key changed β the request and response shapes stay the same.
Is the MiMo API OpenAI-compatible?
Yes. Chat completions, streaming via SSE and the usual message roles work with the official OpenAI Python client; the guide above shows the two-line change and a raw curl call with the same body format.
How much does the MiMo API cost?
Pay-as-you-go pricing is $1.00 per 1M input and $3.00 per 1M output tokens for mimo-v2.5-pro, and $0.50 / $1.50 for mimo-v2-flash. Token Plan subscriptions start at $10 per month for 10M tokens, with unused tokens rolling over.
Next Steps
- Explore more models on HuggingFace
- Set up MiMo Code for terminal AI coding
- Read the FAQ for common questions