💰 Cursor Cost Tracker
Extension for Cursor IDE that shows real-time spend in $ on LLMs in the status bar.
Also available in: Português, Español
✨ Features
- 📊 Real-time Status Bar: Shows today's spend, current cycle spend, and last interaction cost
- 🎨 Configurable Format: Choose compact or full format
- 🔐 Automatic Token Detection: Reads the auth token from Cursor's local database
- 📄 Full Pagination: Fetches all cycle events for accurate cost calculation
- ⚠️ Threshold Alert: Get notified when on-demand spend exceeds a configured amount
- 🔄 Auto Refresh: Configurable interval (default: 60 seconds)
- 💡 Detailed Tooltip: View the last 5 interactions with model, tokens, and cost
- 🌐 Language: UI in English, Portuguese, or Spanish; follows IDE language or set in Settings
📦 Installation
Install from the VS Code Marketplace or:
- Open Extensions in Cursor (
Ctrl+Shift+X or Cmd+Shift+X)
- Search for Cursor Cost Tracker
- Click Install
Requirements: Be logged into Cursor and have access to the dashboard at cursor.com.
🚀 Usage
After installation, the extension detects your Cursor token automatically. Cost appears in the status bar (bottom right).
Commands
- Cursor Cost Tracker: Refresh data – Manually refresh usage data
- Cursor Cost Tracker: Set token manually – Set the token if auto-detection fails
⚙️ Settings
Open Preferences > Settings > Cursor Cost Tracker:
| Setting |
Description |
Default |
cursorCostTracker.refreshInterval |
Auto-refresh interval in seconds (min: 30) |
60 |
cursorCostTracker.alertThreshold |
Alert when on-demand spend exceeds this $ (0 = off) |
0 |
cursorCostTracker.statusBarFormat |
Status bar format: compact or full |
compact |
cursorCostTracker.language |
UI language: auto (follow IDE), en, pt, or es |
auto |
Compact (default):
$(pulse) $18.21 | last $0.95
Full:
$(pulse) Cursor: today $18.21 | cycle $29.82 | last $0.95
🔧 How it works
- Token detection: Tries
sqlite3 CLI to read the token from Cursor's DB (state.vscdb); falls back to sql.js.
- Data fetch: Calls Cursor's internal API (
cursor.com/api/dashboard/*) for user email, team/billing cycle, usage events, and team spend.
- Cost calculation: Filters events by logged-in user, paginates (up to 10k events per cycle), and sums today's and cycle costs.
- Display: Updates the status bar and tooltip with formatted data.
🔍 Troubleshooting
"No token found"
- Use the command Cursor Cost Tracker: Set token manually
- Open cursor.com/dashboard, DevTools (F12) → Application → Cookies
- Copy the
WorkosCursorSessionToken cookie value and paste it in the extension prompt
"Token expired"
The extension tries to refresh the token from Cursor's database. If it keeps failing, set the token manually.
"API error"
Ensure you are logged into Cursor, have dashboard access at cursor.com, and your plan is active.
⚠️ Limitations
- Uses Cursor internal APIs that may change without notice
- Requires valid, active tokens and read access to Cursor's local DB
- Pagination is capped at 20 pages (10k events) per cycle
📄 License
MIT
👩💻 Credits
By Elizabeth Carvalho.