Cursor Spend Tracker

A Cursor extension that shows your AI spend in the status bar — per session,
today, and month — with team-wide comparison via the
Cursor Admin API.
- Session — your spend since the last session reset.
- Today —
$you / $team (%) — your spend today vs the whole team.
- Month —
$you / $team (%) — same for the current billing cycle.
- Team —
$you / $median — your month spend vs team median
(green if below, red if above).
Clicking any item opens a details panel with recent events and a team
members table.



Note: Requires a Cursor Team Admin API key (read-only works).
The extension also reads your email from Cursor's local SQLite DB to
identify you in team data. All data stays local — the extension only
contacts api.cursor.com.
Features
| Item |
Source |
Notes |
| Session |
/teams/filtered-usage-events |
Baseline is set when you run Reset current session. |
| Today |
Same endpoint, all team events |
Personal + team total for current local day. |
| Month |
/teams/spend |
Includes both on-demand and subscription spend. |
| Team |
/teams/spend + median |
Color-coded comparison with team median. |
Quick Install
- Download the latest
.vsix from Open VSX (click Download on the right side).
- In Cursor: Extensions → ⋯ (top-right menu) → Install from VSIX… → select the downloaded file.
- Restart Cursor.
That's it — you should see the status bar items after restart.
Install from Source
git clone https://github.com/uma-robots/cursor_spend.git
cd cursor_spend
npm install
npm run install-ext
This compiles the TypeScript, packages a .vsix, and installs it into Cursor.
Restart Cursor after the command completes.
Other options:
- Run from source — open the folder in Cursor and press F5 to
launch an Extension Development Host.
- Package only —
npm run package creates a .vsix file you can share.
Setup
Open Team Settings in your browser.

Scroll down to Advanced → API Keys, create a new key with Read-only scope, and save it.

In Cursor, open the Command Palette (⌘+⇧+P on macOS / Ctrl+Shift+P on Windows/Linux), run Cursor Spend: Set Team Admin API key, and paste the key.
The extension auto-detects your email from Cursor's local DB. If that fails,
set cursorSpendTracker.userEmail in settings.
See Cursor Admin API docs.
Commands
| Command |
What it does |
Cursor Spend: Refresh now |
Force an immediate poll. |
Cursor Spend: Reset current session counter |
Sets the session baseline to now. Also bound to clicking the Session item. |
Cursor Spend: Show details |
Opens the details webview with events and team members table. |
Cursor Spend: Set Team Admin API key |
Stores a Cursor Admin API key in VS Code Secret Storage (never logged). |
Cursor Spend: Clear Team Admin API key |
Removes the stored key. |
Cursor Spend: Show log |
Opens the extension output channel for debugging. |
Cursor Spend: Load demo data |
Fills the status bar with sample data for visual testing. |
Settings
{
"cursorSpendTracker.refreshIntervalSeconds": 60,
"cursorSpendTracker.showSession": true,
"cursorSpendTracker.showToday": true,
"cursorSpendTracker.showMonth": true,
"cursorSpendTracker.showTeam": true,
"cursorSpendTracker.teamMedianColorCoding": true,
"cursorSpendTracker.autoResetSessionOnNewWindow": false,
"cursorSpendTracker.userEmail": ""
}
How the session counter works
The counter uses a baseline-delta strategy:
- When the extension activates (or you run Reset current session), the
current time is saved as the session start.
- On every poll, events from
/teams/filtered-usage-events are filtered by
your email and the baseline timestamp, then chargedCents is summed.
Click the Session status-bar item (or run Reset current session) to
restart the counter.
Security
- API key is stored in VS Code Secret Storage (Keychain on macOS,
Credential Vault on Windows, libsecret on Linux). Never logged.
- A read-only API key gives access to usage data but cannot modify
team settings, remove members, or change spend limits.
- Your email is read from Cursor's local SQLite DB (
state.vscdb) for
user identification only — no session cookies or JWTs are used.
- No analytics. No third-party servers. Only
api.cursor.com is contacted.
Project layout
src/
extension.ts # activation, polling loop, commands, details panel
auth.ts # read email from Cursor's local SQLite DB
cursorApi.ts # Admin API clients (events, spend), median helper
statusBar.ts # status bar rendering
format.ts # cents → human string
Known limitations
- The session counter is time-based, not conversation-based (see above).
- Usage events from Cursor are aggregated hourly, so recent events may take
a minute or two to appear.
- Rate limit: Admin API allows 20 requests/minute. Default poll interval (60s)
uses ~2-4 requests per cycle, well within limits.
License
MIT