Never run out of tokens again! Monitor your Cerebras AI usage in real-time with rate limit tracking, usage predictions, and warnings before you hit your limits.
1. Install (choose one):
# Linux/macOS
curl -fsSL https://raw.githubusercontent.com/nathabonfim59/cerebras-code-monitor/main/install.sh | bash
# Windows (PowerShell)
iwr -useb https://raw.githubusercontent.com/nathabonfim59/cerebras-code-monitor/main/install.ps1 | iex2. Get your session token:
- Go to cloud.cerebras.ai and sign in
- Press F12 → Application → Cookies → copy the
authjs.session-tokenvalue - Set it:
export CEREBRAS_SESSION_TOKEN="your-token-here" - Or save it permanently in
~/.config/cerebras-monitor/settings.yaml(Windows:%APPDATA%\cerebras-monitor\settings.yaml)
3. Start monitoring:
cerebras-monitorThat's it!
- Real-time dashboard - See your usage update live
- Rate limit tracking - Never hit unexpected limits
- Multi-organization support - Switch between orgs easily
- Usage predictions - Know when you'll hit your limits
- Token consumption monitoring - Track every request
- Clean terminal interface - Beautiful, responsive display
- Automatic request interception
- Smart alerts and warnings
- Historical usage trends
- Export capabilities
# Start with default settings
cerebras-monitor
# Custom refresh rate
cerebras-monitor --refresh-rate 5
# Choose organization
cerebras-monitor --org-id your-org-idMore Installation Options
Download from the releases page.
go install github.com/nathabonfim59/cerebras-code-monitor/cmd@latestgit clone https://github.com/nathabonfim59/cerebras-code-monitor.git
cd cerebras-code-monitor
go build -o cerebras-monitor cmd/main.goAuthentication Details
Provides the most accurate data and full organization access.
- Log into Cerebras Cloud
- Extract session token from browser cookies:
- Open Developer Tools (F12)
- Go to Application → Cookies → https://cloud.cerebras.ai
- Copy the
authjs.session-tokenvalue
- Set as environment variable or save in config file
Note: The session token is HTTP-only and must be manually copied. This tool only uses it to fetch your usage data - source code is available for inspection.
Limited functionality compared to session token:
- Shows only data for that specific key
- Cannot switch organizations
- Less accurate predictions
- Each request consumes ~5 tokens for metadata
To use:
export CEREBRAS_API_KEY="your-api-key"
# or
cerebras-monitor login apikey your-api-keyConfiguration Options
| Parameter | Type | Default | Description |
|---|---|---|---|
| --session-token | string | "" | Cerebras session token |
| --org-id | string | "" | Organization ID to monitor |
| --model | string | "qwen-3-coder-480b" | Model to monitor |
| --refresh-rate | int | 10 | Data refresh rate in seconds (1-60) |
| --refresh-per-second | float | 0.75 | Display refresh rate in Hz (0.1-20.0) |
| --timezone | string | auto | Timezone (auto-detected) |
| --time-format | string | auto | Time format: 12h, 24h, or auto |
| --theme | string | auto | Display theme: light, dark, or auto |
| --log-level | string | INFO | Logging level |
| --icons | string | emoji | Icon set: emoji or nerdfont |
Understanding Cerebras Rate Limits
Cerebras enforces rate limits per API key with these response headers:
| Header | Description |
|---|---|
x-ratelimit-limit-requests-day |
Maximum requests per day |
x-ratelimit-limit-tokens-minute |
Maximum tokens per minute |
x-ratelimit-remaining-requests-day |
Requests remaining today |
x-ratelimit-remaining-tokens-minute |
Tokens remaining this minute |
x-ratelimit-reset-requests-day |
Daily limit reset time (seconds) |
x-ratelimit-reset-tokens-minute |
Minute limit reset time (seconds) |
Development & Contributing
- Go with spf13/cobra for CLI
- spf13/viper for configuration
- sqlc for database queries
- Go 1.24.5 or higher
- sqlc (for database code generation)
# Install sqlc
go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest
# Generate database code
sqlc generate
# Build
go build -o cerebras-monitor main.gogo test ./...# Create and push tag
git tag -a v0.1.0 -m "v0.1.0"
git push origin v0.1.0
# Test locally
make release-dry
# Create snapshot
make snapshotMakes requests to: https://cloud.cerebras.ai/api/graphql
Rate limit data extracted from response headers.
MIT License
Contributions welcome! Fork the repository and submit a pull request.