Repository navigation
feat(console): add go usage endpoint - #16513
Merged
Merged
Conversation
1 task done
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
2 tasks done
|
Hey, any news on merging this? |
Contributor
Author
|
no clue |
|
+++ |
|
I would like to see this implemented |
|
+1 for implementing this. In the meantime I'm using this hacky solution https://pi.dev/packages/pi-go-bars |
|
I would like to see this implemented |
|
Official support would be nice. If you need usage and quota tracking in opencode, https://github.com/slkiser/opencode-quota |
|
up |
|
I'd employ this feature. |
|
+1 |
|
+1 |
|
Did they truly forget about this? |
|
Would really love this for OpenUsage. A lot of users keep asking, and the local SQL is unreliable. |
|
+1 |
|
+1 pls merge this |
|
bibhubhatta
pushed a commit
to bibhubhatta/ClaudeBar
that referenced
this pull request
Aug 25, 2026
The local-DB probe only sees this machine's messages and guesses at the server's cost accounting, so its numbers diverged from the opencode.ai dashboard. opencode now exposes GET /zen/go/v1/usage (anomalyco/opencode#16513), which returns the same rolling/weekly/monthly percentages and reset times the dashboard shows. - Add OpenCodeCredentialLoader: reads OPENCODE_API_KEY or the `opencode-go` / `opencode` entry from $XDG_DATA_HOME/opencode/auth.json - Add OpenCodeAPIUsageProbe: calls the endpoint with a bearer key, maps used% -> remaining%, 401 -> sessionExpired, 403 -> subscriptionRequired - Keep OpenCodeUsageProbe (local DB) as a fallback when no key is present Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01CdVhUZgY4SKaYkuxdqR3AY
1056674754
added a commit
to 1056674754/opencode
that referenced
this pull request
Aug 31, 2026
Upstream v1.18.16 (a3647eb) -> v1.18.17 (02546df), 32 commits. Functional changes: - fix(compaction): clearer instructions for smaller models like dsv4 flash (anomalyco#42045) - fix(provider): add Merge Gateway reasoning variants (anomalyco#41867) - fix(opencode): cap session retries with jitter (anomalyco#41939) - retry policy gains RETRY_MAX_RETRIES=5 global cap and 25% jitter - fix(opencode): detect Copilot PDF input support (anomalyco#41522) - fix(provider): scope DeepSeek V4 Flash sampling defaults (anomalyco#41620) - fix(session): route all Muse family models to the Meta system prompt (anomalyco#41581) - fix(app): use current default model (anomalyco#38603) - feat(console): add go usage endpoint (anomalyco#16513) and r2 data catalog stats - fix(ui): correct OC-2 weak icon color (anomalyco#41504) - fix(i18n): use widely recognized developer terminology (anomalyco#41532) Conflicts resolved: 30 package.json version bumps (rebranded 1.18.17-sscity), bun.lock (took upstream, rebranded workspace entries via bun install), and session/retry.ts (kept fork per-reason maxAttempts cap alongside upstream RETRY_MAX_RETRIES global cap and jitter).
3 of 4 tasks
This was referenced Sep 11, 2026
3 tasks done
androidand
pushed a commit
to androidand/opencode-skein
that referenced
this pull request
Sep 18, 2026
Co-authored-by: vimtor <[email protected]>
androidand
pushed a commit
to androidand/opencode-skein
that referenced
this pull request
Sep 19, 2026
Co-authored-by: vimtor <[email protected]>
androidand
pushed a commit
to androidand/opencode-skein
that referenced
this pull request
Sep 19, 2026
Co-authored-by: vimtor <[email protected]>
2 tasks done
rldona
pushed a commit
to rldona/FlupCode
that referenced
this pull request
Sep 24, 2026
Co-authored-by: vimtor <[email protected]>
1 task done
Jovan1666
pushed a commit
to Jovan1666/opencode
that referenced
this pull request
Oct 4, 2026
Co-authored-by: vimtor <[email protected]>
arionrefat
added a commit
to arionrefat/open-usage
that referenced
this pull request
Oct 6, 2026
GET /zen/go/v1/usage merged in anomalyco/opencode#16513 and now answers in production, so the parser no longer has to guess. The route returns `{ usage: { rolling, weekly, monthly } }`, each window holding a status, a floored percent and an ISO reset, and nothing else; the aliases and dollar fallbacks written against the proposal are gone. A window marked `rate-limited` reads as spent, since its floored percent can say 99. A valid key on a workspace without Go answers 403 with an EntitlementError, which now reads as no subscription instead of a rejected key, and a 404 is drift rather than an outage. The cookie still ranks above the key because only the console publishes dollars.
Ichinose-Kazuki
pushed a commit
to Ichinose-Kazuki/opencode
that referenced
this pull request
Oct 7, 2026
Co-authored-by: vimtor <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Issue for this PR
Closes #16017
Type of change
What does this PR do?
this PR adds an API endpoint at
/zen/go/v1/usagethat will provide the same opencode go usage data as in the zen workspace dashboard.If you paste a large clearly AI generated description here your PR may be IGNORED or CLOSED!
How did you verify your code works?
unfortunately i don't think this is a change i can verify as an outside contributor. i did try running
bun dev:remotebut met with cloudflare api key error.I did copy the pattern in
/zen/v1/modelsand copied the logic from/workspace/[id]/billing/lite-section.tsxScreenshots / recordings
not a ui change
Checklist
i guess running dev server and building counts as testing? but yea i don't think i can test this feature locally
If you do not follow this template your PR will be automatically rejected.