[BUG] Claude Code "Invalid model name"

Status Fixed / completed
Maintainer reply ✓ Yes — dicksontsai
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

  1. Have Max subscription expire
  2. Subscribe to Pro
  3. 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"}}

View original on GitHub ↗

8 Comments

dicksontsai collaborator · 1 year ago

Acknowledged. The current workaround is that you have to /logout and /login again for Claude Code to know about your new subscription plan.

aleybovich · 1 year ago

@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.

dicksontsai collaborator · 1 year ago

Sounds like a bug. Thanks for reporting and trying that out.

mtrin · 1 year ago

same issue. /logout and /login hasn't worked
I have upgraded from free to pro subscription

dicksontsai collaborator · 1 year ago

@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.

aleybovich · 1 year ago

@dicksontsai it actually started working properly today, so I'm all set. Not sure what changed though.

dicksontsai collaborator · 1 year ago

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.

github-actions[bot] · 1 year ago

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.