Skip to content

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

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions