GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [FEATURE]: Show OpenCode Go plan usage in the TUI prompt bar · Issue #42776 · anomalyco/opencode

[FEATURE]: Show OpenCode Go plan usage in the TUI prompt bar #42776

New issue
Copy link
New issue
Copy link
Open
Open
[FEATURE]: Show OpenCode Go plan usage in the TUI prompt bar#42776
Copy link
Assignees
MrMushrooooom

Description

@Tonlex
Tonlex
opened on Aug 15, 2026
Issue body actions

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

The TUI already shows tokens (context %) · $cost (session-local) in the prompt bar. Go plan subscribers have no way to see their account-wide plan usage from the CLI — the only place it's visible is the web dashboard, so users find out they're near a limit when the gateway starts throttling.

Proposal: append the Go plan's monthly usage percentage next to the existing cost indicator, e.g.:

123K (62%) · $0.15 · Go 4%

The percentage comes from the official endpoint added in #16513 (GET https://opencode.ai/zen/go/v1/usage, Bearer key auth), so no dashboard scraping or hardcoded limits. Only rendered when an opencode-go key is configured; degrades silently otherwise.

Proposed design

Server (~100 lines, packages/opencode)

  • New endpoint that looks up the stored opencode-go API key (existing Auth service), calls /zen/go/v1/usage, returns the monthlyUsage.percent value.
  • 60s TTL cache with background refresh: renders return the stale value instantly while the fetch happens async. (60s, not 5min — usage can move fast on expensive models; community Claude statuslines converge on 30s–2min for quota displays.)

TUI (~20 lines, packages/tui/src/component/prompt/index.tsx)

  • Extend the existing usage memo (line ~266) and its render (line ~1665): append · Go N% when data is available.
  • Between fetches, estimate the delta locally: each completed message on an opencode-go model already carries token usage, and per-model cost rates are known — so show Go ~4.5% (tilde = estimated) that ticks up as you work, snapping to the authoritative value on the next fetch. No extra API calls.

Mockup

┌─────────────────────────────────────────────────────────────┐
│ Ask anything... "refactor this to use Effect"                │
│ Build · opencode-go/deepseek-v4-flash · opencode             │
└─────────────────────────────────────────────────────────────┘
             123K (62%) · $0.15 · Go 4%   ⌘K commands   ⌘I agents

Note: $0.15 is session cost; Go 4% is account-wide (all sessions/machines using the key) — the Go label carries that distinction.

Out of scope for this issue (follow-ups)

  • User-configurable refresh interval / visibility toggle
  • USD amounts ($2.40/$60) — blocked on exposing limits in the API (see [FEATURE]: Expose balance and monetary usage data via the official usage API #41981)
  • Rolling 5h / weekly windows — data is free from the same endpoint; display is a trivial extension
  • Gateway-provided rate-limit headers on ordinary responses (Claude Code-style, zero polling) — cheaper long-term than client polling

Related

  • feat(console): add go usage endpoint #16513 — merged usage endpoint this builds on
  • [FEATURE]: Add Go plan usage/balance API endpoint (rolling/weekly/monthly windows) #16017 — original request for the usage API
  • [FEATURE]: zen usage/billing information available in tui #16036 — similar ask for Zen credits in TUI, closed not planned before the endpoint existed; this is scoped to Go plan windows via the official API
  • [FEATURE]: Expose balance and monetary usage data via the official usage API #41981 — monetary usage fields (follow-up dependency)
Reacted by Ivan Barsukov

Activity

  1. github-actions
    assigned
    MrMushrooooom
    on Aug 15, 2026
  2. github-actions commented on Aug 15, 2026

    @github-actions
    github-actionsBot
    on Aug 15, 2026 – with GitHub Actions
    Contributor
    More actions

    This issue might be a duplicate of existing issues. Please check:

    • [FEATURE]:U、account usage display on the tui sidebar #41293: Requests displaying Go plan usage (rolling/weekly/monthly) in the TUI sidebar — very similar goal of surfacing account-wide usage in the TUI
    • [FEATURE]: API endpoint for Go plan usage metrics (rolling/weekly/monthly) #38824: Requests the API endpoint for Go plan usage metrics that this feature builds on — may be worth coordinating
    • OpenCode free tier cuts off service mid-task with no warning - expose remaining allowance / add countdown #40588: Requests exposing remaining allowance / countdown in the TUI before quota exhaustion — overlapping problem space
  3. tsubiratstkww
    marked [FEATURE]: Show OpenCode Go plan usage in the TUI prompt bar #42774 as a duplicate of this issue on Aug 15, 2026
  4. Tonlex commented on Aug 15, 2026

    @Tonlex
    Tonlex
    on Aug 15, 2026
    Author
    More actions

    Thanks for the flag. This is complementary to #41293 (same data proposed for the TUI sidebar) — this one scopes it down to the minimal prompt-bar variant, and builds on the usage endpoint requested in #38824. Happy to consolidate or adjust the scope if #41293 ends up covering this.

  5. and7ey commented on Sep 15, 2026

    @and7ey
    and7ey
    on Sep 15, 2026
    More actions

    I've made small TUI plugin to display the stats - https://github.com/and7ey/opencode-go-usage

  6. opencodejr commented on Oct 28, 2026

    @opencodejr
    opencodejrBot
    on Oct 28, 2026
    Contributor
    More actions

    Thanks for the detailed proposal! You're asking for the OpenCode Go plan's usage percentage (e.g. Go 4%) to appear in the TUI prompt footer next to the session tokens and cost, so you can see you're close to a limit before requests start getting throttled.

    Some of this is already in v2 (as of v2.2.0):

    • When you're signed in to the OpenCode Console, OpenCode already reads /zen/go/v1/usage through the built-in usage limits support, including the rolling, weekly and monthly Go meters. You don't need a separate opencode-go key for this; it uses your Console sign-in.
    • The TUI has a /usage dialog and a sidebar "Limit" section. The prompt footer shows $X left / Limit reached when a Console budget for the selected model runs low.
    • The Go percentages themselves are fetched but not shown anywhere in the TUI yet, and that's the gap your request covers.

    Maintainers will consider it. Related issues:

    • feat(console): add go usage endpoint #16513: the Go usage endpoint this builds on
    • [FEATURE]: Add Go plan usage/balance API endpoint (rolling/weekly/monthly windows) #16017: the original request for a Go usage API
    • [FEATURE]: zen usage/billing information available in tui #16036: earlier request for Zen usage/credits in the TUI
    • [FEATURE]: Expose balance and monetary usage data via the official usage API #41981: monetary usage fields (your USD follow-up)
  7. opencodejr
    marked [FEATURE]: Opencode Go Usage in sidebar #64642 as a duplicate of this issue on Nov 18, 2026
  8. mzealey commented on Nov 18, 2026

    @mzealey
    mzealey
    on Nov 18, 2026
    More actions

    https://github.com/mzealey/opencode-go-usage to put it in the sidebar

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

Metadata

Metadata

Assignees

  • @MrMushrooooom
    MrMushrooooom

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.