Skip to content

[BUG] VSCode Extension API Key auth creates new key instead of accepting existing console API keys #22224

Description

@gphilpott-com

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?

The Claude Code VSCode extension's API key authentication flow forces users to create a new key through an auth page, rather than allowing them to use existing console API keys that are already created and stored (e.g., in environment variables, GitHub secrets, etc.).
Environment:
OS: Linux
Running in: VSCode devcontainer
API key storage: GitHub secrets
Python terminal usage: Works fine with existing key
Additional Context:
The subscription auth flow works correctly
The existing console API key works successfully when called directly from terminal/Python scripts
The issue is specific to the VSCode extension's authentication UX

What Should Happen?

Expected Behavior:
The API key authentication flow should allow users to paste/input their existing console API key, similar to how most API-based tools work.
Actual Behavior:
The auth flow creates a new key instead of accepting an existing one. Users cannot use their pre-existing, already-configured API keys.

Error Messages/Logs

Steps to Reproduce

Have a working console API key already created and stored (e.g., in GitHub secrets, accessed via devcontainer)
Verify the key works (e.g., can successfully call Claude API from terminal/Python)
Attempt to authenticate Claude Code VSCode extension
Choose the "console API key" authentication route
Get redirected to an auth page that creates a NEW key

Claude Model

None

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

Claude Code version: 2.1.27

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

VS Code integrated terminal

Additional Information

Using GitHub Codespaces with web based VS Code editor on Safari

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions