Invalid API Model Name in Request
Resolved 💬 25 comments Opened Jun 4, 2025 by sskw-ugo Closed Jun 5, 2025
💡 Likely answer: A maintainer (dicksontsai, collaborator)
responded on this thread — see the highlighted reply below.
Bug Description
Fail to call API with the error below\
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"system: Invalid model name"}}
Environment Info
- Platform: linux
- Terminal: vscode
- Version: 1.0.10
- Feedback ID: 47bd7819-a6e7-46da-a512-c9ef5a4715b2
Errors
[{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"system: Invalid model name\"}}\n at Y5.generate (file:///home/sskw/.nvm/versions/node/v22.9.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1336:12578)\n at Qw.makeStatusError (file:///home/sskw/.nvm/versions/node/v22.9.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1351:2082)\n at Qw.makeRequest (file:///home/sskw/.nvm/versions/node/v22.9.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1351:5257)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async Xz2.Me.showErrors (file:///home/sskw/.nvm/versions/node/v22.9.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1614:20217)\n at async Me (file:///home/sskw/.nvm/versions/node/v22.9.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1614:12044)\n at async Xz2 (file:///home/sskw/.nvm/versions/node/v22.9.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1614:20080)\n at async file:///home/sskw/.nvm/versions/node/v22.9.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1614:16842\n at async Yo1 (file:///home/sskw/.nvm/versions/node/v22.9.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1614:5204)\n at async Ld (file:///home/sskw/.nvm/versions/node/v22.9.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1614:16812)","timestamp":"2025-06-04T22:53:59.838Z"},{"error":"Error: Another process is currently installing an update\n at RH1 (file:///home/sskw/.nvm/versions/node/v22.9.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1923:1587)\n at file:///home/sskw/.nvm/versions/node/v22.9.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:2217:6307\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-06-04T22:54:10.370Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"system: Invalid model name\"}}\n at Y5.generate (file:///home/sskw/.nvm/versions/node/v22.9.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1336:12578)\n at Qw.makeStatusError (file:///home/sskw/.nvm/versions/node/v22.9.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1351:2082)\n at Qw.makeRequest (file:///home/sskw/.nvm/versions/node/v22.9.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1351:5257)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async Xz2.Me.showErrors (file:///home/sskw/.nvm/versions/node/v22.9.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1614:20217)\n at async Me (file:///home/sskw/.nvm/versions/node/v22.9.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1614:12044)\n at async Xz2 (file:///home/sskw/.nvm/versions/node/v22.9.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1614:20080)\n at async file:///home/sskw/.nvm/versions/node/v22.9.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1614:16842\n at async Yo1 (file:///home/sskw/.nvm/versions/node/v22.9.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1614:5204)\n at async Ld (file:///home/sskw/.nvm/versions/node/v22.9.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1614:16812)","timestamp":"2025-06-04T22:54:17.961Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"system: Invalid model name\"}}\n at Y5.generate (file:///home/sskw/.nvm/versions/node/v22.9.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1336:12578)\n at Qw.makeStatusError (file:///home/sskw/.nvm/versions/node/v22.9.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1351:2082)\n at Qw.makeRequest (file:///home/sskw/.nvm/versions/node/v22.9.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1351:5257)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async Xz2.Me.showErrors (file:///home/sskw/.nvm/versions/node/v22.9.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1614:20217)\n at async Me (file:///home/sskw/.nvm/versions/node/v22.9.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1614:12044)\n at async Xz2 (file:///home/sskw/.nvm/versions/node/v22.9.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1614:20080)\n at async file:///home/sskw/.nvm/versions/node/v22.9.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1614:16842\n at async Yo1 (file:///home/sskw/.nvm/versions/node/v22.9.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1614:5204)\n at async Ld (file:///home/sskw/.nvm/versions/node/v22.9.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1614:16812)","timestamp":"2025-06-04T22:56:01.590Z"}]
25 Comments
Thanks for your report. Can you share the output of
/status(related to the model and account type, redact your email and other sensitive info) before and after your error?Also, if you're on a Claude Pro plan, you should try using 1.0.11 instead.
Try to switch your model to sonnet with pro plan
I can confirm that switching to sonnet works!
Thanks @gunpal5
!Image
It's not working. I'm on the
@anthropic-ai/claude-code@1.0.11!Image
@dicksontsai
@abhagsain
Exit your current session, then type in:
claude --model claude-sonnet-4-20250514
It's working now. Thank you 🫡
I will close this bug out with a couple recommendations:
/logoutthen/loginfor your Claude Pro subscription to take effect properly.claude --model claude-sonnet-4-20250514is a workaround, but we do not recommend it, since it masks the underlying issue that your local account state is incorrect.I get the same error with Cursor / Mac.
Claude Code v1.0.16
Same error on Claude Code v1.0.34 (MacOS), the fix is still working (using model "claude-sonnet-4-20250514")
~I'm on the latest version of Claude Code (1.0.35) and I have a Pro subscription, yet the problem persists. When I switch to API pricing it works without a hitch. I uninstalled and reinstalled Claude Code without any luck...~
~It worked a week back, I think it was using the global npm installation, and might've broken when using the recommended local installation.~
Opened a new terminal session to double check /status and /doctor output, everything works fine now without overriding any models.
Unfortunately, I also have this error on a fresh, first time installation of Claude Code after upgrading my account. It is worked around by claude --model <aformentionedmodelstring> . This is a VM so, I had to install npm first and then Ubuntu required me to use sudo to install claude. Afterwards, running claude doctor prompted me to move the claude install to my home folder. Not sure if any of this is useful.
After my Max plan expired, I chose to downgrade from the Max plan to the Pro plan, and the problem occurred
I can confirm the problem after downgrading from Max to Pro. I am on Mac
The workaround works for now but please find a real solution
I'm on pro and today I have issues. For /model I see this
same. but this workaround still works:
claude --model claude-sonnet-4-20250514
But note what dick above said
If the above fails, claude --model claude-sonnet-4-20250514 is a workaround, **but we do not recommend it**, since it masks the underlying issue that your local account state is incorrect.i also have the issue on windows
i have the same issue on windows
run
/statusand then follow whatever instructions it gives you. After downgrading I was seeing an npm mismatch issue but running/statusand following the prompts fixed it.Fails for me on Mac when calling Opus. Using Max account. Started today the moment I've started new session. Worked fine at least on Friday, can't really remember when I've started the old session, but definitely last week. Works fine with Sonnet.
For info i had the same issue today after 3 weeks of intense use without problem. Here is my config:
Claude Code Status v1.0.43
Model • /model
L Default Opus 4 for up to 50% of usage limits, then use Sonnet 4 (currently Opus)
I then switched to claude-sonnet-4-20250514 and the problem went away.
@co-marat-y and @thefourthhorseman , can you email me (dickson@anthropic.com) the email and org info you see when you run
/status? Assuming you have already run/logoutthen/login, then what you have seen is unexpected.Claude Pro subscriptions can only access Sonnet in Claude Code.
shut close the claude code and run it back it solved my problem
I have the same problem on Pro Max subscription
All of a sudden I get
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"system: Invalid model name"}}Claude Code Status v1.0.60
L Session ID: 138a4664-90a6-4237-a4b2-3d3e0be86a9d
Working Directory
MCP servers • /mcp
✔ zen
Account • /login
L Login Method: Claude Max Account
L Organization:
L Email:
Memory • /memory
L project: CLAUDE.md
Model • /model
L claude-opus-4-0
I've also tried logging out and logging in and I can only get it to work when I specify the model name
I've also tried uninstalling and installing
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.