| summary | Xiaomi MiMo provider notes: cookie auth, balance endpoint, and setup. | |||
|---|---|---|---|---|
| read_when |
|
The Xiaomi MiMo provider tracks your current balance from the Xiaomi MiMo console.
- Balance display: Shows total balance plus paid and granted components when MiMo returns them.
- Token plan usage: Shows current token-plan credits while retaining balance as a second metric.
- Cookie-based auth: Uses browser cookies or a pasted
Cookie:header. - Near-real-time updates: Balance usually reflects within a few minutes.
- Open Settings → Providers
- Enable Xiaomi MiMo
- Leave Cookie source on Auto (recommended)
CodexBar imports cookies from these browsers in order: Safari, Chrome / Chrome Beta / Chrome Canary, Firefox, and Microsoft Edge. Switch to Manual and paste a Cookie: header if your active MiMo session lives in Arc, Brave, or another browser profile CodexBar does not auto-detect.
Safari cookie import may require granting CodexBar Full Disk Access in System Settings → Privacy & Security.
- Open
https://platform.xiaomimimo.com/#/console/balance - Copy a
Cookie:header from your browser’s Network tab - Paste it into Xiaomi MiMo → Cookie source → Manual
- Fetches balance and token-plan detail/usage endpoints under
https://platform.xiaomimimo.com/api/v1 - Requires the
api-platform_serviceTokenanduserIdcookies - Accepts optional MiMo cookies like
api-platform_phandapi-platform_slhwhen present - Supports
MIMO_API_URLto override the base API URL for testing
- Token cost, status polling, and debug log output are not supported yet
- Widgets do not support Xiaomi MiMo yet
- Auto import covers Safari, Chrome variants, Firefox, and Edge only; other browsers use Manual mode
Log in at https://platform.xiaomimimo.com/#/console/balance in Safari, Chrome, Firefox, or Edge, then refresh CodexBar. If your session lives in another browser, switch the MiMo provider to Cookie source → Manual and paste the Cookie: header instead.
The pasted header or imported browser session is missing required cookies. Re-copy the request from the balance page after logging in again.
Your MiMo login is stale. Sign out and back in on the MiMo site, then refresh CodexBar.
When the platform.xiaomimimo.com cookie path is unavailable — Chrome session cookies expire on Chrome relaunch, Chrome Safe Storage keychain access blocked, no SSO login from this machine, etc. — and you drive MiMo inference through a local wrapper such as cc-mimo (Claude Code CLI with ANTHROPIC_BASE_URL=https://token-plan-sgp.xiaomimimo.com/anthropic), CodexBar can surface local token accounting from that wrapper’s session jsonl as graceful degradation — the MiMo card shows lifetime/weekly token sums instead of login required.
This fallback is implicit opt-in: it only activates when ~/.codexbar/mimo-local-usage.json exists. Users who do not run a local wrapper see no change.
-
Drop
Scripts/mimo-usage.py(shipped with this repo) into yourPATH:ln -sf "$(pwd)/Scripts/mimo-usage.py" ~/.local/bin/mimo-usage chmod +x ~/.local/bin/mimo-usage
-
Run
mimo-usage --updateonce to populate~/.codexbar/mimo-local-usage.json. The tracker scans~/.claude-envs/mimo/.claude/projects/**/*.jsonl(default path for acc-mimo-style wrapper) and aggregates input, output, cache-read, and cache-creation tokens per time window (today / this week / all time). -
Trigger updates either on each wrapper invocation (recommended — call
mimo-usage --updatepost-exec from your MiMo CLI launcher) or via alaunchd/cronjob every 5 minutes. -
CodexBar picks up the file on its next refresh. The MiMo card displays
Xiaomi MiMo (local)with aLocal · <today> · <week> · <lifetime> · <sessions>summary and the cache's actual update time. Local activity is not rendered as a quota percentage. TheBalance updates / Daily billing finalizesfooter is suppressed forlocalsource since neither applies.
"$CLAUDE_CLI" "$@"
_exit=$?
mimo-usage --update 2>/dev/null || true
exit $_exit- Local accounting only — this is not real platform quota. The Xiaomi platform may rate-limit your account before your local counter reflects it.
- Override the session root with
MIMO_CLAUDE_HOMEand the cache path withMIMO_LOCAL_USAGE_PATHwhen a wrapper uses non-default locations. - Cache schema (
~/.codexbar/mimo-local-usage.json) is internal; do not rely on the JSON shape for external tooling.