Skip to content

All paid OpenCode Zen models fail with 'Upstream request failed' — free models work #36506

Closed

Description

@vicmuchina

Description

All paid OpenCode Zen models (e.g., opencode/MiniMax-M3, opencode/deepseek-v4-flash, etc.) fail with "Error from provider (Console): Upstream request failed". Free Zen models (e.g., opencode/big-pickle, opencode/deepseek-v4-flash-free) work fine. OpenCode Go models also work fine.

Environment

  • OpenCode version: latest (just upgraded)
  • OS: Linux (Pop!_OS)
  • Zen balance: $19.60 (from $52 total deposits, see payment history below)
  • Free models work: ✅ yes
  • Paid models fail: ❌ all of them

Payment History

Date Amount
Jul 12, 1:13 PM $10.00
Jul 7, 10:47 AM $12.00
Jun 9, 5:18 PM $5.00
May 4, 3:48 PM $10.00
Apr 30, 10:16 PM $10.00
Apr 6, 1:38 PM $5.00

Total deposited: $52.00 | Remaining balance: $19.60

Steps to Reproduce

  1. Connect OpenCode Zen provider via /connect
  2. Select any paid Zen model (e.g., opencode/MiniMax-M3)
  3. Send a message
  4. Observe error: "Error from provider (Console): Upstream request failed"

Suspected Root Cause

This looks similar to issue #28129 where upstream provider accounts used by the Zen backend are depleted or restricted. Free models use different upstream providers (NVIDIA, Cohere, etc.) which is why they still work. The Zen backend's upstream accounts for paid models need to be refilled.

Logs

Available at ~/.local/share/opencode/log/ on request.

cc @StarpTech @fwang

