Repository navigation
Document OpenCode Go Rate limits from GET /zen/go/v1/usage #1598
Description
Area
Dashboard, Documentation, Provider adapters
What are you trying to accomplish?
I would like the OpenCodex dashboard Rate limits row for opencode-go to show the same rolling / weekly / monthly used percents as the official OpenCode Go dashboard, and for the public provider docs to say that those bars come from GET https://opencode.ai/zen/go/v1/usage.
What prevents this today?
OpenCode Go does not record a dollar charge in local usage logs (tokens only). Tools that reconstruct Session / Weekly / Monthly from SQLite cost therefore show ~100% remaining and $0.00 spend tiles, even when the OpenCode dashboard shows the windows as used.
OpenCodex already added an authenticated probe in #1545 (feat: add OpenCode Go quota usage). Thank you for that — it is the right source of truth. Two small follow-ups would help operators:
- The English providers guide still lists live probes without OpenCode Go, and it does not mention
/zen/go/v1/usage. - It would be useful to confirm on current
devthat the dashboard Rate limits bars for a canonicalopencode-gokey match the official used percents (not remaining).
I am not asking OpenCodex to estimate dollars or to change any local SQLite export.
What should OpenCodex do?
- When
opencode-gois enabled with a key and the canonicalhttps://opencode.ai/zen/go/v1base URL, Rate limits should keep usingGET /zen/go/v1/usagewithAuthorization: Bearerandredirect: error(as in feat: add OpenCode Go quota usage #1545). - Percents should remain used, matching the OpenCode dashboard (“X% used”).
- The providers documentation should mention that Go plan windows come from that endpoint, and that the probe does not follow a rewritten
baseUrl.
Example usage or interface
GET https://opencode.ai/zen/go/v1/usage
Authorization: Bearer <opencode-go key>Production returns { usage: { rolling, weekly, monthly } }. Each window has status, percent (used), and resetsAt. Rolling maps to the existing 5-hour bar; weekly and monthly map to the existing weekly/monthly bars.
A non-canonical baseUrl should not receive the key (same host pin as OpenRouter / ClinePass).
Alternatives or workarounds
- Reconstructing dollars against $12 / $30 / $60 caps from local
costis misleading whencostis 0. - Scraping the OpenCode website is unnecessary now that the official usage API exists (anomalyco/opencode#16513).
Additional context
- Probe implementation: feat: add OpenCode Go quota usage #1545
- Related OpenUsage 0.7.8 report (local dollar-cap meters): OpenCode Go meters stay at 100% left when local SQLite costs are $0 robinebers/openusage#1102
- OpenUsage fix (merged, not in a GitHub release yet): feat(opencode): switch Go meters to the official usage API robinebers/openusage#1097
I searched existing OpenCodex issues and did not find an open thread for this. Happy to test a docs-only follow-up on dev if that would help.
Checks
- I searched existing issues and documentation.
- This request describes a concrete OpenCodex workflow rather than merely naming a desired technology.
- I removed secrets and personal data.
Activity
Ingwannu commentedon Aug 18, 2026
Confirmed on current
dev: the implementation already probes only the canonicalhttps://opencode.ai/zen/go/v1/usagedestination withAuthorization: Bearerandredirect: error, maps rolling/weekly/monthlypercentas used utilization, and has a negative noncanonical-destination regression. The remaining defect is documentation: the English live-probe list omits OpenCode Go and does not name the endpoint/semantics.I will open a focused documentation PR adding that exact contract. Per the current maintainer workflow, I will request review rather than directly merging the text change.
Ingwannu commentedon Aug 18, 2026
Opened #2057 with the verified documentation fix. It names the canonical usage endpoint, used-percent semantics, Bearer/redirect boundary, and noncanonical-host exclusion. The docs site built all 385 pages successfully.
As requested by the current maintainer workflow, I did not merge the text change; @lidge-jun and @Wibias were requested for review.
lidge-jun commentedon Aug 19, 2026
리뷰 · 우선순위 24 / 80
OpenCode Go의 Rate limits 막대가 공식 대시보드와 같은 used 퍼센트를 보여주고, 문서에 GET /zen/go/v1/usage가 출처라고 적히길 바라는 후속입니다. 로컬 SQLite cost로 달러를 추정하지 말라는 범위입니다. #1545 프로브가 이미 들어왔다는 전제입니다.
현재 dev의 src/providers/quota.ts에는 OPENCODE_GO_BASE_URL과 OPENCODE_GO_USAGE_URL이 있습니다. fetchOpenCodeGoQuota()는 캐논 호스트가 아니면 키를 보내지 않고, Bearer와 redirect error로 /usage를 호출합니다. rolling/weekly/monthly를 읽어 fiveHourPercent, weeklyPercent, monthlyPercent에 넣습니다. parseOpenCodeGoUsageWindow는 percent를 그대로 쓰므로, 업스트림이 used 퍼센트면 막대도 used가 됩니다.
docs 아래에서 OpenCode Go 라이브 프로브나 /zen/go/v1/usage를 가리키는 가이드는 찾지 못했습니다. 이슈가 말한 영어 providers 가이드에 Go가 빠져 있다는 지적과 맞습니다. 대시보드 숫자 자체는 프로브가 있으면 이미 연결될 수 있고, 남은 일은 문서와 used/remaining 확인입니다.
해결방안: 프로브 코드를 다시 짜기보다, 캐논 호스트에서만 /usage를 쓰고 percent는 used라는 점을 providers 문서에 적으면 됩니다. rewritten baseUrl에는 키를 보내지 않는다는 핀도 같이 적어야 합니다. 대시보드 막대가 remaining으로 뒤집혀 있는지는 GUI 쪽을 더 보지 않아 여기서 단정하지 않습니다. 패치는 추측하지 않음.
이 댓글은 grok-bot이 작성했습니다
lidge-jun commentedon Aug 19, 2026
지원 경로.
대시보드 Rate limits 바는
src/providers/quota.ts의fetchOpenCodeGoQuota가GET https://opencode.ai/zen/go/v1/usage(Bearer, redirect error)로 읽음. rolling/weekly/monthlypercent는 used. 비정규 baseUrl엔 키 안 보냄. 로컬 cost로 달러 안 만듦.문서는
#2057로docs-site/src/content/docs/guides/providers.md의 Rate limits 절에 들어갔음. OpenCode Go가 live probe 목록에 있고, 엔드포인트/used/host pin이 그대로 적혀 있음.이 이슈는 여기까지. 닫음.
이 댓글은 grok-bot이 작성했습니다