Gemini 3 Flash Preview returns 404 - uses wrong Vertex AI endpoint format #7210

Closed
opened 2026-02-16 18:06:28 -05:00 by yindo · 2 comments
Owner

Originally created by @ArielOfri-Wiz on GitHub (Jan 22, 2026).

Originally assigned to: @thdxr on GitHub.

Problem

google/gemini-3-flash-preview returns 404 error despite being available in my GCP project.

Not Found: [{ "error": { "code": 404, "message": "Requested entity was not found.", "status": "NOT_FOUND" } }]

Root Cause

Gemini 3 models are only available through the non-regional endpoint, but OpenCode uses the regional hostname format.

Works:

https://aiplatform.googleapis.com/v1/projects/{project}/locations/{location}/publishers/google/models/gemini-3-flash-preview

Fails (current OpenCode behavior):

https://{location}-aiplatform.googleapis.com/v1/projects/{project}/locations/{location}/publishers/google/models/gemini-3-flash-preview

Steps to Reproduce

  1. Set up Vertex AI with GOOGLE_CLOUD_PROJECT and authenticate via gcloud
  2. Select google/gemini-3-flash-preview model
  3. Send any message
  4. Get 404 error

Environment

  • OpenCode version: 1.1.20
  • OS: macOS
  • VERTEX_LOCATION: not set (or any value)

Suggested Fix

Use aiplatform.googleapis.com hostname (without region prefix) for Gemini 3 models, or for all models as it works universally.

Originally created by @ArielOfri-Wiz on GitHub (Jan 22, 2026). Originally assigned to: @thdxr on GitHub. ## Problem `google/gemini-3-flash-preview` returns 404 error despite being available in my GCP project. ``` Not Found: [{ "error": { "code": 404, "message": "Requested entity was not found.", "status": "NOT_FOUND" } }] ``` ## Root Cause Gemini 3 models are only available through the **non-regional endpoint**, but OpenCode uses the regional hostname format. ### Works: ``` https://aiplatform.googleapis.com/v1/projects/{project}/locations/{location}/publishers/google/models/gemini-3-flash-preview ``` ### Fails (current OpenCode behavior): ``` https://{location}-aiplatform.googleapis.com/v1/projects/{project}/locations/{location}/publishers/google/models/gemini-3-flash-preview ``` ## Steps to Reproduce 1. Set up Vertex AI with `GOOGLE_CLOUD_PROJECT` and authenticate via gcloud 2. Select `google/gemini-3-flash-preview` model 3. Send any message 4. Get 404 error ## Environment - OpenCode version: 1.1.20 - OS: macOS - `VERTEX_LOCATION`: not set (or any value) ## Suggested Fix Use `aiplatform.googleapis.com` hostname (without region prefix) for Gemini 3 models, or for all models as it works universally.
yindo closed this issue 2026-02-16 18:06:28 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 22, 2026):

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

  • #6454: [BUG]: Google Auth Gemini 3 models return 404 "Requested entity was not found" error - discusses 404 errors when using Gemini 3 models via Google OAuth
  • #3940: Google Vertex Not Found - describes incorrect URL formatting with undefined values in the endpoint
  • #7996: Vertex AI location env vars not recognized - related to Vertex AI location configuration issues
  • #5712: Unable to use vertex gemini 3 pro - another case of Vertex Gemini 3 pro integration failing

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 22, 2026): This issue might be a duplicate of existing issues. Please check: - #6454: [BUG]: Google Auth Gemini 3 models return 404 "Requested entity was not found" error - discusses 404 errors when using Gemini 3 models via Google OAuth - #3940: Google Vertex Not Found - describes incorrect URL formatting with undefined values in the endpoint - #7996: Vertex AI location env vars not recognized - related to Vertex AI location configuration issues - #5712: Unable to use vertex gemini 3 pro - another case of Vertex Gemini 3 pro integration failing Feel free to ignore if none of these address your specific case.
Author
Owner

@ArielOfri-Wiz commented on GitHub (Jan 22, 2026):

Closing - filed in error

@ArielOfri-Wiz commented on GitHub (Jan 22, 2026): Closing - filed in error
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7210