[BUG] Claude Code "Invalid model name"
Status Fixed / completed
Maintainer reply ✓ Yes — dicksontsai
Workaround ✓ Mentioned in thread ↓
Activity 8 comments · opened Jul 1, 2025 · closed Jul 3, 2025
💡 Likely answer: A maintainer (dicksontsai, collaborator)
responded on this thread — see the highlighted reply below.
Environment
- Platform (select one):
- [ X] Anthropic API
- Claude CLI version:1.035
- Operating System:MacOS 15.5
- Terminal: Mac terminal
Bug Description
I had MAx subscription for a month and used it with Claude Code. Yesterday that subscription expired and today I subscribed to Pro. I logged out in Claude Code, then logged back in and ran /model. I selected Sonnet (the only option) and tried a prompt. I got:
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"system: Invalid model name"}}
The workaround running claude --model claude-sonnet-4-20250514 works but it just hides the issue. Please fix the underlying problem. I see that many people switching to Pro get the same error.
Steps to Reproduce
- Have Max subscription expire
- Subscribe to Pro
- Try using Claude Code
Expected Behavior
It should work
Actual Behavior
Any promnpt causes error:
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"system: Invalid model name"}}
8 Comments
Acknowledged. The current workaround is that you have to
/logoutand/loginagain for Claude Code to know about your new subscription plan.@dicksontsai I did /logout and /login after I changed the plan. It still showed the error. I just logged out and back in again a minute ago, and still the same error for any prompt.
Sounds like a bug. Thanks for reporting and trying that out.
same issue. /logout and /login hasn't worked
I have upgraded from free to pro subscription
@aleybovich can you send the email you used to login to dickson@anthropic.com ? I want to determine whether there is a possibility that your Claude Pro subscription did not go through for some reason.
@dicksontsai it actually started working properly today, so I'm all set. Not sure what changed though.
Thanks for the update.
@mtrin (or anyone else who encounters this issue after trying a version upgrade + /logout -> /login): you can email me too if you are still seeing issues.
We didn't change anything related to logins in recent versions as far as I can tell, so I am closing this issue.
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.