Skip to content

Google Gemini 3.7 Flash is incorrectly rewritten to nonexistent -tiered model ID #1894

Description

@RainbowDashy

Client or integration

Codex App

Provider or upstream service

Google Gemini API / AI Studio

OpenCodex version

2.22.0

Endpoint or capability

/v1/responses → Gemini streamGenerateContent

Current behaviour

Selecting google/gemini-3.7-flash returns HTTP 404.

OpenCodex rewrites the valid model ID:

gemini-3.7-flashgemini-3.7-flash-tiered

This mapping currently exists in src/adapters/google.ts:

const GEMINI_DIRECT_WIRE_RENAMES: Record<string, string> = {
  "gemini-3.7-flash": "gemini-3.7-flash-tiered",
  "gemini-3.6-flash": "gemini-3.6-flash-tiered",
};

The authenticated Gemini Models API confirms:

  • models/gemini-3.7-flash returns HTTP 200.
  • models/gemini-3.7-flash-tiered returns HTTP 404 with:
    Model is not found: models/gemini-3.7-flash-tiered for api version v1beta

Consequently, requests routed through OpenCodex fail with http_404.

Expected behaviour

OpenCodex should send gemini-3.7-flash unchanged to the Gemini API, matching Google's documented model code and the model returned by models.list.

Minimal redacted request or reproduction

# Confirm the documented model exists
curl \
  -H "x-goog-api-key: $GEMINI_API_KEY" \
  https://generativelanguage.googleapis.com/v1beta/models/gemini-3.7-flash
# HTTP 200

# Confirm the OpenCodex-rewritten model does not exist
curl \
  -H "x-goog-api-key: $GEMINI_API_KEY" \
  https://generativelanguage.googleapis.com/v1beta/models/gemini-3.7-flash-tiered
# HTTP 404

# Reproduce through OpenCodex
codex exec \
  --skip-git-repo-check \
  -m google/gemini-3.7-flash \
  "Reply only OK"
# HTTP 404 / http_404

Actual response or error

Model is not found: models/gemini-3.7-flash-tiered for api version v1beta

OpenCodex request history reports:

provider: google
model: gemini-3.7-flash
status: 404
errorCode: http_404

Upstream documentation

https://ai.google.dev/gemini-api/docs/models/gemini-3.7-flash

Suggested mapping or implementation notes

Remove the gemini-3.7-flash entry from GEMINI_DIRECT_WIRE_RENAMES, allowing the direct Gemini adapter to use the documented model ID unchanged.

A local test with that single mapping removed resolves the incorrect endpoint selection.

Additional context

  • OS: macOS 15.7.7
  • The API key is valid and can retrieve models/gemini-3.7-flash.
  • The same stale rewrite is present on the current main branch.
  • Existing provider-compatibility issues were searched; no duplicate was found.

Checks

  • I searched existing provider and compatibility issues.
  • The request and response were redacted.
  • The expected behaviour is based on an upstream specification or concrete client requirement.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingproviderProvider adapters, OpenAI-compat presets, upstream API quirksprovider-compatibilityProvider compatibility reports

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions