Skip to content

feat(quota): show Cursor remaining from official DashboardService usage - #490

Open
Adam-Dalloul wants to merge 9 commits into
xintaofei:mainfrom
Adam-Dalloul:feat/cursor-remaining-quota
Open

feat(quota): show Cursor remaining from official DashboardService usage#490
Adam-Dalloul wants to merge 9 commits into
xintaofei:mainfrom
Adam-Dalloul:feat/cursor-remaining-quota

Conversation

@Adam-Dalloul

Copy link
Copy Markdown

Merge order

  1. #472 then #481
  2. Then this PR

This branch already contains both. Merge those first so this reviews as the Cursor delta.


Cursor has no usage CLI. status and about --format json are identity only (this box is signed out, so I could not live-read a remaining number).

The official CLI/IDE client already ships GetCurrentPeriodUsage on api2.cursor.sh. Same class as the Claude /usage HUD: we only show remaining when that planUsage object is present (total_percent_used, or remaining/limit). Identity-only about/status payloads stay unavailable and the chip links the Spending dashboard.

Auth is the cursor-agent login file (%APPDATA%\Cursor\auth.json on Windows) or CURSOR_API_KEY. We do not read the IDE sqlite store.

This also maps the Cursor family onto the header chip from #481.

@Adam-Dalloul

Copy link
Copy Markdown
Author

Checked this against a signed-in Cursor CLI on this machine.

cursor-agent status --format json is authenticated. %APPDATA%\Cursor\auth.json has accessToken. POST aiserver.v1.DashboardService/GetCurrentPeriodUsage with that Bearer token returns 200 and planUsage (remaining / limit 40000, totalPercentUsed 0 on Ultra).

Pushed a follow-up that pins that live envelope and reads billingCycleEnd (unix ms string) as the reset time. Still no invented numbers, and we still do not read the IDE sqlite store.

Token Usage now lists isolatable families. Remaining plan quota is
emitted only from a recorded official remaining-subscription envelope.
ACP usage_update stays context occupancy. Families without a payload
link to the provider usage page instead of inventing a number.
Codex remaining comes from documented app-server account/rateLimits/read.
Claude remaining comes from the /usage HUD five_hour utilization payload.
Other families still link to the provider page instead of inventing a number.
subscription-quota now calls official `codex app-server --stdio`
`account/rateLimits/read` and parses the live envelope (primary
usedPercent, window, reset, extra limit ids).

Local CLI check: Claude `auth status` and `claude -p /usage` do not
publish remaining plan quota. Grok has no usage command. OpenCode
`stats` is historical cost, not remaining. Those rows stay links.
There is no `claude usage` CLI. Live `GET /api/oauth/usage` with the local
Claude Code OAuth token returns five_hour / seven_day utilization as 0-100
percents. That is the HUD payload community monitors already parse.

The panel fetches it next to Codex. Utilization is not treated as a 0-1
fraction. Weekly and extra-usage windows show as extras. Tokens are never
logged.
Live `GET /v1/billing?format=credits` on cli-chat-proxy.grok.com with the
Grok CLI OAuth token returns config.creditUsagePercent. The panel fetches
that next to Codex and Claude. Tokens and emails are never logged.

Gemini and OpenCode still have no remaining-quota command.
Cursor has no usage CLI. Parse planUsage from the same
GetCurrentPeriodUsage RPC the official client already ships.
Signed-in Ultra session returned planUsage remaining/limit 40000
and totalPercentUsed 0. Parse billingCycleEnd as reset time.
@Adam-Dalloul
Adam-Dalloul force-pushed the feat/cursor-remaining-quota branch from 2afe062 to a686277 Compare August 16, 2026 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant