Troubleshooting

September 6, 2026 · View on GitHub

← Back to README

Troubleshooting

Start with /quota_status in OpenCode, or opencode-quota status from a terminal. Both show which config, providers, authentication, and local files OpenCode Quota found.

First checks

  1. Run /quota_status in OpenCode, or opencode-quota status from a terminal.
  2. Find the provider or feature that is failing.
  3. Follow the matching fix below.
  4. Restart OpenCode after changing config or authentication.

If every provider is missing, confirm OpenCode Quota is listed in opencode.jsonc or .json. For TUI commands and displays, also confirm it is listed in tui.jsonc or .json.

Common problems

ProblemTry this
Slash commands are missingCheck the plugin entries above, then restart OpenCode.
TUI command results appear in the wrong placeUse tuiCommandDisplay: "inline" for normal messages or "dialog" for a popup. Home always uses a popup because there is no session transcript.
/quota shows no providersRun /quota_status or opencode-quota status, then check provider detection and authentication.
Sidebar is missingConfirm the TUI plugin is installed and tuiSidebarPanel.enabled is true.
Compact line is missingConfirm the TUI plugin is installed and tuiCompactStatus.enabled is true. If needed, check suppressWhenNativeProviderQuota.
Compact line appears on Home onlySet tuiCompactStatus.sessionPrompt to true.
TUI toast is missingCheck enableToast, showOnIdle, showOnQuestion, and showOnCompact. Toasts are not available in Web.
Token reports are emptyStart OpenCode once, then use a model so opencode.db contains usage.
Pricing looks oldRun /pricing_refresh.
Web shows Failed to send command after correct outputThe command already worked. Do not retry. This is a known OpenCode 1.18.2 notification problem; no model was called.

Update safely

  1. Close OpenCode.

  2. Preview the update:

    npx @slkiser/opencode-quota@latest update --dry-run
    
  3. Inspect both safe changes and manual findings. Do not paste credential values into command output or issue reports.

  4. Apply the plan:

    npx @slkiser/opencode-quota@latest update
    
  5. Restart OpenCode.

  6. Run /quota_status in OpenCode, or run opencode-quota status in a terminal.

The updater preserves unrelated settings, comments, and plugins where targeted editing is safe. Credential findings stay manual, and --yes authorizes only safe config/cache work. See Updating safely for the complete workflow.

Update resultWhat to do
Obsolete OpenCode Go sourceConfigure OPENCODE_API_KEY, trusted global provider.opencode-go.options.apiKey, fallback provider.opencode.options.apiKey, or opencode auth login -p opencode-go. Verify it, then manually remove the reported old variable/file. Workspace/cookie material cannot become an API key.
Ambiguous OpenCode Zen environment namesDecide whether the names belong to Zen or OpenCode's workspace feature. If they are Zen credentials, create and protect the supported global opencode-quota/opencode.json manually. Never paste the values into output or reports.
Unsupported display migrationFix the reported invalid, duplicate, or ambiguous config manually. Use root accountingDetail: "summary" or "detailed"; do not share the rejected value.
Update race or partial-write failureNo package cache was deleted. Read the error's exact changed-path list, inspect those files, fix the cause, and rerun update --dry-run for a fresh plan. Do not restore over concurrent edits blindly.

Provider fixes

Custom providers

Run /quota_status and inspect quota_providers. Each definition shows its stable/provider IDs, mode, format or exact local state path, model coverage, live outcome, credential category, environment name, and safe checked paths. These results are fetched live for the status command; cached results are not substituted.

SymptomFix
Config is rejectedRun opencode-quota provider add and keep quotaProviders in global OpenCode JSONC/JSON. Remove customSources, unknown fields, duplicate IDs/request identities, or overlapping model coverage.
Definition is unavailableConfirm OpenCode reports the exact configured providerId. With onlyCurrentModel, confirm the model id without provider prefix matches modelIds, or omit modelIds for provider-wide coverage.
missing_credentialSet the explicit apiKeyEnv, or configure trusted global provider.<providerId>.options.apiKey, or a strict { "type": "api", "key": "..." } auth entry.
http_error, timeout, or response errorCheck the endpoint service and response format. /quota_status intentionally hides URLs, request/response contents, raw errors, and secret material.
One definition fails but others renderThis is expected partial-aggregate behavior. Successful definitions remain visible and the failed definition stays an error/status row.
Single-window output shows fewer rowsEach source keeps only its lowest remaining percentage, or first value row. Use "formatStyle": "allWindows" for every row.
CLI/export looks staleshow --json and the export file are cache-only and never fetch providers. Trigger a normal TUI/background refresh first. /quota_status is the live diagnostic surface.
Anthropic (Claude)

Run /quota_status and check the Anthropic section.

SymptomFix
claude not foundInstall Claude Code and make sure claude is on your PATH.
Claude is installed at a custom pathSet anthropicBinaryPath in opencode-quota/quota-toast.json.
Not authenticatedRun claude auth login, then confirm claude auth status works.
Auth works but no quota rows appearCheck quota_source and message in /quota_status; re-authenticate Claude if the OAuth credential fallback is missing or stale.
Provider not detectedConfirm OpenCode is configured to use the anthropic provider.
GitHub Copilot

Run /quota_status and check copilot_quota_auth, deployment, api_host, enterprise_host_source, billing_model, billing_scope, quota_api, budget_api, and token_compatibility_error.

SymptomFix
OpenCode Copilot works but no personal quota row appearsCheck oauth_accounting_state, deployment, and api_host; re-authenticate Copilot in OpenCode if the OAuth token or its stored GHE.com host is invalid.
Organization or enterprise accounting is missingCreate copilot-quota-token.json as described in GitHub Copilot setup. Public billing reports still need a separate billing credential.
GHE.com host is rejectedUse the enterprise hostname (for example acme.ghe.com) or a host-only HTTPS URL. Do not enter api., a path, query, fragment, port, userinfo, wildcard, HTTP URL, IP/localhost, or another domain.
Personal report is forbiddenUse a fine-grained PAT with Plan: read or a GitHub App user access token. A GitHub App installation token cannot query a personal report.
Organization report or budget is forbiddenUse an organization admin/billing-manager credential. Fine-grained PAT and GitHub App credentials need Organization administration: read. Usage can still appear with a budget warning when only budget access fails.
Enterprise report is forbiddenUse a classic PAT held by an enterprise admin or billing manager. GitHub does not support fine-grained PATs or GitHub App access tokens for enterprise billing reports.
Usage appears without a percentageThis is expected when GitHub supplies usage but no real allowance or positive budget denominator. opencode-quota does not invent a percentage.
Legacy PRU config is rejectedSet "billingModel": "legacy_premium_requests" only for an existing annual Copilot Pro or Pro+ plan that remained on legacy billing after June 1, 2026.
Rate-limit errorWait for GitHub's REST API rate limit to reset, then run /quota again.
OpenAI

Run /quota_status and check the OpenAI auth source and token status.

SymptomFix
OpenAI quota missingConfirm OpenCode native OpenAI OAuth is present in auth.json.
Token expiredRe-run OpenCode's OpenAI auth flow.
Provider not detectedConfirm your OpenCode config uses the openai provider or a compatible OpenAI auth entry.
Cursor

Run /quota_status and check the Cursor section.

SymptomFix
Cursor not detectedPut @playwo/opencode-cursor-oauth before @slkiser/opencode-quota in opencode.json.
Cursor auth missingRun opencode auth login --provider cursor.
Quota appears but no remaining percentageSet cursorPlan or cursorIncludedApiUsd in opencode-quota/quota-toast.json.
Billing cycle looks wrongSet cursorBillingCycleStartDay in opencode-quota/quota-toast.json to your local billing anchor day.
Unknown Cursor pricingRun /pricing_refresh; if still unknown, check /quota_status for unknown model ids.
Qwen Code

Run /quota_status and check qwen_oauth_source, qwen_local_plan, and the qwen_code live probe section.

