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 IDDescriptionInput (per 1M)Output (per 1M)Context
mimo-v2.5-proAgent-optimized flagship$1.00$3.001M tokens
mimo-v2-flashMoE high-speed reasoning$0.50$1.5056k tokens
mimo-v2.5-omniFull-modal (vision/audio/text)TBDTBDTBD

Authentication

Get your API key from platform.xiaomimimo.com:

  1. Sign up with email or GitHub
  2. Navigate to API Keys β†’ Create new key
  3. Copy the key (it starts with miMo-sk-)
  4. 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:

PlanMonthly TokensPrice
Starter10M tokens$10
Pro100M tokens$80
EnterpriseCustomContact sales

Tokens are shared across all models and don't expire. Unused tokens roll over. Sign up at platform.xiaomimimo.com.

Rate Limits

TierRPMTPM
Free1050K
Pay-as-you-go100500K
Token Plan (Pro)5002M

Error Codes

CodeMeaningAction
401Invalid or missing API keyCheck key at platform.xiaomimimo.com
429Rate limit exceededWait before retrying
500Server errorRetry 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