From e1829f54e5f4696f229defa18583c919c1b45fb2 Mon Sep 17 00:00:00 2001 From: Calum Murray Date: Wed, 4 Mar 2026 11:44:19 -0500 Subject: [PATCH] fix(anthropic): anthropic with vertex works with service account json keys Signed-off-by: Calum Murray --- providers/anthropic/anthropic.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/providers/anthropic/anthropic.go b/providers/anthropic/anthropic.go index 4b593408d..9f02bfff1 100644 --- a/providers/anthropic/anthropic.go +++ b/providers/anthropic/anthropic.go @@ -28,6 +28,8 @@ const ( Name = "anthropic" // DefaultURL is the default URL for the Anthropic API. DefaultURL = "https://api.anthropic.com" + // VertexAuthScope is the auth scope required for vertex auth if using a Service Account JSON file (e.g. GOOGLE_APPLICATION_CREDENTIALS) + VertexAuthScope = "https://www.googleapis.com/auth/cloud-platform" ) type options struct { @@ -159,6 +161,7 @@ func (a *provider) LanguageModel(ctx context.Context, modelID string) (fantasy.L } else { var err error credentials, err = google.FindDefaultCredentials(ctx) + credentials, err = google.FindDefaultCredentials(ctx, VertexAuthScope) if err != nil { return nil, err }