SymptomFix
Qwen not detectedPut opencode-qwencode-auth before @slkiser/opencode-quota in opencode.json.
Auth missingComplete the Qwen companion plugin auth flow.
Counters do not moveConfirm the current model is qwen-code/*; Qwen quota is local request estimation for matching model usage.
Usage looks staleCheck the local state file path shown by /quota_status.
Alibaba Coding Plan

Run /quota_status and check the Alibaba auth, resolved tier, state-file path, and alibaba_coding_plan live probe section.

SymptomFix
API key not detectedUse ALIBABA_CODING_PLAN_API_KEY, ALIBABA_API_KEY, trusted user/global OpenCode config, or OpenCode auth. Repo-local provider secrets are ignored.
Limits need tuningRun opencode-quota provider add, choose local estimate, and use the maintained alibaba-coding-plan id with its five-hour, weekly, and monthly rolling windows.
Counters do not moveConfirm the current model is alibaba/* or alibaba-cn/*.
Quota seems staleCheck the state-file path shown in /quota_status.
MiniMax, Kimi, Chutes AI, Synthetic, Z.ai, Zhipu, NanoGPT, and DeepSeek

These providers use trusted env vars, trusted user/global OpenCode config, or native OpenCode auth. Run /quota_status and check the provider-specific API-key diagnostics.

ProviderUseful checks
MiniMax Token PlanUse MINIMAX_CODING_PLAN_API_KEY or MINIMAX_API_KEY for the international endpoint. Runtime/config ids like minimax and minimax-coding-plan use this provider. Repo-local provider secrets are ignored.
MiniMax Token Plan (CN)Use MINIMAX_CHINA_CODING_PLAN_API_KEY or trusted user/global OpenCode config under minimax-china-coding-plan, minimax-cn-coding-plan, minimax-cn, or minimax-china. Runtime id minimax-cn-coding-plan uses this provider.
Kimi CodeUse KIMI_API_KEY or KIMI_CODE_API_KEY; repo-local provider secrets are ignored.
Chutes AIUse CHUTES_API_KEY, trusted user/global config, or OpenCode auth.
SyntheticUse SYNTHETIC_API_KEY, trusted user/global config, or OpenCode auth.
Z.ai Coding PlanUse ZAI_API_KEY or ZAI_CODING_PLAN_API_KEY; malformed fallback auth is surfaced as an auth error.
Zhipu Coding PlanUse ZHIPU_API_KEY or ZHIPU_CODING_PLAN_API_KEY; malformed fallback auth is surfaced as an auth error.
NanoGPTUse NANOGPT_API_KEY, NANO_GPT_API_KEY, trusted user/global config, or OpenCode auth.
DeepSeekUse DEEPSEEK_API_KEY, trusted user/global config under provider.deepseek.options.apiKey, or OpenCode auth. This provider shows balance only because DeepSeek does not expose a quota reset window.

For security, repo-local opencode.json / opencode.jsonc is ignored for provider secrets in these integrations. Put secrets in environment variables or trusted user/global config. OpenCode auth fallbacks for API-key providers require { "type": "api", "key": "..." } entries.

Google Antigravity

Run /quota_status and check the google_antigravity section. The toast diagnostics also show the effective googleModels value and googleModels_source (default or the configuration file path).

SymptomFix
Companion missingPut opencode-antigravity-auth before @slkiser/opencode-quota in opencode.json.
Accounts not foundCheck the selected antigravity-accounts.json path shown by /quota_status.
Refresh tokens invalidRe-authenticate with the companion plugin.
Provider returns no rowsCheck live_probe, live_entry_*, and live_error_* in /quota_status.
Google AGY

Run /quota_status and check the google_agy section.

SymptomFix
Companion missingPut @anthonyhaussman/opencode-agy-auth before @slkiser/opencode-quota in opencode.json.
Provider not enabled in manual modeInclude google-agy in enabledProviders in opencode-quota/quota-toast.json.
Auth missingRun opencode auth login --provider google-agy.
Project missingSet OPENCODE_AGY_PROJECT_ID or provider.google-agy.options.projectId.
Provider returns no rowsCheck live_probe, live_entry_*, and live_error_* in /quota_status.
Gemini CLI (deprecated)

This section is only for repairing an existing setup. Gemini CLI quota support is deprecated in v4.1 and planned for removal in v5.0.0. Existing configuration and authentication continue to work; OpenCode Quota does not switch either one automatically. For new choices, see Gemini CLI in the provider guide.

Run /quota_status and check the Gemini CLI live probe rows.

SymptomFix
Companion missingPut opencode-gemini-auth before @slkiser/opencode-quota in opencode.json.
Provider not enabled in manual modeInclude google-gemini-cli in enabledProviders in opencode-quota/quota-toast.json.
Auth missingRun opencode auth login --provider google.
Project missingSet provider.google.options.projectId, OPENCODE_GEMINI_PROJECT_ID, GOOGLE_CLOUD_PROJECT, or GOOGLE_CLOUD_PROJECT_ID.
Xiaomi MiMo

Run /quota_status and check the xiaomi section. Diagnostics show state, source, checked paths, and safe live summaries, never cookie names, cookie values, or raw responses.

SymptomFix
Config not detectedSet MIMO_USAGE_COOKIE or create trusted user/global opencode-quota/mimo.json, then rerun /quota_status.
Config is invalidFix or remove the reported higher-priority source; invalid sources intentionally block fallback.
Provider not enabled in manual modeInclude canonical xiaomi in enabledProviders.
Monthly quota missingConfirm the plan is active and check live_error_*; explicitly expired plans are hidden.
Balance or plan details missingCheck the partial live summary. Usage, detail, and balance requests fail independently, so other available rows can still appear.
Per-key costs missingPer-API-key cost accounting is not supported until Xiaomi provides endpoint and schema evidence.
Session expiredSign in again at platform.xiaomimimo.com, manually copy a fresh request Cookie header, and update the same trusted credential source.
OpenCode Go

Run /quota_status and check the opencode_go section. It reports safe auth_* diagnostics, the selected display windows, normalized API usage, and live_fetch_error without exposing the API key.

SymptomFix
Provider not detectedSet OPENCODE_API_KEY, trusted global provider.opencode-go.options.apiKey, fallback provider.opencode.options.apiKey, a strict opencode-go API-key entry in OpenCode auth.json, or a strict legacy opencode auth entry as the final fallback. Then check auth_state, auth_source, and auth_checked_paths.
auth_state is invalidFix the primary opencode-go record in auth.json so it is { "type": "api", "key": "..." }. A malformed primary record blocks the legacy opencode fallback and is reported in auth_error.
API returns 401 or 403The usage API rejected the key. Update the winning source shown by auth_source, wait briefly for credential caching to expire, and rerun /quota_status.
Invalid API responseCheck live_fetch_error. OpenCode Quota requires valid 5h, Weekly, and Monthly results, so one missing or malformed API window rejects the full response instead of showing partial quota.
API request times out or failsCheck live_fetch_error, confirm https://opencode.ai/zen/go/v1/usage is reachable, and retry. Increase requestTimeoutMs only when the error is a timeout.
Expected window is not displayedCheck selected_windows, then update opencodeGoWindows in opencode-quota/quota-toast.json. This setting only filters the already validated 5h (rolling), Weekly (weekly), and Monthly (monthly) API results.
Provider missing in manual modeInclude opencode-go in enabledProviders in opencode-quota/quota-toast.json.
Token reports

Run /quota_status and check pricing snapshot health plus OpenCode database paths.

SymptomFix
/tokens_* is emptyStart OpenCode once so it creates opencode.db, then run a session with model usage.
Pricing looks staleRun /pricing_refresh.
Runtime pricing does not change outputCheck pricingSnapshot.source in opencode-quota/quota-toast.json; bundled keeps packaged pricing active.
Cursor model has unknown pricingRun /pricing_refresh; Cursor auto and composer* use bundled deterministic pricing.