A Chrome extension that logs quota usage from the Kimi Code console page.
This extension monitors the Kimi Code console page and automatically records quota usage data every minute. The collected data can be exported as CSV for further analysis.
- Automatically detects when Kimi Code console page is open
- Refreshes page and captures quota data every minute
- Records weekly usage percentage and reset countdown
- Records rate limit percentage and reset countdown
- Supports English, Simplified Chinese, and Traditional Chinese interfaces
- Exports data as CSV for external analysis
- Dynamic toolbar icon shows:
- Green dot (top-right): Recording is active
- Red badge (bottom-right): Number of logged entries
kimi-quota-logger/
├── manifest.json # Extension configuration (Manifest V3)
├── background.js # Service worker for alarms and message handling
├── content.js # Content script for DOM scraping
├── offscreen.html # Offscreen document for canvas rendering
├── offscreen.js # Dynamic icon generation
├── popup/
│ ├── popup.html # Popup UI
│ ├── popup.css # Popup styles
│ └── popup.js # Popup logic
├── icons/
│ ├── icon16.png # 16x16 icon
│ ├── icon48.png # 48x48 icon
│ └── icon128.png # 128x128 icon
├── assets/
│ └── kimi-quota-logger-demo.gif
├── tools/
│ ├── generate-icons.html # Browser-based icon generator
│ └── generate-icons.ps1 # PowerShell icon generator
├── LICENSE
└── README.md
-
Clone or download this repository:
git clone https://github.com/fatfingererr/kimi-quota-logger.git
-
Open Chrome and navigate to
chrome://extensions/ -
Enable Developer mode (toggle in top right corner)
-
Click Load unpacked
-
Select the
kimi-quota-loggerfolder
-
Log in to your Kimi Code account
-
Open the console page: https://www.kimi.com/code/console
-
The extension starts recording automatically after 1 minute
-
Check the toolbar icon for status:
- Green dot: Recording is active
- Red number: Count of logged entries
-
Click the extension icon to:
- View current status
- See the latest captured data
- Download all logs as CSV
- Clear stored logs
-
When the console page is detected, the extension sets up a 1-minute interval alarm
-
On each alarm trigger:
- The console page is refreshed
- Waits 5 seconds for page load
- Captures quota data from the DOM
-
Captured data is stored in
chrome.storage.local -
The toolbar icon updates dynamically to show recording status and log count
| Field | Type | Description |
|---|---|---|
timestamp |
string | ISO 8601 UTC timestamp |
localTime |
string | Local time (Asia/Taipei timezone) |
weeklyUsagePercent |
number | Weekly quota usage percentage (0-100) |
weeklyResetCountdown |
string | Time until weekly reset (e.g., "119h") |
weeklyResetHours |
number | Hours until weekly quota resets |
rateLimitPercent |
number | Rate limit usage percentage (0-100) |
rateLimitResetCountdown |
string | Time until rate limit resets (e.g., "1h") |
rateLimitResetMinutes |
number | Minutes until rate limit resets |
The exported CSV file:
- Uses UTF-8 encoding with BOM (Excel compatible)
- Filename format:
kimi-quota-logs-YYYY-MM-DD.csv - Contains all captured data fields
- Go to
chrome://extensions/ - Find "Kimi Code Quota Logger"
- Click Service Worker link
- View logs in the DevTools window
- Open the Kimi Code console page
- Press F12 to open DevTools
- Go to Console tab
- Filter by
[Kimi Quota Logger]
Using browser:
- Open
tools/generate-icons.htmlin Chrome - Click download buttons for each size
- Replace files in
icons/folder
Using PowerShell:
powershell -ExecutionPolicy Bypass -File tools/generate-icons.ps1| Permission | Purpose |
|---|---|
alarms |
Schedule periodic quota capture |
storage |
Store captured log data |
tabs |
Detect and refresh console page |
downloads |
Export CSV files |
offscreen |
Generate dynamic icons with canvas |
Data is stored in chrome.storage.local:
- Default limit: 10 MB
- Approximately 200 bytes per log entry
- ~50,000 entries capacity (~35 days of continuous logging)
Use Clear Logs button after exporting to free up storage.
