Invalid Model Name in Model Selection Command

Resolved 💬 17 comments Opened Jun 13, 2025 by teemulinna Closed Jun 19, 2025
💡 Likely answer: A maintainer (dicksontsai, collaborator) responded on this thread — see the highlighted reply below.

Bug Description

/model opus

⎿ Set model to opus (claude-opus-4-20250514)

/model sonnet

⎿ Set model to sonnet (claude-sonnet-4-20250514)

/model help

⎿ Set model to help

model opus

⎿ API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"system: Invalid model name"}}

Environment Info

  • Platform: macos
  • Terminal: vscode
  • Version: 1.0.22
  • Feedback ID: 3e63832b-8339-42e0-be23-d559c037df9f

Errors

[{"error":"Error: Command failed: security find-generic-password -a $USER -w -s \"Claude Code\"\nsecurity: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.\n\n    at genericNodeError (node:internal/errors:983:15)\n    at wrappedFn (node:internal/errors:537:14)\n    at checkExecSyncError (node:child_process:892:11)\n    at execSync (node:child_process:964:15)\n    at zZ (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:659:3921)\n    at file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:582:8871\n    at Q (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:526:17199)\n    at tJ (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:582:8017)\n    at XS (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:582:7098)\n    at O6 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:582:11210)","timestamp":"2025-06-13T16:23:47.756Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"system: Invalid model name\"}}\n    at g6.generate (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1329:12578)\n    at Mw.makeStatusError (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1344:2082)\n    at Mw.makeRequest (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1344:5257)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async FE2.C11.showErrors (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1700:22008)\n    at async C11 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1700:12203)\n    at async FE2 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1700:21854)\n    at async file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1700:17103\n    at async Nt1 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1700:5151)\n    at async Yu (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1700:17073)","timestamp":"2025-06-13T16:28:01.635Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"system: Invalid model name\"}}\n    at g6.generate (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1329:12578)\n    at Mw.makeStatusError (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1344:2082)\n    at Mw.makeRequest (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1344:5257)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async FE2.C11.showErrors (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1700:22008)\n    at async C11 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1700:12203)\n    at async FE2 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1700:21854)\n    at async file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1700:17103\n    at async Nt1 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1700:5151)\n    at async Yu (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1700:17073)","timestamp":"2025-06-13T16:28:09.045Z"}]

View original on GitHub ↗

17 Comments

dicksontsai collaborator · 1 year ago

help is an invalid model name. There is no help subcommand for /model. You'll need to revise the value by running /model default, /model opus, or /model sonnet. Does this resolve your issue?

teemulinna · 1 year ago

No, I'm not. I have Max (100$). And as said, the model was changed to "help", which was a custom model for Claude Code. Nothing worked.

It is very easy for you to reproduce the bug in claude code:

/model help

I was able to revert the change and get back to Opus and Sonnet from the /config-menu.

This is certainly a bug that needs to be fixed, since with this you can get to software to non-functional state. Help and other reserved words needs to be prohibited as possible model names.

dicksontsai collaborator · 1 year ago

Sorry, I edited my original response once I saw what was happening with help (but the email with my original response might have already been sent out). We can certainly look into prohibiting such words with slash commands.

teemulinna · 1 year ago

Excellent.

CrystallineButterfly · 1 year ago

Hello @dicksontsai

I have the same issue as @thlinna but for normal messages, even if I type "Hi" I just get this error =

API Error: 400 {"type":"error","error":{"type":"invalid_re quest_error","message":"system: Invalid model name"}}

Please can you help fix this?

dicksontsai collaborator · 1 year ago

@CrystallineButterfly did you follow the possible resolution options:

  1. Revise the value by running /model default, /model opus, or /model sonnet.
  2. Revise through /config

If you are still stuck, please provide a screenshot of /status (with your personal info redacted).

CrystallineButterfly · 1 year ago

Yes I did these @dicksontsai

Ah thank you, I think maybe it is as I am on pro account not max? How do I change this in claude code so it knows?

/model
⎿ Set model to Default (Opus 4 for up to 50% of usage limits,
then use Sonnet 4)

Claude Code Status v1.0.24

IDE Integration • /config
✔ Connected to Cursor extension
LInstalled Cursor extension version 1.0.24 (server version:
1.0.2)

Account • /login
L Login Method: Claude Max Account

Model • /model
LDefault Opus 4 for up to 50% of usage limits, then use Sonnet 4
(currently Opus)

dicksontsai collaborator · 1 year ago

Your /status indicates that you are in a Max account, so in theory you shouldn't see the 400 issue any more. The usual things to try are:

  1. Run simple queries again (e.g. 1 + 1) to test
  2. Restart Claude Code
  3. /logout and /login again (but again, it doesn't appear necessary based on what you have in /status)
CrystallineButterfly · 1 year ago

Resolved thank you @dicksontsai

dicksontsai collaborator · 1 year ago
Help and other reserved words needs to be prohibited as possible model names.

Fixed in v1.0.28

NGOcoins · 1 year ago

so is opus available only for max?

dicksontsai collaborator · 1 year ago

@NGOcoins yes, in Claude Code, Pro users do not have access to Opus.

AhsanJamil04 · 1 year ago

Hello @dicksontsai
I have tried these things I am still not able to fix it can you please help me out?
※ Tip: Ctrl+Escape to launch Claude in your IDE

hi

⎿ API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"system: Invalid model
name"}}

/status

⎿ (no content)

yo

⎿ API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"system: Invalid model
name"}}

wsp

⎿ API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"system: Invalid model
name"}}

/status

⎿ (no content)

/model default

⎿ Set model to Default (Opus 4 for up to 50% of usage limits, then use Sonnet 4)

yo

⎿ API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"system: Invalid model
name"}}

1+1

⎿ API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"system: Invalid model
name"}}

Claude Code Status v1.0.43

Working Directory

IDE Integration • /config
✔ Connected to VS Code extension
L Installed VS Code extension version 1.0.43 (server version: 1.0.41)

Account • /login

Model • /model
L Default Opus 4 for up to 50% of usage limits, then use Sonnet 4 (currently Opus)

dicksontsai collaborator · 1 year ago

@AhsanJamil04 If you downgraded to Pro, you will need to run /logout and /login again.

DarkTraveler · 1 year ago

First of all, your product is amazing.
Secondly, I’ve been using it for two weeks, and today I encountered the same issue.
The first time I solved it by reinstalling the app, but the second time it didn’t help—even after trying /logout and /login.

From what I can see in similar discussions, this issue has been mentioned quite frequently today.

AhsanJamil04 · 1 year ago
@AhsanJamil04 If you downgraded to Pro, you will need to run /logout and /login again.

Thank you! always been on the pro, just needed to switch the model through the claude -- sonnet..... from the second github issues page. :)

github-actions[bot] · 11 months 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.