GeezerVison is showing github.com — provider/opencode: free tier rate limit reset time not exposed via CLI or API · Issue #54338 · anomalyco/opencode
provider/opencode: free tier rate limit reset time not exposed via CLI or API #54338DescriptionSummary
OpenCode V2's built-in opencode provider (OpenCode Zen free tier) enforces server-side rate limits but does not expose the reset timestamp (x-ratelimit-reset header or equivalent) to the CLI. Users cannot determine when their free tier quota will reset without visiting the web console.
Environment
- opencode version: 1.18.32
- OS: Windows 10 19045 (win32 x64)
- Terminal: xterm-256color (Windows Terminal / pwsh)
- Shell: C:\WINDOWS\system32\cmd.exe (PowerShell 7)
- Install/channel: latest (npm global)
- Active plugins: @ninkch/opencode-mem, ./plugin/master-memory.ts
Reproduction
- Use default config with
model: "opencode/big-pickle" (or any opencode/* model)
- Exhaust free tier quota (hourly/daily limit)
- Run
opencode run --model opencode/big-pickle "test"
- Observe error:
Upstream request failed: Invalid credential
- No rate limit headers, no reset timestamp in logs, no CLI command to check status
Expected Behavior
One of:
- Response includes
x-ratelimit-reset (Unix timestamp) or Retry-After header
opencode api get /api/provider/opencode/ratelimit endpoint returns reset time
- TUI/status bar shows countdown when free tier is rate-limited
- Debug logs include reset window info
Actual Behavior
- Error:
AI_APICallError: Upstream request failed: Invalid credential (misleading — looks like auth failure, not rate limit)
- Retries every ~30s with same error
- Only workaround: visit https://opencode.ai/console to see reset time
- Direct API test returns:
{"type":"error","error":{"type":"FreeTierError","message":"OpenCode's free tier can only be used from within OpenCode"}} — but CLI is "within OpenCode"
Additional Context
- V1 reportedly showed rate limit info in TUI/logs
- Free tier credential stored in
~/.local/share/opencode/auth.json (type: api, key: sk-...)
- Re-auth (
providers logout/login) sometimes refreshes window but not reliably
- Models affected: all
opencode/* models (big-pickle, longcat-2.5-preview-free, etc.)
- Local models (Ollama) work fine — issue is specific to hosted OpenCode Zen free tier
Activityopencode-agent commented on Oct 10, 2026 Thanks for the detailed report, @Aymen104!
You're on opencode 1.18.32, which is OpenCode v1 (the opencode-ai npm package), not v2. v1 only gets fixes for critical bugs such as data loss, security problems or crashes with no workaround. Showing the free-tier reset time, and the confusing Invalid credential error when the quota runs out, don't fall into that category, so this is unlikely to change in v1. In the meantime, you can see the reset time at https://opencode.ai/console.
We'd encourage you to try v2 (the @opencode/cli npm package, opencode command), where active development happens. If the same thing happens on v2, or you think this is critical, please reply here with your v2 version and what you see.
Related issues, most likely match first:
opencode-agent commented on Oct 11, 2026 We haven't heard back, so I'm closing this as not planned. This report is about OpenCode v1 (1.18.32), which only gets fixes for critical bugs. Showing the free-tier reset time, and the misleading Invalid credential error when the quota is used up, don't count as critical, especially since the reset time can be seen at https://opencode.ai/console. The request to show the exact reset time is tracked in #52894.
If you see the same behaviour on v2 (@opencode/cli), please open a new issue with your v2 version and the error you get. Thanks again for the detailed report!
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|