fix: Cursor spend ignores chargedCents and undercounts the dashboard bill
What happened
On an Enterprise Cursor account, CodeBurn's Cursor dollar total is a small fraction of the amount Cursor's own dashboard bills for the same window.
Menubar v0.9.24, Today / Local, Cursor chip: about $3. Cursor CLI 0.9.25 local result cache for that same local day: 313 calls, all with costIsEstimated: true, about $3.
POST https://cursor.com/api/dashboard/get-aggregated-usage-events with startDate / endDate covering that UTC day returned a charged total about 45x higher. For the billing cycle (1 Sep 2026 through 1 Oct 2026) the dashboard aggregate was about 16x the Cursor plus Cursor Agent dollars CodeBurn had stored for the cycle. CodeBurn only had Cursor rows on 22–24 Sep. The dashboard cycle total is dominated by default and claude-opus-5-5-medium, plus a small composer-2.5-fast and gpt-5.6-sol-medium remainder.
get-filtered-usage-events reported on the order of 70,000 usage events for the cycle. The local provider saw on the order of 3,000 calls. A chargeable event carries chargedCents, requestsCosts, and cursorTokenFee (kind USAGE_EVENT_KIND_INCLUDED_IN_BUSINESS, isChargeable: true). The token fee is a large part of chargedCents. None of that is in the local bubble row CodeBurn prices.
What you expected
The Cursor dollar total should match the amount Cursor charges for that window, or be visibly marked as a local estimate that is not the bill. Today every Cursor call is costIsEstimated: true, and the menubar still prints a dollar figure with no marker that it is about 2% of the dashboard charge.
Output of codeburn --version
0.9.25 (CLI). Menubar app 0.9.24.
OS
macOS (Darwin 25.6.0)
Provider involved
Cursor (IDE composer bubbles in state.vscdb), not Cursor Agent. Plan is Enterprise, limitType: team.
Steps to reproduce
- Sign in to Cursor with an Enterprise team seat that has dashboard spend.
- Run CodeBurn 0.9.25 and open the menubar on Today / Local, Cursor chip.
- With the same app session cookie (
cursorAuth/accessTokenin Cursor'sstate.vscdb, sent asWorkosCursorSessionToken), POSThttps://cursor.com/api/dashboard/get-aggregated-usage-eventswith a JSON body ofstartDateandendDatein epoch milliseconds for the UTC day. - Compare
totalCostCents / 100to the menubar figure.
Redacted JSONL or SQLite snippet
Local call CodeBurn emits (src/providers/cursor.ts): tokens come from $.tokenCount or a text-length estimate, then calculateCost. The emit path hardcodes costIsEstimated: true because the input meter is the latest context snapshot, not a per-turn sum. Cache read, cache write, and reasoning are written as 0.
Dashboard event shape, values and ids removed:
{
"model": "claude-opus-5-5-medium",
"kind": "USAGE_EVENT_KIND_INCLUDED_IN_BUSINESS",
"isTokenBasedCall": true,
"isChargeable": true,
"requestsCosts": 0,
"cursorTokenFee": 0,
"chargedCents": 0,
"usageBasedCosts": "-"
}Aggregate row keys: modelIntent, inputTokens, outputTokens, cacheWriteTokens, cacheReadTokens, totalCents, tier. Top-level key: totalCostCents.
DEBUG=1 output
Not captured. The gap is visible without it: local cache costIsEstimated: true versus totalCostCents from the dashboard aggregate.
Additional context
This is not the Today-versus-cycle window, and not the Combined tab. Combined sums paired devices' local estimates (src/sharing/host.ts). It does not read Cursor's bill.
#574 was the same class of gap (admin portal versus CodeBurn) and was closed by estimating bubbles and flagging them estimated (#574, #575). That does not reconcile chargedCents. #890 is the right cost-mode shape for logs that already write a reported cost. Cursor does not write chargedCents into the bubble. A price-override cannot close the gap: missing events never enter the sum, and cursorTokenFee is not a model list rate.
Please do not add a second price table on top of the bubble estimate. When a reported charge exists, persist it and prefer it, same as the Grok change that stopped estimating once turn_completed.usage existed. Supported team contract is the Admin API POST /teams/filtered-usage-events (chargedCents includes model cost plus the Cursor token rate). The dashboard session-cookie route returns the same aggregate but is undocumented; Cursor already removed cost fields from the user-facing usage page in July 2026, so that route can change again.
A local patch against the installed app is not a fix. brew upgrade overwrites it, and there is no flag that selects the dashboard total.
Source: getagentseal/codeburn