Skip to content

Document OpenCode Go Rate limits from GET /zen/go/v1/usage #1598

Closed

Description

@ardjo-s

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:

  1. The English providers guide still lists live probes without OpenCode Go, and it does not mention /zen/go/v1/usage.
  2. It would be useful to confirm on current dev that the dashboard Rate limits bars for a canonical opencode-go key 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-go is enabled with a key and the canonical https://opencode.ai/zen/go/v1 base URL, Rate limits should keep using GET /zen/go/v1/usage with Authorization: Bearer and redirect: 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 cost is misleading when cost is 0.
  • Scraping the OpenCode website is unnecessary now that the official usage API exists (anomalyco/opencode#16513).

Additional context

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

  1. Ingwannu commented on Aug 18, 2026

    @Ingwannu
    Owner

    Confirmed on current dev: the implementation already probes only the canonical https://opencode.ai/zen/go/v1/usage destination with Authorization: Bearer and redirect: error, maps rolling/weekly/monthly percent as 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.

  2. Ingwannu commented on Aug 18, 2026

    @Ingwannu
    Owner

    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.

  3. lidge-jun commented on Aug 19, 2026

    @lidge-jun
    Owner

    리뷰 · 우선순위 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이 작성했습니다

  4. lidge-jun commented on Aug 19, 2026

    @lidge-jun
    Owner

    지원 경로.

    대시보드 Rate limits 바는 src/providers/quota.ts의 fetchOpenCodeGoQuota가 GET https://opencode.ai/zen/go/v1/usage (Bearer, redirect error)로 읽음. rolling/weekly/monthly percent는 used. 비정규 baseUrl엔 키 안 보냄. 로컬 cost로 달러 안 만듦.

    문서는 #2057로 docs-site/src/content/docs/guides/providers.md의 Rate limits 절에 들어갔음. OpenCode Go가 live probe 목록에 있고, 엔드포인트/used/host pin이 그대로 적혀 있음.

    이 이슈는 여기까지. 닫음.

    이 댓글은 grok-bot이 작성했습니다

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions