### Pay-as-you-go API Configuration Source: https://platform.xiaomimimo.com/docs/en-US/integration/openclaw This example shows the configuration for a pay-as-you-go API setup, including authentication profiles and model provider details. ```json { "auth": { "profiles": { "xiaomi:default": { "provider": "xiaomi", "mode": "api_key" } } }, "models": { "mode": "merge", "providers": { "xiaomi": { "baseUrl": "BASE_URL", "apiKey": "API_KEY", "api": "openai-completions", "models": [ { "id": "mimo-v2.5-pro", "name": "mimo-v2.5-pro", "reasoning": true, "input": [ "text" ], "contextWindow": 1048576, "maxTokens": 32000 }, { "id": "mimo-v2.5", "name": "mimo-v2.5", "reasoning": true, "input": [ "text", "image" ], "contextWindow": 262144, "maxTokens": 32000 } ] } } }, "agents": { "defaults": { "model": { "primary": "xiaomi/mimo-v2.5-pro" }, "models": { "xiaomi/mimo-v2.5": {}, "xiaomi/mimo-v2.5-pro": {} } } } } ``` -------------------------------- ### Install Qwen Code CLI for Windows Source: https://platform.xiaomimimo.com/docs/en-US/integration/qwencode This command downloads the Windows installation script and then executes it to install the Qwen Code CLI. Ensure you have curl installed. ```bash curl -fsSL -o %TEMP%\install-qwen.bat https://qwen-code-assets.oss-cn-hangzhou.aliyuncs.com/installation/install-qwen.bat && %TEMP%\install-qwen.bat --source bailian ``` -------------------------------- ### Start OpenClaw Interactive Configuration Source: https://platform.xiaomimimo.com/docs/en-US/integration/openclaw Initiates the interactive configuration wizard for OpenClaw after installation. This method is recommended for MiMo pay-as-you-go API configuration. ```bash openclaw onboard --install-daemon ``` -------------------------------- ### Verify Qwen Code CLI Installation Source: https://platform.xiaomimimo.com/docs/en-US/integration/qwencode Run this command after installation to verify that Qwen Code CLI has been installed successfully. A version number output confirms the installation. ```bash qwen --version ``` -------------------------------- ### OpenCode Configuration File Example Source: https://platform.xiaomimimo.com/docs/en-US/integration/opencode This is an example of the opencode.json configuration file. Replace BASE_URL and MIMO_API_KEY with your actual credentials. ```json { "$schema": "https://opencode.ai/config.json", "provider": { "mimo": { "npm": "@ai-sdk/openai-compatible", "name": "MiMo", "options": { "baseURL": "BASE_URL", "apiKey": "MIMO_API_KEY" }, "models": { "mimo-v2.5-pro": { "name": "mimo-v2.5-pro", "limit": { "context": 1048576, "output": 131072 }, "modalities": { "input": [ "text" ], "output": [ "text" ] } }, "mimo-v2.5": { "name": "mimo-v2.5", "limit": { "context": 1048576, "output": 131072 }, "modalities": { "input": [ "text", "image" ], "output": [ "text" ] } } } } } } ``` -------------------------------- ### Install Qwen Code CLI for macOS/Linux Source: https://platform.xiaomimimo.com/docs/en-US/integration/qwencode Use this command to install the Qwen Code CLI on macOS or Linux systems. It fetches the installation script and executes it. ```bash bash -c "$(curl -fsSL https://qwen-code-assets.oss-cn-hangzhou.aliyuncs.com/installation/install-qwen.sh)" -s --source bailian ``` -------------------------------- ### Start OpenCode CLI Source: https://platform.xiaomimimo.com/docs/en-US/integration/opencode Run this command in your project directory after completing the configuration to start the OpenCode CLI. ```bash opencode ``` -------------------------------- ### Install Cline CLI Source: https://platform.xiaomimimo.com/docs/en-US/integration/cline Install the Cline CLI globally using npm. Ensure Node.js 20 or later is installed. ```bash npm install -g cline ``` -------------------------------- ### Install Kilo CLI for Windows x64 Source: https://platform.xiaomimimo.com/docs/en-US/integration/kilocode Use this command to manually install the Kilo CLI for Windows x64 if the package manager fails to install the correct version. ```bash npm install -g @kilocode/cli-windows-x64 ``` -------------------------------- ### Start Qwen Code CLI Source: https://platform.xiaomimimo.com/docs/en-US/integration/qwencode After configuring the settings, run this command in a new terminal to start the Qwen Code CLI and begin using MiMo models. ```bash qwen ``` -------------------------------- ### Install OpenClaw on Windows (PowerShell) Source: https://platform.xiaomimimo.com/docs/en-US/integration/openclaw Installs OpenClaw using a PowerShell command. Ensure Node.js 22 or later is installed. ```powershell iwr -useb https://openclaw.ai/install.ps1 | iex ``` -------------------------------- ### Start CodeBuddy CLI Source: https://platform.xiaomimimo.com/docs/en-US/integration/codebuddy Navigate to your project directory and initiate the CodeBuddy CLI. Once started, you can use commands like `/model` to manage models and `/status` to check the current model. ```bash codebuddy ``` -------------------------------- ### Install OpenClaw on macOS/Linux Source: https://platform.xiaomimimo.com/docs/en-US/integration/openclaw Installs OpenClaw using a curl command. Ensure Node.js 22 or later is installed. ```bash curl -fsSL https://openclaw.ai/install.sh | bash ``` -------------------------------- ### Verify CodeBuddy CLI Installation Source: https://platform.xiaomimimo.com/docs/en-US/integration/codebuddy Check if the CodeBuddy CLI has been installed successfully by running the version command. A displayed version number indicates a successful installation. ```bash codebuddy --version ``` -------------------------------- ### Install OpenCode CLI for Windows Source: https://platform.xiaomimimo.com/docs/en-US/integration/opencode Use this command to manually install the opencode CLI for Windows if the package manager fails. ```bash npm install -g opencode-windows-x64 ``` -------------------------------- ### Install OpenAI Python SDK Source: https://platform.xiaomimimo.com/docs/en-US/quick-start/first-api-call Install the OpenAI Python SDK to interact with the MiMo API using the OpenAI format. If pip fails, try pip3. ```bash # If the run fails, you can replace pip with pip3 and run again pip install -U openai ``` -------------------------------- ### Verify OpenCode CLI Installation Source: https://platform.xiaomimimo.com/docs/en-US/integration/opencode Run this command to verify that the OpenCode CLI has been installed successfully. A version number indicates success. ```bash opencode -v ``` -------------------------------- ### Install Hermes Agent Source: https://platform.xiaomimimo.com/docs/en-US/integration/hermes-agent Use this command to install the Hermes Agent on Linux or macOS. Ensure WSL2 is installed if using Windows. ```bash curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash ``` -------------------------------- ### Start Kilo Code CLI Source: https://platform.xiaomimimo.com/docs/en-US/integration/kilocode Start the Kilo Code CLI after completing the configuration. You can then use commands like /models to switch between available models. ```bash kilocode ``` -------------------------------- ### Install OpenCode CLI with Official Script Source: https://platform.xiaomimimo.com/docs/en-US/integration/opencode Use this command to install the OpenCode CLI on macOS or Linux systems. ```bash curl -fsSL https://opencode.ai/install | bash ``` -------------------------------- ### Install OpenCode CLI with npm Source: https://platform.xiaomimimo.com/docs/en-US/integration/opencode Install the OpenCode CLI using npm. Requires Node.js version 18 or later. ```bash npm install -g opencode-ai ``` -------------------------------- ### Multi-turn Tool Call Example Source: https://platform.xiaomimimo.com/docs/en-US/quick-start/first-api-call This example shows how to handle multi-turn conversations with tool calls in thinking mode. It includes previous assistant reasoning and user messages to maintain context. ```curl curl --location --request POST 'https://api.xiaomimimo.com/v1/chat/completions' \ --header "api-key: $MIMO_API_KEY" \ --header "Content-Type: application/json" \ --data-raw '{ "messages": [ { "role": "assistant", "content": "Hello! I am MiMo.", "reasoning_content": "Okay, the user just asked me to introduce myself. That is a pretty straightforward request, but I should think about why they are asking this." }, { "role": "user", "content": "What is the weather like in Hebei?" } ], "model": "mimo-v2.5-pro", "max_completion_tokens": 1024, "temperature": 1.0, "stream": false, "tools": [ { "type": "function", "function": { "name": "get_current_weather", "description": "Get the current weather in a given location", "parameters": { "type": "object", "properties": { "location": { "type": "string", "description": "The city and state, e.g. San Francisco, CA" }, "unit": { "type": "string", "enum": [ "celsius", "fahrenheit" ] } }, "required": [ "location" ] } } } ], "tool_choice": "auto" }' ``` -------------------------------- ### Install Anthropic Python SDK Source: https://platform.xiaomimimo.com/docs/en-US/quick-start/first-api-call Install the Anthropic Python SDK to interact with the MiMo API using the Anthropic format. If pip fails, try pip3. ```bash # If the run fails, you can replace pip with pip3 and run again pip install -U anthropic ``` -------------------------------- ### Install Kilo Code CLI Source: https://platform.xiaomimimo.com/docs/en-US/integration/kilocode Install the Kilo Code CLI globally using npm. Node.js 18 or later is required. ```bash npm install -g @kilocode/cli ``` -------------------------------- ### Web Search Response Example Source: https://platform.xiaomimimo.com/docs/en-US/usage-guide/tool-calling/web-search This is an example of the JSON response received after a web search tool call. It includes the assistant's answer and citations to the sources used. ```json { "id": "d9cbdd74d5384247a3b9f03580901588", "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "根据搜索结果,武汉明天(2026年4月23日,周四)的天气情况如下:\n\n* **天气状况**:白天为阴天,夜间转为晴天。\n* **气温范围**:最高气温18℃,最低气温10℃。\n* **风力风向**:北风,风力较小,为微风(风力小于3级)。\n\n**综合来看**,明天武汉白天阴天,夜间放晴,气温相比今天(4月22日)有所回升,但昼夜温差仍达8℃左右。建议您根据早晚和午后的温差,采用“洋葱式穿衣法”,方便随时增减衣物。明天无需携带雨具,适合进行户外活动。", "role": "assistant", "annotations": [ { "type": "url_citation", "url": "https://news.qq.com/rain/a/20260422A03GDF00", "title": "小雨转晴再迎小雨!武汉未来三天阴晴交替,湿度大温差显_腾讯新闻", "summary": "今天是2026年4月22日,武汉白天天气为小雨,北风微风,夜晚天气为多云,北风微风,最高气温15°C,最低气温11°C,空气湿度92%,体感温度9.5°C,空气质量优。雨天道路湿滑,出行请携带雨具,注意防滑,驾车保持安全车距。明日武汉天气为阴,微风,夜间晴,微风,最高气温18°C,最低气温10°C。未来三天,武汉天气以阴到多云为主,24日夜间转小雨,25日白天有小雨,气温逐步回升,最高气温从18°C升至25°C,最低气温从10°C升至13°C,昼夜风力均为微风。降雨时段需注意低洼路段可能短时积水,建议提前检查排水设施,避免涉水通行。近期武汉天气总体平稳,但阴雨相间,湿度偏高,体感偏凉;24日起气温明显回升,昼夜温差达11°C左右。建议采用洋葱式穿衣法,兼顾早晚清凉与午后温和;室内注意通风除湿,防范衣物、食品受潮霉变;雨天晾晒条件不佳,可优先使用烘干设备。此稿由AI生成(来源:极目新闻)", "site_name": "腾讯网", "publish_time": "2026-04-22T11:24:12+08:00", "logo_url": "https://th.bochaai.com/favicon?domain_url=https://news.qq.com/rain/a/20260422A03GDF00" }, { "type": "url_citation", "url": "https://bocha.cn/share/e79b4068-66c6-4f13-bae2-ecbd48336bc5", "title": "2026年04月22日武汉天气预报", "summary": "2026年04月22日武汉天气预报:\n04/22 (周三):\n天气:小雨转多云,温度:16/11°C,风向风力:北风<3级\n04/23 (周四):\n天气:阴转晴,温度:18/10°C,风向风力:北风<3级\n04/24 (周五):\n天气:小雨,温度:22/13°C,风向风力:北风<3级\n04/25 (周六):\n天气:多云转晴,温度:25/13°C,风向风力:北风<3级\n04/26 (周日):\n天气:多云转阴,温度:28/17°C,风向风力:北风<3级\n04/27 (周一):\n天气:阴转晴,温度:28/18°C,风向风力:北风<3级\n04/28 (周二):\n天气:多云转阴,温度:29/19°C,风向风力:北风<3级", "site_name": "博查", "publish_time": "2026-04-22T00:00:00+08:00", "logo_url": "https://th.bochaai.com/favicon?domain_url=https://bocha.cn/share/e79b4068-66c6-4f13-bae2-ecbd48336bc5" }, { "type": "url_citation", "url": "https://news.qq.com/rain/a/20260421A06R9300", "title": "【明日天气预报】武汉2026年04月22日天气预报,小雨转多云,北风转北风<3级_腾讯新闻", "summary": "", "site_name": "腾讯网", "publish_time": null, "logo_url": "https://th.bochaai.com/favicon?domain_url=https://news.qq.com/rain/a/20260421A06R9300" } ] } } ] } ``` -------------------------------- ### Start Hermes Agent Source: https://platform.xiaomimimo.com/docs/en-US/integration/hermes-agent Run this command to start the Hermes Agent in classic CLI mode. Use the --tui flag for the modern TUI mode. ```bash hermes # Classic CLI mode hermes --tui # Modern TUI mode ``` -------------------------------- ### Verify Cline CLI Installation Source: https://platform.xiaomimimo.com/docs/en-US/integration/cline Check if the Cline CLI was installed successfully by running the version command. A version number indicates a successful installation. ```bash cline --version ``` -------------------------------- ### Verify Kilo Code CLI Installation Source: https://platform.xiaomimimo.com/docs/en-US/integration/kilocode Verify the installation of Kilo Code CLI by checking its version. This command should display the installed version number upon success. ```bash kilocode --version ``` -------------------------------- ### Start Cline CLI Source: https://platform.xiaomimimo.com/docs/en-US/integration/cline Launch the Cline CLI after completing the configuration. A new terminal session is recommended. ```bash cline ``` -------------------------------- ### Verify Claude Code CLI Installation Source: https://platform.xiaomimimo.com/docs/en-US/integration/claudecode Checks if the Claude Code CLI has been installed successfully by displaying its version number. ```bash claude --version ``` -------------------------------- ### Initialize OpenAI Client and Define Tools Source: https://platform.xiaomimimo.com/docs/en-US/usage-guide/passing-back-reasoning_content This Python code initializes the OpenAI client with a specific base URL and API key, and defines a list of available tools for function calling. Ensure your MIMO_API_KEY environment variable is set. ```python import os import json from openai import OpenAI # Initialize client client = OpenAI( api_key=os.environ.get("MIMO_API_KEY"), base_url="https://api.xiaomimimo.com/v1" ) # Define tools tools = [ { "type": "function", "function": { "name": "get_current_weather", "description": "Get the current weather for a given city", "parameters": { "type": "object", "properties": { "location": {"type": "string", "description": "City name, e.g. Beijing"}, "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]} }, "required": ["location"] } } }, { "type": "function", "function": { "name": "get_time", "description": "Get the current time in a given timezone", "parameters": { "type": "object", "properties": { "timezone": {"type": "string", "description": "Timezone, e.g. Asia/Shanghai"} }, "required": ["timezone"] } } } ] ``` -------------------------------- ### Making Multi-Turn Tool Calls Source: https://platform.xiaomimimo.com/docs/en-US/faq This example demonstrates how to make multi-turn tool calls in thinking mode. It includes previous reasoning content in the messages array for continued conversation. Ensure your API key is correctly set in the header. ```bash curl --location --request POST 'https://api.xiaomimimo.com/v1/chat/completions' \ --header "api-key: $MIMO_API_KEY" \ --header "Content-Type: application/json" \ --data-raw '{ "messages": [ { "role": "assistant", "content": "Hello! I am MiMo.", "reasoning_content": "Okay, the user just asked me to introduce myself. That is a pretty straightforward request, but I should think about why they are asking this." }, { "role": "user", "content": "What is the weather like in Hebei?" } ], "model": "mimo-v2.5-pro", "max_completion_tokens": 1024, "temperature": 1.0, "stream": false, "tools": [ { "type": "function", "function": { "name": "get_current_weather", "description": "Get the current weather in a given location", "parameters": { "type": "object", "properties": { "location": { "type": "string", "description": "The city and state, e.g. San Francisco, CA" }, "unit": { "type": "string", "enum": [ "celsius", "fahrenheit" ] } }, "required": [ "location" ] } } } ], "tool_choice": "auto" }' ```