Skip to content

[Bug] OpenCode Go: return 401 Request blocked by upstream provider — chat/completions blocked while /v1/models works #38257

Description

@lizijiangyyjx

Description

Starting today (2026-07-22), all models under my OpenCode Go subscription are returning 401 Request blocked by upstream provider when calling the chat/completions endpoint. The /v1/models endpoint works fine.

This appears to be a server-side issue affecting Go subscriptions, not a client configuration problem.

Account Details

  • Subscription: OpenCode Go
  • Expiry: 2026-08-13
  • Console status: All usage limits (5h / weekly / monthly) show sufficient balance
  • API Key: Valid (tested with newly created key, same result)

Affected Models

All of the following models return the same error:

Model Result
deepseek-v4-flash ❌ 401
kimi-k2.6 ❌ 401
glm-5.2 ❌ 401
mimo-v2.5 ❌ 401

Reproduction Steps

Step 1: List models (works)

curl -H "Authorization: Bearer $OPENCODE_API_KEY" \
  https://opencode.ai/zen/go/v1/models

Result: 200 OK — returns full model list including all 4 models above.

Step 2: Chat completion (fails)

curl -X POST https://opencode.ai/zen/go/v1/chat/completions \
  -H "Authorization: Bearer $OPENCODE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"deepseek-v4-flash","messages":[{"role":"user","content":"hello"}]}'

Result:

{"type":"error","error":{"type":"AuthError","message":"Request blocked by upstream provider."}}

What I've Verified

  • API Key is valid and active
  • Base URL is correct (https://opencode.ai/zen/go/v1)
  • Tested directly with curl to eliminate client-side issues
  • Created a brand new API Key — same result
  • All models affected, not just one
  • Console shows sufficient usage quota remaining

Related Issues

Possibly related to #21097 and #20984 which report similar symptoms.


Expected Behavior

chat/completions should return a valid response when the API Key is valid, subscription is active, and usage quotas are not exceeded.

Actual Behavior

All chat/completions requests return 401 Request blocked by upstream provider, while GET /v1/models works fine with the same key.

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

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