Skip to content

Go quota: All three windows show <100% but CLI reports "quota exceeded" #59188

Open

Description

@sacredwar2020-zhang

Description

Problem

OpenCode Go subscription is active. The web console shows all three quota windows (rolling 5h, weekly, monthly) are not exhausted (e.g., monthly at ~48%). However, the local CLI/TUI blocks requests with a "quota exceeded" / "used up" error.

Expected behavior

If any of the three quota windows has remaining allowance, the CLI should not report "quota exceeded". The CLI should either read the authoritative quota state correctly, or surface a more specific error (e.g., "rolling 5h limit reached" vs "weekly limit reached").

Actual behavior

The CLI reports that the quota is used up, even though the web dashboard confirms all three windows have remaining capacity. The exact error message is:

Error: Upstream request failed: Insufficient account funds

Steps to reproduce

  1. Subscribe to OpenCode Go and use Go models until some usage is recorded (e.g., monthly ~48%).
  2. Ensure the web dashboard shows all three windows below 100%.
  3. In the TUI, run /models and select a Go model.
  4. Send a request. The CLI returns a "quota exceeded" error despite remaining allowance.

Evidence (authoritative quota state)

Running the official usage endpoint directly with curl returns:

url -s -H "Authorization: Bearer oc_sk_abab18ac365d_tP1sSJ-9AJO4YoBkdPKE8SVaSAUz7GbO" https://opencode.ai/zen/go/v1/usage
{"usage":{"rolling":{"status":"ok","percent":0,"resetsAt":"2026-10-26T10:55:45.000Z"},"weekly":{"status":"ok","percent":0,"resetsAt":"2026-11-02T00:00:00.000Z"},"monthly":{"status":"ok","percent":47,"resetsAt":"2026-11-08T15:22:22.000Z"}}}
This confirms the server-side quota is not exhausted.

Related issues
#38855 (Weekly limit reported exhausted while rolling 5h never reached)

#38936 (Quota shows 100% exhausted but visible usage is only ~$20)

#15128 (CLI is not reading Go subscription quotas correctly)

#41391 (Quota accounting mismatch / hidden multiplier)

### Plugins

_No response_

### OpenCode version

2.1.2

### Steps to reproduce

_No response_

### Screenshot

_No response_

### Operating System

_No response_

### Terminal

_No response_

Activity

  1. opencode-agent commented on Oct 26, 2026

    @opencode-agent
    Contributor

    Thanks for the report and the usage output, that helps.

    First, an important security note: the curl command in your issue contains what looks like your full OpenCode API key (oc_sk_…). Please revoke or regenerate that key in the OpenCode console right away, and edit the issue to remove it.

    On the error itself: Upstream request failed: Insufficient account funds usually doesn't come from the Go quota. It normally means the request went through the opencode/ provider (OpenCode Console / Zen), which bills Console credits, instead of the opencode-go/ provider, which uses your Go subscription. With a $0 credit balance you get exactly this error, even while all your Go windows show capacity left.

    To work out which case this is, could you share:

    1. The exact provider and model you picked in /models, as shown in the TUI footer or as a model ID such as opencode-go/<model> or opencode/<model>.
    2. The output of opencode auth list, with any keys or tokens removed.
    3. Whether this command also fails: opencode run -m opencode-go/<model> "Reply with OK". If it does, please paste the full error.
    4. Your OS and how you installed OpenCode.

    You can reply here, or edit the issue. If you edit it, please also leave a comment saying you've updated it so we know you're done.

    These existing issues may be related, ordered from most to least likely:

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions