← All articles

Xiaomi MiMo API: The Complete Integration Guide (2026)

Everything you need to integrate Xiaomi's MiMo model family via API — from signup and first call in 3 minutes to MiMo V2.5 Pro's trillion-parameter reasoning, multimodal V2.5, budget V2 Flash, ASR transcription, pricing, common errors, and routing MiMo alongside other providers.

· TheRouter

Xiaomi's MiMo is a family of open-weight AI models ranging from the budget-friendly MiMo V2 Flash (309B total, 15B active) to the flagship MiMo V2.5 Pro (1.02T total, 42B active, 1M context). All MiMo models are served through Xiaomi's own API platform at platform.xiaomimimo.com with an OpenAI-compatible endpoint — point your existing OpenAI SDK at their base_url, swap in a MiMo model ID, and your code works. MiMo V2.5 Pro has drawn attention for its strong performance on agentic coding benchmarks like SWE-bench Verified, where it scores competitively with frontier proprietary models.

We wrote this guide because MiMo is the last major Chinese AI provider we route to that didn't have a dedicated integration guide on this blog. With five models in our routing layer — from a sub-dollar-per-million-token flash model to a trillion-parameter reasoning flagship — MiMo covers a wider capability range than most single-provider lineups.

OpenAI-compatible means a provider exposes a chat-completions endpoint whose request and response shape matches the OpenAI API contract closely enough that an unmodified OpenAI SDK call works against it after swapping three values: API key, base URL, and model name. The minimum surface in practice is POST /v1/chat/completions with messages, model, and an OpenAI-shaped streaming response.

Getting Started in 3 Minutes

Step 1: Create an account. Go to platform.xiaomimimo.com and sign up. Xiaomi supports email, phone number, and third-party OAuth.

Step 2: Get your API key. Navigate to the API Keys section in the console and create a new key. Copy and store it securely — it's shown once.

Step 3: Make your first call. Install the OpenAI Python SDK:

pip install --upgrade openai

Then run:

from openai import OpenAI

client = OpenAI(
    api_key="YOUR_MIMO_API_KEY",
    base_url="https://api.mimo.mi.com/v1",
)

response = client.chat.completions.create(
    model="mimo-v2.5-pro",
    messages=[{"role": "user", "content": "Explain what MiMo V2.5 Pro is in one paragraph."}],
)

print(response.choices[0].message.content)

That's it. Xiaomi offers a free trial balance for new accounts — check your console for available credits. They also offer a Token Plan subscription for predictable monthly spending.

The MiMo Model Family

MiMo spans five models across text, multimodal, and speech modalities:

ModelModel IDTotal / Active ParamsContextModalityBest For
V2 Flashmimo-v2-flash309B / 15B128KText → TextHigh-volume, low-cost workloads; fast reasoning with thinking mode
V2 Promimo-v2-pro1.02T / 42B1MText → TextLong-context text tasks requiring 1M window; prompt-cache support
V2.5mimo-v2.5—128KText + Image + Audio + Video → TextMultimodal understanding; cost-efficient agent tasks
V2.5 Promimo-v2.5-pro1.02T / 42B128KText + Image + Audio + Video → TextFlagship reasoning; agentic coding; long-horizon tasks
V2.5 ASRmimo-v2.5-asr——Audio → TextSpeech-to-text transcription; dialect support

All text-generation models support the standard OpenAI /v1/chat/completions endpoint. MiMo V2.5 ASR uses the /v1/audio/transcriptions endpoint.

MiMo V2.5 Pro — The Flagship

MiMo V2.5 Pro is Xiaomi's strongest model. Released April 23, 2026, it's a 1.02T-parameter Mixture-of-Experts model with 42B active parameters and a 1M-token context window. It uses a hybrid attention architecture — Sliding Window Attention (SWA) interleaved with Global Attention at a 6:1 ratio — which cuts KV-cache by nearly 7× at long context while preserving quality.

