Skip to content

[feature] opencode-zen: remove billing page scraping once Zen usage API exists #216

Description

@vmvarela

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

  • Migrate opencode-zen to the usage API (Bearer API key, no cookie)
  • Drop billing page scraping + all SSR/data-slot parsers from src/lib/opencode-zen.ts
  • Remove the 100_000_000 units = $1 conversion constant (API returns decimal USD)
  • Update tests and fixtures

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions