Skip to content

feat(provider): support bearer auth for google-vertex-anthropic - #32938

Closed
aajisaka wants to merge 2 commits into
anomalyco:devfrom
aajisaka:vertex-anthropic-bearer
Closed

aajisaka wants to merge 2 commits into
anomalyco:devfrom
aajisaka:vertex-anthropic-bearer

Conversation

@aajisaka

@aajisaka aajisaka commented Jun 19, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #14175

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

The google-vertex-anthropic loader now accepts a bearer token via VERTEX_ANTHROPIC_TOKEN env var or the auth flow. When present, it skips calling Google's auth endpoints. This lets you use Vertex-compatible proxies that handle their own auth.

It also

  • fixes the env var fallback chains (project, location, token) to use || instead of ??, since Env.get() returns "" for unset vars — ?? would keep the empty string and skip the fallback.
  • fixes the handling of baseURL. Before this fix, the URL is not correctly constructed if the baseURL is configured to non-default value.

How did you verify your code works?

Built locally, setup Google VertexAI with baseURL set to our internal proxy, and verified a few Anthropic models are working. Sample config:

    "google-vertex-anthropic": {
      "name": "Internal proxy",
      "options": {
        "baseURL": "<proxy base URL>",
        "project": "<project name>",
        "location": "<region>",
        "headers": {
          "<header key>": "<header value>",
        },
      },
    },

Screenshots / recordings

N/A

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

If you do not follow this template your PR will be automatically rejected.

Co-authored-by: avarayr <7735415+avarayr@users.noreply.github.com>
@thdxr

thdxr commented Oct 10, 2026

Copy link
Copy Markdown
Member

This branch has been upgraded to V2. We're no longer taking PRs for V1. If you think this is still relevant, please port it over and open it for V2.

— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

@thdxr thdxr closed this Oct 10, 2026
@aajisaka
aajisaka deleted the vertex-anthropic-bearer branch October 18, 2026 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Allow bypassing google-auth-library for google-vertex-anthropic via bearer token

2 participants