Skip to content

feat: support bearer token auth for google-vertex-anthropic - #14177

Closed
avarayr wants to merge 1 commit into
anomalyco:devfrom
avarayr:feat/vertex-anthropic-bearer-token
Closed

feat: support bearer token auth for google-vertex-anthropic#14177
avarayr wants to merge 1 commit into
anomalyco:devfrom
avarayr:feat/vertex-anthropic-bearer-token

Conversation

@avarayr

@avarayravarayr commented Feb 18, 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 injects a fake authClient into googleAuthOptions so google-auth-library never tries to call Google's auth endpoints. This lets you use Vertex-compatible proxies that handle their own auth.

Same pattern as the existing amazon-bedrock bearer token support.

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.

How did you verify your code works?

Tested locally against a Vertex-compatible proxy using a bearer token.

Screenshots / recordings

N/A — no UI changes.

Checklist

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

CopilotAI review requested due to automatic review settings February 18, 2026 18:45

This comment was marked as spam.

@avarayr
avarayrforce-pushed the feat/vertex-anthropic-bearer-token branch from afd3bde to 73ba836CompareFebruary 18, 2026 22:53
@github-actions

Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actionsgithub-actionsBot added the needs:compliance This means the issue will auto-close after 2 hours. label Feb 18, 2026
@R44VC0RPR44VC0RP removed the needs:compliance This means the issue will auto-close after 2 hours. label Feb 18, 2026
@avarayr
avarayrforce-pushed the feat/vertex-anthropic-bearer-token branch 5 times, most recently from cf21df6 to 1cf0d11CompareFebruary 20, 2026 17:47
@R44VC0RP

Copy link
Copy Markdown
Collaborator

/review

@github-actions

Copy link
Copy Markdown
Contributor

lgtm

@avarayr
avarayrforce-pushed the feat/vertex-anthropic-bearer-token branch 5 times, most recently from 2f90edc to b0687baCompareFebruary 23, 2026 21:28
@avarayr
avarayrforce-pushed the feat/vertex-anthropic-bearer-token branch from b0687ba to 18b1855CompareFebruary 27, 2026 21:36
@TwIStOy

Copy link
Copy Markdown

Thanks for working on this feature! It's really helpful!
What's the status of this PR?

@avarayr
avarayrforce-pushed the feat/vertex-anthropic-bearer-token branch from 18b1855 to b92cd78CompareMarch 17, 2026 18:06
@pnancarrow

pnancarrow commented May 8, 2026

Copy link
Copy Markdown

we really need this feature in order to use anthropic models on vertex with opencode. anything I could do to help push it forward?

I also propose extending this as well: avarayr#1

@rekram1-node

Copy link
Copy Markdown
Collaborator

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

@aajisaka

Copy link
Copy Markdown

As this PR is closed, I've created a PR to resolve this issue (+ internal proxy support). Can someone review #32938?

Sign up for freeto 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

7 participants

@avarayr@R44VC0RP@TwIStOy@pnancarrow@rekram1-node@aajisaka