[PR #6287] feat: add Google Vertex AI service account JSON authentication #11818

Open
opened 2026-02-16 18:16:45 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/6287

State: open
Merged: No


Add support for authenticating to Google Vertex AI using service account JSON credentials, with proper credential separation from regular Google (Gemini) API keys.

Google Cloud actively makes it hard to use api keys with Vertex - with a complicated permission grant structure. The preferred mechanism is service accounts with json tokens. Not supporting it is a huge problem.

Changes:

  • Add service account JSON auth flow in CLI (opencode auth login)
  • Add TUI dialog for pasting service account JSON with location input
  • Update provider loaders to use stored credentials with googleAuthOptions
  • Explicitly set key: undefined and apiKey: null in Vertex loaders to prevent credential leakage from other providers
  • Rename "Vertex" to "Google Vertex AI" consistently across UI:
    • /connect menu
    • Model selection dialog
    • Status bar below text entry
  • Add comprehensive tests verifying credential separation between google, google-vertex, and google-vertex-anthropic providers

The three providers (google, google-vertex, google-vertex-anthropic) are now completely independent and can be configured simultaneously without credentials leaking between them.

for issues
#5712
#6280
#5711
#3586
#5097
#4282
#272
#553
#402
#1204

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/6287 **State:** open **Merged:** No --- Add support for authenticating to Google Vertex AI using service account JSON credentials, with proper credential separation from regular Google (Gemini) API keys. Google Cloud actively makes it hard to use api keys with Vertex - with a complicated permission grant structure. The preferred mechanism is service accounts with json tokens. Not supporting it is a huge problem. Changes: - Add service account JSON auth flow in CLI (`opencode auth login`) - Add TUI dialog for pasting service account JSON with location input - Update provider loaders to use stored credentials with googleAuthOptions - Explicitly set `key: undefined` and `apiKey: null` in Vertex loaders to prevent credential leakage from other providers - Rename "Vertex" to "Google Vertex AI" consistently across UI: - /connect menu - Model selection dialog - Status bar below text entry - Add comprehensive tests verifying credential separation between google, google-vertex, and google-vertex-anthropic providers The three providers (google, google-vertex, google-vertex-anthropic) are now completely independent and can be configured simultaneously without credentials leaking between them. for issues #5712 #6280 #5711 #3586 #5097 #4282 #272 #553 #402 #1204
yindo added the pull-request label 2026-02-16 18:16:45 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#11818