Skip to content

Commit 38045ab

Browse files
iamenahsclaude
andcommitted
Correct what OpenCode exposes: Go's limits are open to its key
The first commit said Zen's balance and Go's limits were both closed to an API key. Zen's balance is: no endpoint reads it (asked upstream in anomalyco/opencode#10448). Go's limits are not: `GET /zen/go/v1/usage` with the Go key returns the rolling 5-hour, weekly and monthly windows, shipped from anomalyco/opencode#16017, found while filing the ACP request. The desk does not read it yet, since there is no Go subscription here to measure it against; the comment and the doc now say so. Co-Authored-By: Claude Opus 5 <[email protected]>
1 parent 4e320df commit 38045ab

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

‎docs/usage-dashboard.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ can say, and each now says it:
188188
| Amp | `amp usage` prints the balance in a short report its server writes (no JSON form); account lookups share a limit of 60 an hour with Amp's own. `amp-acp` forwards none of the SDK's per-message `usage`. | the balance, `$10.00 left`, re-asked at most every five minutes |
189189
| Cline | Its CLI's account screen asks `api.cline.bot` for the user and the billed account's balance (micro-dollars), with the session in `providers.json`. Its ACP server drops the engine's `usage` event. Its `sessions.db` keeps each session's usage and `totalCost`. | the balance, plus the spend Cline billed |
190190
| Gemini CLI | A Code Assist sign-in has a quota (the existing meter); an API key has none anywhere. Its chat logs carry tokens and model per call. | spend at list price |
191-
| OpenCode | Zen's balance and Go's limits are enforced server-side and not open to an API key. It sends `usage_update` (context, session cost) and keeps each session's tokens and `cost` in `opencode.db`. | spend at the cost OpenCode recorded, a free model's `$0` included |
191+
| OpenCode | Zen's balance has no endpoint an API key can read (requested upstream, anomalyco/opencode#10448). Go's limits do: `GET /zen/go/v1/usage` with the Go key returns the rolling 5-hour, weekly and monthly windows (`status`, `percent`, `resetsAt`) — not read by the desk yet, for want of a Go subscription to measure against. It sends `usage_update` (context, session cost) and keeps each session's tokens and `cost` in `opencode.db`. | spend at the cost OpenCode recorded, a free model's `$0` included |
192192
| Qwen Code | No quota endpoint. Its transcripts record `usageMetadata` per call. | spend at list price |
193193

194194
The token Cline's meter uses is **never refreshed**: refreshing rotates the

‎packages/server/src/bootstrap.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -528,8 +528,11 @@ export const localUsageFor = (
528528
case 'cline':
529529
return { meter: new ClineMeter({ env }), ...records('cline') }
530530
case 'opencode':
531-
// Zen's balance and Go's limits are not open to an API key; what
532-
// OpenCode priced each session at is in its own database.
531+
// Zen's balance has no endpoint an API key can read (asked upstream,
532+
// anomalyco/opencode#10448). Go's limits do — `GET /zen/go/v1/usage`
533+
// with the Go key — and are not read here yet: that needs a Go
534+
// subscription to measure against. What OpenCode priced each session
535+
// at is in its own database either way.
533536
return records('opencode')
534537
case 'qwen':
535538
case 'qwen-code':

0 commit comments

Comments
 (0)