MiMo Code Integration
Use Claude and GPT models with MiMo Code. Custom provider configuration in a few steps, with full cost tracking.
MiMo Code is an AI-powered coding agent command-line tool developed by Xiaomi. It can understand your code repository, plan changes, safely execute shell commands, edit files, and autonomously manage complex software development tasks in your terminal.
By configuring MiMo Code to route through Halfbill, you can point it at Claude and GPT models while keeping the same API format MiMo Code expects, with full cost tracking in your dashboard.
Using Halfbill Code? This integration also works with a Halfbill
Code plan key. Use the canonical model IDs from
the catalogue (for example claude-sonnet-5).
Prerequisites
- A Halfbill API key — sign up
Setup
Install MiMo Code
If you haven't already, install MiMo Code by running the installation command in your terminal:
curl -fsSL https://mimo.xiaomi.com/install | bashConfirm the installation by checking the help command:
mimo --helpConfigure mimocode.json
Create or edit your MiMo Code configuration file at ~/.config/mimocode/mimocode.json (on Linux/macOS) or ~/.mimocode/mimocode.json.
Specify the default models you want to use and route the anthropic provider to your Halfbill endpoint. Here is an example configuration that sets up Claude Opus 5, Claude Haiku 4.5, and GPT-5.5:
{
"model": "anthropic/claude-opus-5",
"small_model": "anthropic/claude-haiku-4-5",
"provider": {
"anthropic": {
"options": {
"apiKey": "llmgtwy_your_api_key_here",
"baseURL": "https://api.halfbill.uk/v1"
},
"models": {
"gpt-5.5": {
"name": "gpt-5.5"
},
"claude-opus-5": {
"name": "claude-opus-5"
},
"claude-haiku-4-5": {
"name": "claude-haiku-4-5"
}
}
}
}
}Replace llmgtwy_your_api_key_here with your actual Halfbill API key from the
dashboard.
Alternatively: Use Environment Variables
If you prefer to configure the provider dynamically, you can export the standard Anthropic environment variables before starting MiMo Code:
export ANTHROPIC_API_KEY=llmgtwy_your_api_key_here
export ANTHROPIC_BASE_URL=https://api.halfbill.uk/v1Run MiMo Code
Navigate to your project folder and launch the TUI or run a prompt directly:
mimoOr run it with a message:
mimo run "Your coding prompt here"All requests will now be routed through Halfbill, allowing you to use advanced models for local autonomous coding while showing real-time usage and cost statistics on your Halfbill dashboard.

Configuration Details
The Provider Options
To point MiMo Code to Halfbill, you define the baseURL and apiKey inside the options of the anthropic provider block.
"provider": {
"anthropic": {
"options": {
"apiKey": "llmgtwy_your_api_key_here",
"baseURL": "https://api.halfbill.uk/v1"
}
}
}Defining Custom Models
Because MiMo Code CLI restricts requests to built-in models by default, any custom model you wish to target (such as gpt-5.5 or claude-opus-5) must be registered in the models dictionary within the anthropic provider config:
"models": {
"gpt-5.5": {
"name": "gpt-5.5"
}
}Once registered, you can set them as your default model or small model using the anthropic/ prefix (e.g. "model": "anthropic/gpt-5.5").
Why Use Halfbill with MiMo Code
- Claude and GPT — Anthropic and OpenAI models at half list price in a single CLI configuration.
- Unified cost tracking — Get a detailed breakdown of costs per prompt and session in your dashboard.
- Response caching — Automatically cache repeated requests (such as parsing or building commands) to save API costs.
View all available models on the models page.
Need help? Email support@halfbill.uk.
How is this guide?