Context
The opencode-zen provider currently scrapes the Zen workspace billing page (https://opencode.ai/workspace/[id]/billing) with a session cookie, regex-parsing SolidJS SSR HTML to extract balance, monthlyLimit, monthlyUsage, and lastPayment.
This is fragile — it breaks on every frontend change (3 parser fixes in recent weeks: #206, #211, #213). The billing page is not an API contract.
Blocked on
Upstream has no workspace billing API endpoint yet:
When the API lands
Context
The
opencode-zenprovider currently scrapes the Zen workspace billing page (https://opencode.ai/workspace/[id]/billing) with a session cookie, regex-parsing SolidJS SSR HTML to extract balance, monthlyLimit, monthlyUsage, and lastPayment.This is fragile — it breaks on every frontend change (3 parser fixes in recent weeks: #206, #211, #213). The billing page is not an API contract.
Blocked on
Upstream has no workspace billing API endpoint yet:
GET /zen/go/v1/usage(feat(console): add go usage endpoint anomalyco/opencode#16513) covers Go plan usage windows only — plan-window percentages, no monetary amounts, no balance.When the API lands
opencode-zento the usage API (Bearer API key, no cookie)src/lib/opencode-zen.ts100_000_000 units = $1conversion constant (API returns decimal USD)