docs/mimo.md
The Xiaomi MiMo provider tracks your current balance from the Xiaomi MiMo console.
Cookie: header.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.
https://platform.xiaomimimo.com/#/console/balanceCookie: header from your browser’s Network tabhttps://platform.xiaomimimo.com/api/v1api-platform_serviceToken and userId cookiesapi-platform_ph and api-platform_slh when presentMIMO_API_URL to override the base API URL for testingLog 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 your PATH:
ln -sf "$(pwd)/Scripts/mimo-usage.py" ~/.local/bin/mimo-usage
chmod +x ~/.local/bin/mimo-usage
Run mimo-usage --update once to populate ~/.codexbar/mimo-local-usage.json. The tracker scans ~/.claude-envs/mimo/.claude/projects/**/*.jsonl (default path for a cc-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 --update post-exec from your MiMo CLI launcher) or via a launchd / cron job every 5 minutes.
CodexBar picks up the file on its next refresh. The MiMo card displays Xiaomi MiMo (local) with a Local · <today> · <week> · <lifetime> · <sessions> summary and the cache's actual update time. Local activity is not rendered as a quota percentage. The Balance updates / Daily billing finalizes footer is suppressed for local source since neither applies.
"$CLAUDE_CLI" "$@"
_exit=$?
mimo-usage --update 2>/dev/null || true
exit $_exit
MIMO_CLAUDE_HOME and the cache path with MIMO_LOCAL_USAGE_PATH when a wrapper uses non-default locations.~/.codexbar/mimo-local-usage.json) is internal; do not rely on the JSON shape for external tooling.