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.
What You’ll Need
Section titled “What You’ll Need”- A Xiaomi MiMo API key from the Xiaomi MiMo console.
- The OpenClaw CLI installed on your machine.
Quick Start
Section titled “Quick Start”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:
openclaw onboard --auth-choice xiaomi-api-keyIf you want to skip the questions and set it up in one go, use the non-interactive flag:
openclaw onboard --auth-choice xiaomi-api-key --xiaomi-api-key "$XIAOMI_API_KEY"Config Snippet
Section titled “Config Snippet”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, }, ], }, }, },}Troubleshooting
Section titled “Troubleshooting”If things aren’t working as expected, check these two common areas:
- Provider not appearing: The
xiaomiprovider is injected automatically only when theXIAOMI_API_KEYenvironment 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-flashin your agent settings.
If you need more help with your specific configuration, ask the AI Setup Assistant.
What’s Next
Section titled “What’s Next”- Learn more about Model Provider rules.
- Explore how to configure different agent defaults in the config file.
OpenClaw Expert
Still stuck?
If this page didn't answer your case, ask OpenClaw Expert for step-by-step guidance.