A GNOME Shell extension that displays your Kimi Code subscription usage as a compact circular indicator in the top panel.
- Outer Ring — Session usage (5-hour rolling window)
- Inner Circle — Weekly usage
- Clock Hand — A pointer rotating around the ring, indicating how far through the current session window you are (0% at start → 100% at reset)
- Popup Menu — Click the indicator to see exact percentages with time-to-reset in parentheses (e.g.
Weekly: 5% (6d 19h)), your membership plan, parallel request limit, and a manual refresh button - Auto Refresh — Fetches data every 60 seconds (configurable)
- Retry on Failure — If the initial fetch fails, retries 3 times with 1s / 2s / 4s backoff
make all
cp -r . ~/.local/share/gnome-shell/extensions/kimi-code-usage@lanesun.anlbrain.com/
glib-compile-schemas ~/.local/share/gnome-shell/extensions/kimi-code-usage@lanesun.anlbrain.com/schemas/Restart GNOME Shell (log out and back in on Wayland), then enable the extension:
gnome-extensions enable kimi-code-usage@lanesun.anlbrain.comThe extension fetches usage data from https://api.kimi.com/coding/v1/usages, which requires a Kimi Code API key.
- Log in to kimi.com/code
- Create an API key in your console
- The key looks like
sk-kimi-...
- Open the extension settings (via Extensions app or
gnome-extensions prefs kimi-code-usage@lanesun.anlbrain.com) - Under Kimi Code, paste the key into the API Key field and confirm
- The indicator fetches data immediately on next enable, and refreshes every 60 seconds
All visual parameters are configurable in the settings:
| Setting | Description |
|---|---|
| Ring Color / Thickness / Gap | Outer ring appearance (session usage) |
| Circle Color / Radius | Inner circle appearance (weekly usage) |
| Hand Color / Length / Thickness | Clock hand appearance |
| Hand Outline Color / Width | Hand border for visibility |
| Panel Position | Left / Center / Right |
| Position Index | Sort order within the panel |
| Update Interval | Auto-refresh interval in seconds (default: 60) |
The extension sends an authenticated GET request to https://api.kimi.com/coding/v1/usages
(same endpoint used by cc-switch for quota display)
with an Authorization: Bearer <API key> header and parses the JSON response:
usage— weekly quota (used/limit,resetTime)limits[]— rolling windows; the 300-minute (5h) entry is the session quotauser.membership.level— membership plan shown in the menuparallel.limit— max parallel requests shown in the menu
If the fetch fails or returns no quota data, all indicators show 0% and the popup menu displays the failure reason. The last successful reading stays visible while transient failures recover.
MIT
