anomalyco / anomalyco/opencode

OpenCode Go: deepseek-v4.1-flash returns 402 insufficient_user_quota from OrcaRouter while Go quota is healthy

Open
#49,936 4 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

deepseek-v4.1-flash via OpenCode Go returns HTTP 402 insufficient_user_quota from an OrcaRouter upstream, while the OpenCode Go account quota is healthy and other Go models work with the same API key/session.

This is the same September wave reported in #37231 (see the 2026-09-19 comment from @hyuri) and #49416.

Steps to reproduce
  1. Call OpenCode Go Chat Completions with deepseek-v4.1-flash:
curl https://opencode.ai/zen/go/v1/chat/completions \
  -H "Authorization: Bearer $OPENCODE_GO_API_KEY" \
  -H "Content-Type: application/json" \
  -H "x-opencode-session: <stable-uuid>" \
  -d '{"model":"deepseek-v4.1-flash","messages":[{"role":"user","content":"ping"}],"max_tokens":16,"stream":false,"reasoning_effort":"max"}'

Response: HTTP 402

{"error":{"param":"","type":"insufficient_quota","message":"Upstream request failed: [insufficient_user_quota] You're out of credits — this request needs $0.000076. Add credits to keep going: https://www.orcarouter.ai/console/billing?ref=err_credit_gate#add-credits (request id: 202609190910094345896158268d9d6KTOPRUVn)"}}
  1. Check OpenCode Go usage with the same key:
curl https://opencode.ai/zen/go/v1/usage \
  -H "Authorization: Bearer $OPENCODE_GO_API_KEY"

Result: HTTP 200, rolling: 8%, weekly: 52%, monthly: 26% — so the Go account itself is not out of quota.

  1. Repeat the same request with other Go models using the same key/session:
Model Result
deepseek-v4-flash 200
deepseek-v4-pro 200
glm-5.3 200
kimi-k3 200
deepseek-v4.1-flash 402 OrcaRouter insufficient_user_quota
Expected behavior

deepseek-v4.1-flash should either:

  • be routed to an OrcaRouter upstream that has credits, or
  • fail over to another healthy upstream for the same model, or
  • return a clear Go-side error rather than an upstream billing error from a provider account the user does not control.
Screenshot and/or share link

Additional request IDs seen through Codex/CC Switch:

  • 202609190906131118841918268d9d6FhC6V16u
  • 202609190906121880800248268d9d6CUDOXaQW
  • 202609190904513598759728268d9d6Glic6pO9
Operating System

Windows 11

Terminal

PowerShell 7 / Codex via CC Switch 3.20.3 (direct OpenCode Go API calls; not using the OpenCode CLI)

Related
  • #37231
  • #49416
  • #37056

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Chat Completions request for deepseek-v4.1-flash and compare it with the listed models that return 200; check the /usage endpoint to confirm the account quota is healthy. Trace the OpenCode Go request path for model routing and upstream errors. Done means the model uses a healthy route, fails over, or returns a clear Go-side error instead of OrcaRouter billing details.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.