Skip to content

Using Xiaomi MiMo with OpenClaw

I often find myself stuck when an API cannot handle large files or long conversations. It is frustrating to spend time breaking down data into small chunks just to stay within a narrow context window. I prefer using models that let me send everything at once so I can focus on the actual output.

If you want a large context window and a familiar API format, Xiaomi MiMo is a great choice. It provides REST APIs that work with OpenAI and Anthropic formats.

  • A Xiaomi MiMo API key from the Xiaomi MiMo console.
  • The OpenClaw CLI installed on your machine.

Setting up the provider takes less than five minutes. You can use the built-in onboarding command to get started.

Run this command in your terminal to start the interactive setup:

Terminal window
openclaw onboard --auth-choice xiaomi-api-key

If you want to skip the questions and set it up in one go, use the non-interactive flag:

Terminal window
openclaw onboard --auth-choice xiaomi-api-key --xiaomi-api-key "$XIAOMI_API_KEY"

If you prefer manual configuration, you can add this snippet to your config file. It defines the mimo-v2-flash model, which supports a 262,144-token context window and uses the Anthropic Messages API format.

{
env: { XIAOMI_API_KEY: "your-key" },
agents: { defaults: { model: { primary: "xiaomi/mimo-v2-flash" } } },
models: {
mode: "merge",
providers: {
xiaomi: {
baseUrl: "https://api.xiaomimimo.com/anthropic",
api: "anthropic-messages",
apiKey: "XIAOMI_API_KEY",
models: [
{
id: "mimo-v2-flash",
name: "Xiaomi MiMo V2 Flash",
reasoning: false,
input: ["text"],
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
contextWindow: 262144,
maxTokens: 8192,
},
],
},
},
},
}

If things aren’t working as expected, check these two common areas:

  • Provider not appearing: The xiaomi provider is injected automatically only when the XIAOMI_API_KEY environment variable is set or an authentication profile exists. Double-check that your key is exported correctly.
  • Model reference errors: Ensure you are using the full model identifier xiaomi/mimo-v2-flash in your agent settings.

If you need more help with your specific configuration, ask the AI Setup Assistant.

  • Learn more about Model Provider rules.
  • Explore how to configure different agent defaults in the config file.
OpenClaw

OpenClaw Expert

Still stuck?

If this page didn't answer your case, ask OpenClaw Expert for step-by-step guidance.