Skip to content

[BUG] Claude keeps asking to log in, when using GCP Vertex AI model #13663

Description

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

When opening Claude, it keeps welcoming me to:

  1. set up theme
  2. login:

Claude Code can be used with your Claude subscription or billed based on API usage through your Console account.

Select login method:

❯ 1. Claude account with subscription · Pro, Max, Team, or Enterprise

  1. Anthropic Console account · API usage billing

I have already setup and loaded an .env var file:

CLAUDE_CODE_USE_VERTEX=1
PROJECT_ID=my-project
CLOUD_ML_REGION=global
ANTHROPIC_VERTEX_PROJECT_ID=my-project
ANTHROPIC_VERTEXAI_REGION=europe-west1

and authenticated in GCP:

gcloud auth login
gcloud auth application-default login

it used to work till 2 days ago, then I upgrade to 2.0.64 and now 2.0.65 and this error shows up.
The problem happens both on MacOs terminal and VSCode terminal.

What Should Happen?

When running claude I should be able to bypass the login using the .env credentials.

Error Messages/Logs

> Claude Code can be used with your Claude subscription or billed based on API usage through your Console account.
> 
>  Select login method:
> 
>  ❯ 1. Claude account with subscription · Pro, Max, Team, or Enterprise
> 
>    2. Anthropic Console account · API usage billing

Steps to Reproduce

Run claude

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

2.0.65

Platform

Google Vertex AI

Operating System

macOS

Terminal/Shell

VS Code integrated terminal

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    api:vertexIssue relates to GCP Vertexarea:authbugSomething isn't workinghas reproHas detailed reproduction stepsplatform:macosIssue specifically occurs on macOSstaleIssue is inactive

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions