Repository navigation
Open
Description
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
Summary
The Console v2 request-logs API (GET /console/api/request-logs) returns one row per inference request, but rows carry no field telling whether the request was covered by the OpenCode Go plan quota or debited from the Zen balance. With "Use your balance after reaching the limits" enabled, Go-key requests that overflow the quota look identical to covered ones, so a precise month split of Go-covered traffic vs. balance spending cannot be built from the API.
Environment
- opencode version: 2.0.26 (client only; the gap is server-side, on the Console API)
- OS: Linux 6.12.107+deb13-amd64 (Debian 13, x86_64) — not relevant here; API-side report
- Terminal: tmux (
TERM=tmux-256color,TERM_PROGRAM=tmux) - Shell:
/bin/bash - Install/channel: latest (
opencode --version→ v2.0.26) - Active plugins: none besides the custom global
opencode-usageplugin, the client that reads this API to build monthly spend reports
Auth: Console session (auth / __Host-console_session cookies + x-org-id header), the same access pattern as the Console web app (#51806).
Reproduction
- Workspace with an active Go subscription, a non-zero Zen balance, and "Use your balance after reaching the limits" enabled.
- Keep sending requests through the Go key (
/inference/go…) until the Go meters are spent, so later requests fall back to the balance. - Read the overflow period with
GET /console/api/request-logs?category=inference&since=<ms>&until=<ms>&limit=20, then readGET /console/api/billing/ledger.
Expected Behavior
Either of these would let a client split the two buckets exactly:
request-logsrows expose a per-request billing source, e.g.billingSource: "go" | "balance"(the legacy/usage/rowsshape carried a per-rowbillingSource,go/credit; the v2 endpoint dropped it), orbilling/ledgeracceptssince/untiland a cursor, so balance debits can be listed for a whole month.
Actual Behavior
- Overflow rows still read
product:"go"/ path/inference/go…with acost: nothing marks them as balance-charged, so they are indistinguishable from quota-covered rows. go/statusmeters (fiveHour/week/month,usedMicroCents/limitMicroCents/resetsAt) only say when coverage ran out; themonthmeter pins at its limit once spent and cannot say how much fell outside.billing/ledgerhas the exact data (oneusage_debitper balance-charged request, amount matching the rowcost) but returns only the last ~25 entries with no paging.
Additional Context
- Not an account support request: no account details are needed, and this is not a billing dispute. It is an API completeness request about data the backend already computes per request.
- Related history: [Console v2] /console/api/request-logs: 503 ServiceUnavailable above ~20-50 page size, /request-logs/export always 503 — and the legacy per-key /usage/rows endpoint is gone #51806 (the legacy
/usage/rowsendpoint, which carried per-row billing data, was retired in the Console v2 migration), Go endpoint bills Zen balance and triggers auto-reload after Go subscription ends #53364 (billing falls through to"balance"per request, i.e. the decision exists per request), opencode Go 'credits' won't be used, despite 'extra usage' is turned on #54783 (Go credits not used despite "extra usage"). - Consumers affected: third-party usage dashboards such as opencode-model-usage, opencode-limits and opencode-quota (all referenced in [Console v2] /console/api/request-logs: 503 ServiceUnavailable above ~20-50 page size, /request-logs/export always 503 — and the legacy per-key /usage/rows endpoint is gone #51806), plus custom reporting tools.
- Workarounds tried: replaying
billing/ledger(too short), readinggo/statusmeters (aggregate only), and mirroringrequest-logslocally (the ambiguity is mirrored). - Reproducibility: consistent, observed on every Console v2 month.
Reacted by Felix Schröter
Metadata
Metadata
Assignees
Labels
No labels
Activity
opencode-agent commentedon Oct 15, 2026
Thanks for the detailed write-up, @niwinz!
To restate the request: Console v2 request-logs should show for each request whether the OpenCode Go quota covered it or the Zen balance paid for it. That could be a per-row field like
billingSource: "go" | "balance". Alternatively,billing/ledgercould acceptsince/untiland support paging. Either would let usage tools split a month's spend exactly. Maintainers will look at this and decide whether to add it.Related issues you may want to follow:
/usage/rowsendpoint, which had per-row billing data, was retired in the Console v2 migration