Model providers

Using Xiaomi AI with OpenClaw

3 min read

Browse more in Model providers.

All model providers guides →

This guide shows you how to connect Xiaomi MiMo to OpenClaw so your agents can call Xiaomi’s MiMo V2 models through the OpenAI-compatible API. You will set up authentication, run the OpenClaw onboarding flow for Xiaomi, and verify that models like `xiaomi/mimo-v2-flash` are available.

By the end, your OpenClaw agents will be able to use Xiaomi MiMo for text and multimodal workloads.

Setup flow

Prerequisites

  • Access to the Xiaomi MiMo console with permission to create API keys at https://platform.xiaomimimo.com/#/console/api-keys.
  • An existing OpenClaw installation with the `openclaw` CLI available in your shell.
  • Ability to edit your OpenClaw config and environment (for example `~/.openclaw/.env` or `env.shellEnv`) so the gateway process can read `XIAOMI_API_KEY`.

Steps

  1. 1

    Create a Xiaomi MiMo API key

    Start by creating a Xiaomi MiMo API key so OpenClaw can authenticate against the Xiaomi OpenAI-compatible endpoint. You use this key both for the onboarding command and for any persistent environment configuration.

    text
    Create an API key in the [Xiaomi MiMo console](https://platform.xiaomimimo.com/#/console/api-keys).
  2. 2

    Run OpenClaw onboarding for Xiaomi using interactive auth

    Run the OpenClaw onboarding flow so it can create an auth profile for Xiaomi MiMo. This path prompts you for the API key and stores it, which is useful when you do not want to pass the key on the command line.

    bash
    openclaw onboard --auth-choice xiaomi-api-key
  3. 3

    Run OpenClaw onboarding with an existing XIAOMI_API_KEY

    If you already exported `XIAOMI_API_KEY` in your shell or CI, pass it directly to the onboarding command. This avoids interactive prompts and makes the setup scriptable.

    bash
    openclaw onboard --auth-choice xiaomi-api-key --xiaomi-api-key "$XIAOMI_API_KEY"
  4. 4

    Verify Xiaomi models are registered in OpenClaw

    After onboarding, list models for the `xiaomi` provider to confirm OpenClaw can reach the Xiaomi MiMo API. If this command returns Xiaomi model refs, your provider wiring and API key are working.

    bash
    openclaw models list --provider xiaomi
  5. 5

    Configure Xiaomi MiMo as the default agent model

    Set Xiaomi MiMo as the default model in your OpenClaw config so agents automatically use it. This config also defines the Xiaomi provider, base URL, and model metadata if you want to override the auto-injected defaults.

    json
    {
      env: { XIAOMI_API_KEY: "your-key" },
      agents: { defaults: { model: { primary: "xiaomi/mimo-v2-flash" } } },
      models: {
        mode: "merge",
        providers: {
          xiaomi: {
            baseUrl: "https://api.xiaomimimo.com/v1",
            api: "openai-completions",
            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,
              },
              {
                id: "mimo-v2-pro",
                name: "Xiaomi MiMo V2 Pro",
                reasoning: true,
                input: ["text"],
                cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
                contextWindow: 1048576,
                maxTokens: 32000,
              },
              {
                id: "mimo-v2-omni",
                name: "Xiaomi MiMo V2 Omni",
                reasoning: true,
                input: ["text", "image"],
                cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
                contextWindow: 262144,
                maxTokens: 32000,
              },
            ],
          },
        },
      },
    }
  6. 6

    Rely on auto-injection of the Xiaomi provider where possible

    OpenClaw auto-injects the `xiaomi` provider when it sees a valid `XIAOMI_API_KEY` or an auth profile, so you often do not need the full provider block. Use manual configuration only when you want to override model metadata or the base URL.

    text
    The `xiaomi` provider is injected automatically when `XIAOMI_API_KEY` is set in your environment or an auth profile exists. You do not need to manually configure the provider unless you want to override model metadata or the base URL.

Configuration

OptionDescriptionExample
XIAOMI_API_KEYAPI key for the Xiaomi MiMo OpenAI-compatible endpoint; required for OpenClaw to authenticate with the `xiaomi` provider.sk-xiaomi-mimo-1234567890abcdef
envTop-level config section where you set environment variables like `XIAOMI_API_KEY` for OpenClaw.{ XIAOMI_API_KEY: "sk-xiaomi-mimo-1234567890abcdef" }
agents.defaults.model.primarySets the default model ref your agents use; here you point it at a Xiaomi MiMo model such as `xiaomi/mimo-v2-flash`.xiaomi/mimo-v2-flash
models.modeControls how provider definitions merge with existing config; Xiaomi examples use `merge`.merge
models.providers.xiaomi.baseUrlOverrides the Xiaomi MiMo API base URL if needed; defaults to the OpenAI-compatible endpoint.https://api.xiaomimimo.com/v1
models.providers.xiaomi.apiSpecifies the Xiaomi MiMo API style; Xiaomi uses the OpenAI-compatible completions API.openai-completions
models.providers.xiaomi.apiKeyTells OpenClaw which env var holds the Xiaomi MiMo API key.XIAOMI_API_KEY

Troubleshooting

Xiaomi models do not appear when I run `openclaw models list --provider xiaomi`.

OpenClaw only injects the Xiaomi provider when it has a valid key. Confirm `XIAOMI_API_KEY` is set and valid in the environment where you run the CLI or gateway.

bash
If models do not appear, confirm `XIAOMI_API_KEY` is set and valid.

The gateway runs as a daemon but Xiaomi models are missing even though `XIAOMI_API_KEY` works in my interactive shell.

Daemon-managed gateway processes do not see variables from your interactive shell. shellEnv` so the daemon inherits it.

bash
When the Gateway runs as a daemon, ensure the key is available to that process (for example in `~/.openclaw/.env` or via `env.shellEnv`).

Frequently asked questions

Powered by Mem0

Add persistent memory to OpenClaw

Official Mem0 plugin for OpenClaw keeps context across chats and tools. Smaller prompts, lower cost, better continuity for your agents.

More in Model providers