Pre-flight checks
OpenCode version reviewed
1.15.11
Problem statement
OpenCode Zen is a popular pay-as-you-go provider that offers curated models from OpenAI, Anthropic, Google and others. Currently, opencode-quota does not support it, so users cannot see their Zen balance or usage within the plugin UI surfaces (sidebar, toast, compact status).
The OpenCode team has an open feature request for a Zen balance API endpoint (opencode#10448). Until that is available, opencode-quota could show local token usage and cost data for the opencode provider.
Proposed change
Add a new provider adapter for "opencode" (Zen) that:
- Reads local session token usage from opencode.db
- Applies Zen published pricing from models.dev to calculate cost
- Displays estimated remaining balance in sidebar, toast, and compact status
- Supports configuration for Zen reset periods
If/when OpenCode releases a public Zen balance API, migrate to use that endpoint for accurate real-time balance data.
Alternatives considered
No response
Acceptance criteria
Pre-flight checks
OpenCode version reviewed
1.15.11
Problem statement
OpenCode Zen is a popular pay-as-you-go provider that offers curated models from OpenAI, Anthropic, Google and others. Currently, opencode-quota does not support it, so users cannot see their Zen balance or usage within the plugin UI surfaces (sidebar, toast, compact status).
The OpenCode team has an open feature request for a Zen balance API endpoint (opencode#10448). Until that is available, opencode-quota could show local token usage and cost data for the opencode provider.
Proposed change
Add a new provider adapter for "opencode" (Zen) that:
If/when OpenCode releases a public Zen balance API, migrate to use that endpoint for accurate real-time balance data.
Alternatives considered
No response
Acceptance criteria