Key capabilities:

  • Agentic coding: Scored 62% on SWE-bench Pro when run through MiMo Code (Xiaomi's coding harness), and 78.6% on SWE-bench Verified in thinking mode (source: Xiaomi, April 2026)
  • Long-horizon tasks: Can sustain complex tasks spanning 1,000+ tool calls — Xiaomi demonstrated a complete SysY compiler in Rust built in 4.3 hours scoring 233/233 on the PKU hidden test suite
  • Token efficiency: Reaches frontier-tier capability using 40–60% fewer tokens per trajectory than comparable models on ClawEval
  • Open weights: Fully open-sourced on Hugging Face under a permissive license

Reasoning mode is opt-in. Enable it via reasoning_effort, Anthropic-style thinking blocks, or the enable_thinking parameter.

MiMo V2 Flash — Budget Reasoning

MiMo V2 Flash is a 309B MoE with just 15B active parameters, designed for speed and cost. At $0.14/MTok input and $0.43/MTok output (via TheRouter), it's one of the cheapest reasoning-capable models available. It supports thinking mode (opt-in), tool calls, JSON output, and scored 78.6 on SWE-bench Verified in thinking mode after the February 2026 update (source: Xiaomi, February 2026).

V2 Flash also deeply integrates with coding agents — Xiaomi explicitly optimized it for Claude Code, OpenCode, Kilo, and Cline.

MiMo V2.5 — Multimodal Mid-Tier

MiMo V2.5 is the multimodal entry point. It accepts text, images, audio, and video as input, supports reasoning mode, and costs ¥1/MTok input / ¥2/MTok output — making it a strong choice when you need cross-modal understanding without the flagship price tag. Its agent capabilities on daily tasks are described by Xiaomi as "comparable to V2.5 Pro."

MiMo V2.5 ASR — Speech Transcription

MiMo V2.5 ASR handles speech-to-text with support for:

  • Chinese and English bilingual recognition
  • Regional dialects (Wu, Cantonese, Minnan, Sichuanese)
  • Lyrics transcription in mixed vocal-instrumental tracks
  • Robust performance in noisy, far-field, and multi-speaker environments

Priced at ¥0.50/hour of input audio, it's accessed via the /v1/audio/transcriptions endpoint.

API Access: Direct vs. DashScope vs. Routing

MiMo models are available through multiple paths:

  1. Xiaomi MiMo Platform (direct): The primary API at api.mimo.mi.com. OpenAI and Anthropic protocol compatible.
  2. Third-party providers: Available on OpenRouter, SiliconFlow, and other aggregators.
  3. TheRouter: We route MiMo models through the xiaomi provider path, supporting fallback chains across providers.

For DashScope users: MiMo models are not hosted on Alibaba Cloud's DashScope (Bailian) platform. They run on Xiaomi's own infrastructure. If you're already using DashScope for Qwen models, adding MiMo means adding a second provider — which is exactly the use case where a routing layer helps.

Code Examples

Basic Chat Completion

from openai import OpenAI

client = OpenAI(
    api_key="YOUR_MIMO_API_KEY",
    base_url="https://api.mimo.mi.com/v1",
)

response = client.chat.completions.create(
    model="mimo-v2.5-pro",
    messages=[
        {"role": "system", "content": "You are a helpful coding assistant."},
        {"role": "user", "content": "Write a Python function to merge two sorted lists."},
    ],
    temperature=0.7,
    max_tokens=2048,
)

print(response.choices[0].message.content)

Thinking Mode (Reasoning)

response = client.chat.completions.create(
    model="mimo-v2.5-pro",
    messages=[{"role": "user", "content": "Prove that √2 is irrational."}],
    extra_body={"enable_thinking": True},
)

# The response includes reasoning in a thinking block
print(response.choices[0].message.content)

Tool Calling

import json

tools = [
    {
        "type": "function",
        "function": {
            "name": "get_weather",
            "description": "Get current weather for a location",
            "parameters": {
                "type": "object",
                "properties": {
                    "location": {"type": "string", "description": "City name"},
                },
                "required": ["location"],
            },
        },
    }
]

response = client.chat.completions.create(
    model="mimo-v2.5-pro",
    messages=[{"role": "user", "content": "What's the weather in Beijing?"}],
    tools=tools,
    tool_choice="auto",
)

tool_call = response.choices[0].message.tool_calls[0]
print(f"Function: {tool_call.function.name}")
print(f"Args: {tool_call.function.arguments}")

Tool calling accuracy in thinking mode reached 97% after the February 2026 V2 Flash update, up from 44% at launch (source: Xiaomi).

Multimodal Input (V2.5 / V2.5 Pro)

response = client.chat.completions.create(
    model="mimo-v2.5",
    messages=[
        {
            "role": "user",
            "content": [
                {"type": "text", "text": "Describe what you see in this image."},
                {
                    "type": "image_url",
                    "image_url": {"url": "https://example.com/photo.jpg"},
                },
            ],
        }
    ],
)

print(response.choices[0].message.content)

Node.js Example

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: "YOUR_MIMO_API_KEY",
  baseURL: "https://api.mimo.mi.com/v1",
});

const completion = await client.chat.completions.create({
  model: "mimo-v2.5-pro",
  messages: [{ role: "user", content: "Explain MoE architectures." }],
});

console.log(completion.choices[0].message.content);

Pricing

MiMo pricing is competitive, especially after the May 2026 price cuts of up to 99% on some tiers:

ModelInput (cache miss)Input (cache hit)OutputNote
V2.5 Pro¥3 / MTok¥0.025 / MTok¥6 / MTokFlagship reasoning
V2.5 Pro UltraSpeed¥9 / MTok¥0.075 / MTok¥18 / MTok1000 tok/s peak, beta
V2.5¥1 / MTok¥0.02 / MTok¥2 / MTokMultimodal mid-tier
V2 Flash~¥0.1 / MTok—~¥0.3 / MTokBudget reasoning
V2 Pro¥1 / MTok (≤256K), ¥2 (256K–1M)¥0.20 / MTok¥3 / MTok1M long context
V2.5 ASR¥0.50 / hour——Audio transcription
V2.5 TTSFree (limited time)——Text-to-speech

Xiaomi also offers a Token Plan subscription at $1,056/year ($88/month) that provides credit pools with 5–8× more credits than pay-as-you-go.

For comparison through TheRouter's routing layer, see the MiMo V2.5 Pro model page for current per-token rates.

Common Errors and Fixes

ErrorCauseFix
401 UnauthorizedInvalid or expired API keyRegenerate your API key in the console
429 Too Many RequestsRate limit exceededImplement exponential backoff; consider Token Plan for higher limits
400 Invalid modelWrong model IDUse exact IDs: mimo-v2.5-pro, mimo-v2.5, mimo-v2-flash, mimo-v2-pro
413 Request Too LargeInput exceeds context windowCheck model's context limit (128K for Flash/V2.5, 1M for Pro)
Thinking mode not workingFeature not enabledPass enable_thinking: true in extra_body or use reasoning_effort parameter
Multimodal input rejectedText-only model selectedUse mimo-v2.5 or mimo-v2.5-pro for image/audio/video input

Production Checklist

Before going to production with MiMo:

  • API key rotation: Store keys in environment variables or a secrets manager, never in code
  • Rate limit handling: Implement exponential backoff with jitter on 429 responses
  • Model selection: Match the model to the workload — V2 Flash for throughput, V2.5 Pro for reasoning quality
  • Context budget: MiMo V2.5 Pro's cache hit pricing (¥0.025/MTok) is 120× cheaper than cache miss — structure prompts to maximize cache hits for repeated system prompts
  • Timeout configuration: Long-horizon agentic tasks may run for minutes — set appropriate timeouts
  • Fallback routing: Configure a backup provider in case of Xiaomi platform outages
  • Response validation: For tool calls, validate function arguments before execution
  • Cost monitoring: Track token usage — thinking mode generates additional reasoning tokens that count toward output billing

TheRouter Integration

We route all five MiMo models through the xiaomi provider. If you're already using TheRouter, you can access MiMo models directly:

from openai import OpenAI

client = OpenAI(
    api_key="YOUR_THEROUTER_KEY",
    base_url="https://therouter.ai/v1",
)

response = client.chat.completions.create(
    model="xiaomi/mimo-v2.5-pro",
    messages=[{"role": "user", "content": "Hello from MiMo via TheRouter!"}],
)

TheRouter supports model fallback chains, so you can configure MiMo V2.5 Pro as your primary coding model with automatic fallback to DeepSeek V4 Pro or Claude Opus if the Xiaomi platform is unavailable. This is particularly useful given that MiMo's API platform is newer and may have less redundancy than established providers.

For the full list of supported MiMo models and current pricing through TheRouter, see:

MiMo vs. Other Chinese AI Providers

If you're evaluating MiMo against other Chinese AI model APIs:

  • vs. DeepSeek V4: MiMo V2.5 Pro is competitive on coding benchmarks but more expensive than DeepSeek V4 Flash. MiMo's edge is multimodal input support and open weights. See our DeepSeek API guide.
  • vs. Qwen3.7 (DashScope): Qwen3.7 Max offers stronger general reasoning but MiMo V2.5 Pro excels at long-horizon agentic tasks. MiMo has its own platform; Qwen runs through DashScope. See our DashScope Qwen3.7 guide.
  • vs. Kimi K2.7 Code: Both target agentic coding. K2.7 Code is Moonshot AI's specialist; MiMo V2.5 Pro is a generalist that also excels at coding. See our Kimi K2 guide.
  • vs. GLM-5 (Z.AI): GLM-5 is strong on long-horizon coding benchmarks. MiMo V2.5 Pro offers comparable agent performance with open weights. See our GLM API guide.

The key differentiator for MiMo: it's the only frontier-tier Chinese model that's both available via API and fully open-sourced with permissive weights on Hugging Face.

FAQ

Is MiMo free to use? New accounts receive free trial credits. After that, it's pay-as-you-go or Token Plan subscription. MiMo V2.5 TTS is currently free during a limited-time promotion.

Does MiMo support streaming? Yes. Pass stream=True in your API call, same as with the OpenAI SDK.

Can I self-host MiMo? Yes. MiMo V2.5 Pro and V2 Flash weights are available on Hugging Face. Deploy with SGLang or vLLM — see the model card for configuration details.

What coding agents work with MiMo? MiMo is tested with Claude Code, OpenCode, OpenClaw, Kilo Code, Cline, Codex, Cherry Studio, Qwen Code, and CodeBuddy. Xiaomi also ships their own MiMo Code harness.

Does MiMo support function calling / tool use? Yes. All text-generation MiMo models support the OpenAI tool calling format. After the February 2026 update, tool call accuracy in thinking mode is 97%.

What languages does MiMo V2.5 ASR support? Chinese, English, code-switching between the two, and several Chinese regional dialects including Wu, Cantonese, Minnan, and Sichuanese.

Help & contact