Skip to content

[FEATURE] Add unified usage tracking via /usage (#9545) #9281

Description

@CasualDeveloper
  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

When you sign in to opencode with an OAuth provider, there's no built-in way to see how much of your plan or rate limit you've used. You have to open each provider's dashboard. I'd like usage to be visible inside opencode for the providers it already authenticates.

The feature now covers:

  • Usage for four OAuth providers: Anthropic Claude, GitHub Copilot, OpenAI ChatGPT, and Google Antigravity.
  • A GET /usage endpoint that returns a normalized snapshot per provider (rate-limit windows, reset times, credits or quota, and plan type), each with a status such as ok, stale, or unauthenticated.
  • A /usage TUI dialog and a sidebar Usage section, with config for provider scope and whether to show used or remaining. End-of-turn refresh is throttled and only warns at 80/90/95%.
  • Copilot usage reads quota with the same GitHub device token the normal Copilot login already stores, so it needs no extra setup.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions