Skip to content

[Bug] OpenCode Go — "Request blocked by upstream provider" (HTTP 401) on all models despite active subscription #39215

Closed as duplicate

Description

@jcastillovnz

Description

I have an active OpenCode Go subscription, but all API requests to /chat/completions are being rejected with:
{"type":"error","error":{"type":"AuthError","message":"Request blocked by upstream provider."}}

`
HTTP Status: 401

This affects all models (DeepSeek, GLM, Qwen, Kimi) on both the Go (/zen/go/v1) and Zen (/zen/v1) endpoints. The issue has persisted for multiple days.

Environment

  • OS: macOS
  • App: OpenCode Desktop (/Applications/OpenCode.app) — Electron
  • Subscription: OpenCode Go (active, usage at 0%)
  • Account: jcastillovnz@gmail.com
  • API Key (last 4 chars): Z22l (newly generated on 2026-07-27)

Steps to Reproduce

  1. Open OpenCode or run a curl request against the Go endpoint.
  2. Send any chat/completion request to any model.
  3. Receive HTTP 401 with AuthError: Request blocked by upstream provider.

Plugins
None (clean config — only $schema and shell defined in opencode.jsonc)
OpenCode version
1.18.7
Steps to reproduce

  1. Open OpenCode Desktop (v1.18.7) or run a curl request against the Go endpoint.
  2. Send any chat/completion request to any model (tested: deepseek-v4-flash, glm-5, qwen3.6-plus, kimi-k2.7-code).
  3. Receive HTTP 401 with: {"type":"error","error":{"type":"AuthError","message":"Request blocked by upstream provider."}}
    Curl reproduction command:
    curl -s -w "\nHTTP: %{http_code}" "https://opencode.ai/zen/go/v1/chat/completions"
    -H "Authorization: Bearer sk-u9TS...Z22l"
    -H "Content-Type: application/json"
    -d '{"model":"deepseek-v4-flash","messages":[{"role":"user","content":"hi"}],"stream":false}'
    Key finding: GET /models returns HTTP 200 (key is valid), but POST /chat/completions returns HTTP 401 (blocked).
    Two different API Keys tested with the same result — this is an account-level block, not a key issue.
    Related issues: bug(opencode-go): All subscription models return "Request blocked by upstream provider" #38218, Request blocked by upstream provider. #38216, Request blocked by upstream provider. #38190, [Bug] OpenCode Go: return 401 Request blocked by upstream provider — chat/completions blocked while /v1/models works #38257
    Screenshot and/or share link

N/A — Error is in API response, not UI. Full log excerpt:
timestamp=2026-07-27T23:28:08.897Z level=ERROR providerID=opencode-go modelID=deepseek-v4-flash error.error="AI_APICallError: Request blocked by upstream provider."
Operating System
macOS 26.5.2 (Build 25F84)
Terminal
zsh (default macOS terminal)

Activity

  1. github-actions commented on Jul 28, 2026

    @github-actions
    Contributor

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

    These issues describe the same or very similar symptoms. Please search existing issues before filing new ones, and consider adding a thumbs-up reaction or a comment to an existing issue instead.

  2. Sanjay-doppalapudi commented on Aug 6, 2026

    @Sanjay-doppalapudi

    Root cause traced to source in #38218 (comment) — short version: this string is thrown by the workspace.isBlocked check in packages/console/app/src/routes/zen/util/handler.ts (added in c40e3e7, 2026-07-21). No upstream provider is contacted; the request is refused at opencode's edge (~114 ms, same latency as the local invalid-key path), and the same models answer anonymously in the same second. Key rotation, cache clearing, and re-login cannot help. #40944 proposes a distinct error message for this case so it stops presenting as a vendor outage.

  3. OdinManiac commented on Aug 30, 2026

    @OdinManiac

    Fresh reproducible occurrence on 2026-08-30 UTC, affecting both Go and Zen inference while credential-authenticated catalogs remain available.

    Direct minimal probe results at 2026-08-30 01:06:46 UTC:

    • GET https://opencode.ai/zen/go/v1/models -> HTTP 200
    • POST https://opencode.ai/zen/go/v1/chat/completions with deepseek-v4-flash -> HTTP 401
    • GET https://opencode.ai/zen/v1/models -> HTTP 200
    • POST https://opencode.ai/zen/v1/messages with claude-sonnet-5 -> HTTP 401

    The inference probes were deliberately small: one plain text turn per provider, no tools, no streaming, no retries, and no capability/load test. A catalog request was made only after the inference 401 to distinguish invalid credentials from an inference-only block. Balances/subscriptions are active. Reissuing credentials did not resolve the condition.

    This strongly suggests an account/workspace or upstream inference-policy block rather than an invalid key, model typo, endpoint mismatch, or insufficient balance. The same integration had previously completed live turns with nonzero usage before transitioning to this state.

    Could a maintainer please clarify:

    1. Which policy or automated risk/compliance condition causes authenticated catalogs to remain HTTP 200 while all paid inference is HTTP 401?
    2. Is direct use of the documented Go/Zen endpoints from a custom coding-agent gateway permitted, including small tool, cancellation, and resume compatibility checks?
    3. What is the private support/appeal channel where I can provide the account email, workspace ID, request IDs, and API-key identifiers without posting credentials publicly?
    4. Could the API return a bounded machine-readable reason (for example account_suspended, workspace_blocked, or upstream_policy_blocked) instead of a generic 401 so clients do not misdiagnose this as an invalid key?

    I will not post API keys or full account identifiers in this public issue, but can provide them privately to the team.

  4. neriousy commented on Oct 1, 2026

    @neriousy
    Member

    Closing as a duplicate of #38218. Same "Request blocked by upstream provider" 401. This error comes from OpenCode's own gateway (a blocked workspace), not from an upstream provider. Account unblocks and refunds are handled per workspace, so please contact support (help@anoma.ly) with your workspace ID. You may also want to edit your email out of the issue body.

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