Skip to content

bug(opencode-go): All subscription models return "Request blocked by upstream provider" #38218

Closed as not planned

Description

@1335907208

Description

Describe the bug

After logging in with opencode-go subscription, every model call uniformly throws error:
Request blocked by upstream provider.
No single model under opencode-go subscription can complete any chat/completion request.

Steps to reproduce

  1. Install latest opencode release
  2. Run opencode TUI, execute /login
  3. Select opencode-go subscription auth flow, complete login normally
  4. Switch any model under opencode-go provider
  5. Send any prompt to trigger model inference
  6. Error pops up immediately without any response content

Expected behavior

All subscribed opencode-go models should normally complete LLM inference requests without upstream block error.

Actual behavior

Every model request returns identical error message:
Request blocked by upstream provider.
No logs with detailed upstream status code, no retry logic takes effect.

Environment

  • OS:
  • OpenCode version: opencode --version
  • Bun version: bun --version
  • Network: Direct connection / proxy

Additional context

  1. All models under opencode-go subscription are affected; no single model works.
  2. No rate limit prompt, no API key expired reminder, only upstream block message.
  3. Cleared local auth cache ~/.local/share/opencode and re-login multiple times, issue persists.
  4. Other third-party API key providers (openai compatible) work fine, only opencode-go subscription auth is blocked upstream.
  5. No custom modified config, default opencode.json with zero custom provider overrides.

Verification I've completed

  • Searched existing open issues for identical Request blocked by upstream provider bug, no duplicate ticket found
  • Cleared local auth storage and re-authenticated opencode-go subscription
  • Tested multiple different opencode-go models to confirm full provider-wide block
  • Confirmed network connectivity to other AI API providers works normally
  • Did not use AI-generated bulk text, all descriptions written manually

Plugins

No response

OpenCode version

v1.18.4

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Activity

  1. github-actions commented on Jul 22, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

  2. lumanlight commented on Jul 22, 2026

    @lumanlight

    Same issue here. All ocgo subscription models are returning "Request blocked by upstream provider" since yesterday. Models list can be fetched but none can do inference. Hope the team can fix this soon!

  3. lijq3370 commented on Jul 22, 2026

    @lijq3370

    Same problem

  4. gopalkalaleat-sudo commented on Jul 22, 2026

    @gopalkalaleat-sudo

    Same problem

  5. Jordan-Haidee commented on Jul 22, 2026

    @Jordan-Haidee

    Me too

  6. JNNarrator commented on Jul 22, 2026

    @JNNarrator

    the same question

  7. shcherbakov-ae commented on Jul 22, 2026

    @shcherbakov-ae

    Same problem

  8. 543229143 commented on Jul 22, 2026

    @543229143

    Same problem

  9. CrazyZfp commented on Jul 22, 2026

    @CrazyZfp

    same problem

  10. denejka commented on Jul 22, 2026

    @denejka

    Facing the same problem and cant resolve it

  11. Evgeniy347 commented on Jul 22, 2026

    @Evgeniy347

    same problem

  12. GAOHANG-G commented on Jul 22, 2026

    @GAOHANG-G

    我也是Provider authentication failed或者Request blocked by upstream provider,还以为账号被封了

  13. So-cean commented on Jul 22, 2026

    @So-cean

    +1

  14. ana52070 commented on Jul 22, 2026

    @ana52070

    同样的问题

  15. 13 remaining items

  16. urmiprakashtenably-lab commented on Jul 24, 2026

    @urmiprakashtenably-lab

    +1

  17. Burwin commented on Jul 27, 2026

    @Burwin

    +1

  18. Sanjay-doppalapudi commented on Aug 6, 2026

    @Sanjay-doppalapudi

    I traced this to source instead of guessing, and can answer the 证据? ("evidence?") question above with code and reproducible tests.

    Where the error comes from

    The string is thrown at exactly one place: packages/console/app/src/routes/zen/util/handler.ts, inside authenticate() (current dev):

    if (!data) throw new AuthError(t("zen.api.error.invalidApiKey"))
    if (
      data.workspace.isBlocked ||
      (data.workspace.isFlaggedByAnthropic && modelInfo.id.startsWith("claude-")) ||
      (data.workspace.isFlaggedByOpenAI && modelInfo.id.startsWith("gpt-"))
    )
      throw new AuthError(t("zen.api.error.requestBlockedByUpstreamProvider"))

    Introduced in c40e3e7 ("zen: add security check", 2026-07-21 18:33 UTC) together with migration 20260721182121_wet_pestilence, which adds the three workspace columns. First report of this string landed about two hours later (#38190).

    Which branch fires is forced by elimination. The two vendor flags only apply to claude-* and gpt-* model ids. Everyone in this thread (me included) gets the error on minimax-*, kimi-*, glm-*, deepseek-*, qwen* — and even the *-free models. Only the workspace.isBlocked disjunct is model-agnostic. So affected accounts have is_blocked = true on their workspace row.

    Evidence it never reaches any upstream provider

    1. The anonymous inversion. Byte-identical POSTs to /zen/v1/chat/completions, differing only in the Authorization header: mimo-v2.5-free, nemotron-3-ultra-free, longcat-2.0-free, deepseek-v4-flash-free, north-mini-code-free all return 200 with a real completion anonymously and 401 with my key — in the same second. Anonymous requests return early in authenticate() (if (!zenApiKey) { if (modelInfo.allowAnonymous) return ... }) and never reach the flag check. The upstreams are demonstrably up, through this exact gateway.
    2. Latency. Server-side time on the 401 is ~114 ms — the same as the purely local "Invalid API key." path, and far below any real relay round-trip. Nothing leaves the edge.
    3. Three distinct messages. No header → "Missing API key."; garbage key → "Invalid API key."; real key → "Request blocked by upstream provider." Reaching the third message proves the key row exists and is not soft-deleted — so re-login, cache clearing, and key rotation (everything this thread has tried) cannot help.

    Why this thread has 30 comments and no diagnosis

    The message says an upstream provider blocked the request. For the is_blocked branch no upstream was ever contacted — it is an opencode-side workspace block, surfaced with wording that points at a third party. That sends every affected user down the wrong debugging path (rotate key, clear cache, check billing, blame vendors).

    Two asks:

    1. For the maintainers: could someone check what is_blocked means operationally and what the remediation path is for accounts in this thread with active paid subscriptions? Several reporters ([Bug] OpenCode Go: return 401 Request blocked by upstream provider — chat/completions blocked while /v1/models works #38257, [Bug] OpenCode Go — "Request blocked by upstream provider" (HTTP 401) on all models despite active subscription #39215) state their subscription is active and paid through dates in August. My own subscription was purchased directly on opencode.ai with my own card — if the flag came from the July 20 anti-reseller sweep, accounts like these are false positives, and [Zen] AuthError: "Request blocked by upstream provider" — all Zen models broken, account recreated #39827 shows recreating the account does not clear it.
    2. For the error message: I've opened fix(console): distinct error message for blocked workspaces #40944, which splits is_blocked onto its own error string ("This workspace has been blocked. Contact support: …") so the next wave of affected users doesn't land here. Enforcement is unchanged — only the message.
  19. juanmah98 commented on Aug 7, 2026

    @juanmah98

    I can confirm every finding in @Sanjay-doppalapudi's analysis with independent testing. My workspace also has isBlocked = true — same AuthError on all models (deepseek-v4-pro, gemini-3-flash, minimax-m3, gpt-5.4-nano). Direct provider keys (DeepSeek, Anthropic) work fine.

    What we verified independently

    • curl directly to Zen API (bypassing OpenCode entirely): same 401 AuthError
    • Latency confirms no upstream call: response in ~115ms, identical to the local "Invalid API key" path
    • opencode models lists 60+ models successfully — the key is valid for listing but blocked for inference
    • Anonymous requests to free models return 200 — upstream providers are operational
    • Recreating the account with a different email and brand-new API key does not clear the flag

    No response from support
    We emailed [email protected] with full diagnostics and the link to this issue. No reply.

    The real impact
    I have paid credit sitting frozen in my Zen subscription — 2 weeks now. I'm a legitimate individual developer, not a reseller. This July 20 anti-reseller sweep caught me as a false positive and there is currently no documented remediation path.

    @StarpTech — is there any way for affected users with active paid subscriptions to get their workspaces reviewed and unblocked?

  20. VovanSSS commented on Aug 23, 2026

    @VovanSSS

    same promblem

    Image
  21. thdxr commented on Oct 11, 2026

    @thdxr
    Member

    Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.

    — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions