Description
When the Vertex AI provider's location is set to a continental multi-region value like us or eu, opencode builds an invalid API hostname:
Invalid hostname: us-aiplatform.googleapis.com
Only global is treated as not needing a region prefix on the hostname; us and eu need the same treatment (they're multi-region, not single-region like us-central1). This affects both the OpenAI-compatible endpoint template in opencode's own code, and the native @ai-sdk/google-vertex SDK call (which has the identical "only special-cases global" bug baked into its own default baseURL).
I have a fix ready and will open a PR referencing this issue.
Plugins
None
OpenCode version
1.18.1
Steps to reproduce
- Configure the google-vertex provider:
"provider": {
"google-vertex": {
"options": { "project": "", "location": "us" }
}
}
- Select a Gemini model
- Send a message — request fails with "Invalid hostname: us-aiplatform.googleapis.com"
Screenshot and/or share link
Operating System
macOS 26.5.1
Terminal
iTerm2
Description
When the Vertex AI provider's
locationis set to a continental multi-region value likeusoreu, opencode builds an invalid API hostname:Only
globalis treated as not needing a region prefix on the hostname;usandeuneed the same treatment (they're multi-region, not single-region likeus-central1). This affects both the OpenAI-compatible endpoint template in opencode's own code, and the native @ai-sdk/google-vertex SDK call (which has the identical "only special-cases global" bug baked into its own default baseURL).I have a fix ready and will open a PR referencing this issue.
Plugins
None
OpenCode version
1.18.1
Steps to reproduce
"provider": {
"google-vertex": {
"options": { "project": "", "location": "us" }
}
}
Screenshot and/or share link
Operating System
macOS 26.5.1
Terminal
iTerm2