Activity

  1. matiasfha commented on Jul 16, 2026

    @matiasfha

    Same issue here. Adding more diagnostic data:

    Environment: macOS (Darwin arm64), OpenCode 1.18.3 (just upgraded from 1.17.11), Zen provider connected via API key from opencode.ai/auth

    Balance: Positive ($19.60+ remaining)

    Key findings:

    1. Direct curl to https://opencode.ai/zen/v1/chat/completions with a paid model (both deepseek-v4-flash and claude-sonnet-5) works fine with HTTP 200 — the upstream Zen API itself is healthy.
    2. The same paid model fails when called through the opencode client — same API key, same model.
    3. Free models (deepseek-v4-flash-free) work fine through both curl and the client.
    4. The client logs show: failed to load OpenCode provider config — HttpClientError: StatusCode: non 2xx status code (401 GET https://console.opencode.ai/api/config) — the Zen API key (sk-...) is rejected by the Console API.

    So the flow seems to be:

    • Free models (cost=0) → skip billing validation → call Zen API directly → ✅ works
    • Paid models (cost>0) → client tries to validate via console.opencode.ai/api/config → gets 401 → returns "Upstream request failed" without ever hitting the Zen API

    This matches the theory in the issue — the routing/billing validation layer between the client and the Zen API is broken, not the Zen API itself. cc @fwang @StarpTech

  2. StarpTech commented on Jul 16, 2026

    @StarpTech
    Contributor

    Hi, in case of issues, please upgrade to the latest version and share the information behind /debug command. Thank you!

  3. matiasfha commented on Jul 16, 2026

    @matiasfha

    Running latest versions

    Version: 1.18.3 (latest)
    Date: 2026-07-16T22:04:10.321Z
    OS: macOS 24.6.0 (arm64)
    Terminal: xterm-kitty
    Session ID: n/a
    Model: opencode/deepseek-v4-flash

  4. StarpTech commented on Jul 16, 2026

    @StarpTech
    Contributor

    You need to run /debug in the next session where you experience the issue.

  5. matiasfha commented on Jul 17, 2026

    @matiasfha

    Thas was run starting a session

    This is for a new session

    Version: 1.18.3 (latest)
    Date: 2026-07-17T00:57:18.243Z
    OS: macOS 24.6.0 (arm64)
    Terminal: xterm-kitty
    Session ID: ses_0926c3222ffe4OtoKTFhrv44GW
    Model: opencode/deepseek-v4-flash
    
  6. royhananwar commented on Jul 17, 2026

    @royhananwar

    got same issue but with opencode go kimi 3 model

    Version: 1.18.3 (latest)
    Date: 2026-07-17T10:25:08.515Z
    OS: macOS 24.6.0 (arm64)
    Terminal: iTerm.app 3.6.10
    Session ID: ses_090653d63ffeUFa2PKpVNa6AL9
    Model: opencode-go/kimi-k3
    
  7. StarpTech commented on Jul 17, 2026

    @StarpTech
    Contributor

    @royhananwar Hello, after inspection, we see the following provider error

    invalid temperature: only 1 is allowed for this model
    

    Do you overwrite it? I tried Kimi K3, and it works fine.

  8. alpharald commented on Jul 18, 2026

    @alpharald

    Kimi K3 seems to fail for me with the 'Error from provider (Console Go): Upstream request failed' message whenever I am connected to the xcode MCP.

    opencode.config:

    ...
      "mcp": 
      {
        "xcode": {
          "type": "local",
          "command": [
            "xcrun",
            "mcpbridge"
          ]
        }
    }
    ...
    

    Debug Info - Previously I only started the sessions with the MCP connected where it failed, started this session without MCP and it was successful. Connected the MCP mid-session and it failed. Then I switched to DS4Flash in the same session with the MCP still connected as a test and it worked. Only Kimi K3 seems to have issues with it:

    Version: 1.18.3 (latest)
    Date: 2026-07-18T05:23:36.815Z
    OS: macOS 25.5.0 (arm64)
    Terminal: ghostty 1.3.1
    Session ID: ses_08c5cd638ffejoBNfKDRgLju3K
    Model: opencode-go/deepseek-v4-flash
    

    I also just realized the macOS version is stated as 25.5.0 in the debug info but it actually is 26.5.2.

  9. royhananwar commented on Jul 18, 2026

    @royhananwar

    @StarpTech Hey, I didn’t change or overwrite anything.

    I tried on 2 different environments, one is my laptop and the second one is my server

    I just installed opencode on my server and tried kimi 3 have the same results like in my laptop.

    any idea why the temperature is not 1 ?

    I actually don’t know where to change the temperature model 😅

  10. xiaob1n commented on Jul 27, 2026

    @xiaob1n

    same with kimi 2.7 code
    Version: 1.18.4 (latest)
    Date: 2026-07-27T01:28:14.423Z
    OS: macOS 25.5.0 (arm64)
    Terminal: Apple_Terminal 470.2
    Session ID: ses_05ed3a17bffeODhuDTa1EYbvXK
    Model: cliproxyapi/kimi-k2.7-code

  11. AhmadEltobshy commented on Aug 17, 2026

    @AhmadEltobshy

    I’m experiencing a similar issue today, and it seems to affect Qwen models and a few other models as well.

    At first, I thought the OpenCode server was down because I kept getting:

    “Upstream request failed: Endpoint is unavailable”

    However, when I switched to Zen - DeepSeek V4 Flash Free, everything worked fine.

    Here’s my debug information:

    Version: 1.18.18 (latest)
    Date: 2026-08-17T00:49:08.129Z
    OS: Windows 10.0.22631 (x64)
    Terminal: unknown
    Session ID: ses_ff2f4e1a4ffeIUYrddDK3ITJFl
    Model: opencode-go/qwen3.7-plus

  12. Triumph1701 commented on Aug 17, 2026

    @Triumph1701

    The paid/free split makes it worth separating account entitlement from the paid-model upstream pool. Capture a request ID and the resolved provider/model route for one paid failure and one free success; the decisive question is whether paid requests reach a selected upstream and fail there, or are rejected before routing. That also lets the client return a meaningful unavailable/entitlement error instead of a generic “Upstream request failed.”

  13. lukeocodes commented on Aug 18, 2026

    @lukeocodes

    Happening today still. Doesn't feel like a CLI issue, but a service one. If I let it retry enough, eventually requests go through.

    Version: 1.18.15 (latest)
    Date: 2026-08-18T12:19:37.341Z
    OS: macOS 25.5.0 (arm64)
    Terminal: ghostty 1.3.1
    Session ID: ses_feb30583affeGHPjORYcbWZnq8
    Model: opencode/deepseek-v4-flash

  14. lukeocodes commented on Aug 18, 2026

    @lukeocodes

    Errors in the log (~/.local/share/opencode/log/opencode.log) are all AI_APICallError: Upstream request failed: Endpoint is unavailable. clustered for 8 minutes, then stopped.

  15. Triumph1701 commented on Aug 22, 2026

    @Triumph1701

    The paid/free split and the remaining Zen balance make this look more like a provider/accounting boundary than a model capability issue. I’d capture upstream status/request IDs and whether any balance was reserved before retrying; for users, a clearly reported compatible-provider fallback is safer than silently replaying a failed paid request. Full disclosure: I’m building Your Model, an OpenAI-compatible multi-provider API. If an external endpoint would help isolate this, I’m happy to provide test credits.

  16. lukeocodes commented on Aug 24, 2026

    @lukeocodes

    The paid/free split and the remaining Zen balance make this look more like a provider/accounting boundary than a model capability issue. I’d capture upstream status/request IDs and whether any balance was reserved before retrying; for users, a clearly reported compatible-provider fallback is safer than silently replaying a failed paid request. Full disclosure: I’m building Your Model, an OpenAI-compatible multi-provider API. If an external endpoint would help isolate this, I’m happy to provide test credits.

    I disagree it is an upstream issue, as it happens consistently across multiple providers models on the OpenCode gateway. I dislike you're using this legitimate issue to sell whats effectively a competitor to OpenCode Zen

  17. neriousy commented on Oct 21, 2026

    @neriousy
    Member

    Thanks for the report, and sorry for the disruption. This was a temporary problem with the hosted service or an upstream model provider, and it has since recovered. You can see live status and past incidents at https://status.opencode.ai. If you still see this now, please open a new issue with the time (with timezone), model, and request ID from the console logs.

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