claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Can't log out of Claude Code API Key usage or use Vertex AI

Open andrew-kurin opened this issue 7 months ago • 2 comments

Environment

  • Platform (select one):
    • [ ] Anthropic API
    • [ ] AWS Bedrock
    • [x] Google Vertex AI
    • [ ] Other:
  • Claude CLI version: 1.0.3 (Claude Code)
  • Operating System: macOS 14.6.1 (23G93
  • Terminal: Warp

Bug Description

Vertex AI settings not available, can't log out from using API key

Steps to Reproduce

I have env vars for Vertex AI set in my .zshrc, but they are ignored by Claude Code now. export CLAUDE_CODE_USE_VERTEX=1 export CLOUD_ML_REGION=us-east5 export ANTHROPIC_VERTEX_PROJECT_ID=<project_id> /status shows that I'm logged in using API key

 Account • /login
  L Login Method: API Key (/login managed key)

/login and /logout steps are not available

Expected Behavior

Claude Code should be using Vertex AI instead of API key I should be able to /logout to stop using API key

Actual Behavior

I'm locked into using api key, Vertex AI settings are ignored

andrew-kurin avatar May 28 '25 04:05 andrew-kurin

This may be a visual issue with the /status command. If you set ANTHROPIC_LOG=debug, are you seeing traffic going to the first-party API or to Vertex?

ant-kurt avatar May 28 '25 05:05 ant-kurt

You are right, with ANTHROPIC_LOG=debug I can see traffic going to Vertex, url: https://us-east5-aiplatform.googleapis.com/v1/projects/

andrew-kurin avatar May 28 '25 05:05 andrew-kurin

We'll have the /status command fixed in the next release as well.

ant-kurt avatar May 28 '25 16:05 ant-kurt

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

github-actions[bot] avatar Aug 09 '25 14:08 github-actions[bot]