[BUG] Subscription gets ignored when an API key env variable is set
Resolved 💬 3 comments Opened Mar 6, 2026 by supere989 Closed Mar 9, 2026
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When I try to switch to my Pro subscription, Claude Code would look at my key and say i don't have any usage.
<img width="1026" height="788" alt="Image" src="https://github.com/user-attachments/assets/8f713a7c-4900-4f8f-9928-f1300884e03f" />
What Should Happen?
IT should tell me that I have an API key set, and that if want to use my Subscription i need to clear the env api key.
Error Messages/Logs
You don't have any usage left.
Steps to Reproduce
set an API key with a balance of 0, then try to set it to use subscription. and login.
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.70
Platform
Anthropic API
Operating System
Other Linux
Terminal/Shell
Other
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