anomalyco / anomalyco/opencode

ZEN gemini-3.6-flash returns "Upstream request failed" while gemini-3.5-flash works

Open
#39,293 2 comments 0 reactions 1 assignee View on GitHub

@StarpTech is already working on this.

Since Jul 28, 2026.

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

Description

Description

gemini-3.6-flash consistently returns an upstream error, while gemini-3.5-flash works with the exact same request.

Plugins

No response

OpenCode version

No response

Steps to reproduce

Request

curl -X POST \
  "https://opencode.ai/zen/v1/models/gemini-3.6-flash:generateContent" \
  -H "x-goog-api-key: <ZEN_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [
      {
        "parts": [
          {
            "text": "Hello!"
          }
        ]
      }
    ]
  }'

**Result**
{
  "error": {
    "code": 400,
    "message": "Error from provider (Console): Upstream request failed",
    "status": "INVALID_ARGUMENT"
  }
}

**Expected**
The request should succeed and return a normal Gemini response.

**Additional information**
GET /v1/models includes gemini-3.6-flash.
Replacing the model with gemini-3.5-flash (same endpoint, same API key, same payload) works correctly.
Calling the official Google Gemini API directly with gemini-3.6-flash and the same payload also works.

### Screenshot and/or share link

_No response_

### Operating System

_No response_

### Terminal

_No response_

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.