anomalyco / anomalyco/opencode
go/v1/usage returns 403 EntitlementError for an active Go subscription
@MrMushrooooom is already working on this.
Since Sep 14, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- Avg merge
- 7h 2m
- Merged PRs (30d)
- 384
Description
Describe the bug
The OpenCode Go usage endpoint returns 403 for a key that is an active OpenCode Go subscription, so usage meters (e.g. the ai-usagebar Omarchy plugin) can't report usage.
Reproduction
curl -s -H "Authorization: Bearer $OPENCODE_GO_KEY" -H "Accept: application/json" \
https://opencode.ai/zen/go/v1/usage
Response:
{"type":"error","error":{"type":"EntitlementError","message":"OpenCode Go subscription required."}}
The key is a valid Go subscription. The same key:
GET https://opencode.ai/zen/go/v1/models→200, 37 models includingdeepseek-v4-pro(and inference works with it).GET https://opencode.ai/zen/v1/models→200.
Root cause (from packages/console/app/src/routes/zen/go/v1/usage.ts)
After the key authenticates (it resolves through KeyTable → UserTable → WorkspaceTable → BillingTable; otherwise the endpoint would return 401), the handler queries LiteTable for workspaceID + userID. When that row is absent it returns the 403 EntitlementError. So subscription/billing exists, but no LiteTable usage row is linked to this key's workspace/user — a server-side data inconsistency for this account.
Environment
- opencode CLI with the OpenCode Go provider (
deepseek-v4-pro) - ai-usagebar plugin hitting the documented
GET /zen/go/v1/usageendpoint
Expected
200 with usage.rolling / usage.weekly / usage.monthly for an active Go subscription.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.