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="")
Next Steps
- Explore more models on HuggingFace
- Set up MiMo Code for terminal AI coding
- Read the FAQ for common questions