[BUG] There's an issue with the selected model (claude-sonnet-4-6).

Open 💬 33 comments Opened Feb 17, 2026 by nibblesnbits

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 trying to use the new Sonnet 4.6 model on the latest Claude Code CLI on both Windows and Ubuntu, I get this output:

juno@juno-thinkpad:~$ claude --model claude-sonnet-4-6

 ▐▛███▜▌   Claude Code v2.1.45
▝▜█████▛▘  Sonnet 4.6 · API Usage Billing
  ▘▘ ▝▝    /home/juno

  /model to try Opus 4.6

❯ this working yet?

● There's an issue with the selected model (claude-sonnet-4-6). It may not exist or you may not have
  access to it. Run /model to pick a different model.

What Should Happen?

Claude should respond without error.

Error Messages/Logs

● There's an issue with the selected model (claude-sonnet-4-6). It may not exist or you may not have
  access to it. Run /model to pick a different model.

Steps to Reproduce

  1. Run the Claude Code CLI with claude --model claude-sonnet-4-6 or select the "Sonnet (1M context)" selection with the /model command.
  2. Send any prompt.
  3. Claude responds with "There's an issue with the selected model"

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.45 (Claude Code)

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Other

Additional Information

_No response_

View original on GitHub ↗

33 Comments

imindesign96 · 4 months ago

me too~

Kav91 · 4 months ago

Had to roll back to 2.0.64 to avoid this problem.

 curl -fsSL https://claude.ai/install.sh | bash -s 2.0.64
osc707 · 4 months ago

same issue here, macOS 26.3.1, pro account, terminal and vscode extension.
Tried downgrading, but it auto upgrades

TerminatedProcess · 4 months ago

Same here , cachyos linux. exact same message. I did just setup ollama to run claude and select and ollama model, but it started showing that message. Now that I've tried moving it back to opus, it still happens.

wssiagt · 3 months ago

Same in v2.1.81, windows 11

nullVallue · 3 months ago

Same here on MacOS Tahoe 26.3.1, ClaudeCode v2.1.81. When is this gonna be fixed, I just upgraded to Pro version and it's already not working, what a great start.

AdminSam313 · 3 months ago

Same thing. Downgrade not helping aswell. My system: 6.12.74+deb13+1-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.74-2 (2026-03-08) x86_64 GNU/Linux. That ai slop is going crazy. That fucking thing now can be even debugged or just emulated. Good job anthropic with you obfuscation and anti-emulation efforts, gg wp!

ashtanko · 3 months ago

The same issue:

  • Claude Code v2.1.81
  • OS: Ubuntu
jayanthmb14 · 3 months ago

Guys found the fix it's because 2 diffrent model of Opus is installed. You need to uninstall all the previous model and then install all the model at once.

i have attached the complete instruction (.md File)

Claude_Code_Fix_Guide.md

nianliunian · 3 months ago

The same issue:

Claude Code v2.1.87

OS: Windows

ashtanko · 3 months ago
Guys found the fix it's because 2 diffrent model of Opus is installed. You need to uninstall all the previous model and then install all the model at once. i have attached the complete instruction (.md File) Claude_Code_Fix_Guide.md

Great job @jayanthmb14! Thanks for the guild, it helped!

duanxibo · 3 months ago

The same issue:

Claude Code v2.1.96

OS: Windows

MichaelAnsolis-IonQ · 3 months ago

Seeing basically the same in Claude Code VSCode extension v2.1.100 until I manually select a model for every new conversation I start:

There's an issue with the selected model (claude-opus-4-6@default). It may not exist or you may not have access to it. Run --model to pick a different model.

Update 4/28/26
Figured it out. Turns out, the Claude Code VSCode extension is now using the environment variables (in my case, they're in .bashrc file) to specify the LLM. Prior to this change, the VSCode extension had its own settings where you could specify the model used by the extension. If I change the model in my .bashrc file from Google Vertex AI naming convention (claude-opus-4-7@default) to Anthropic's naming convention (claude-opus-4-7[1m]), it works just fine.

sauravkumarfromfuture · 3 months ago
Had to roll back to 2.0.64 to avoid this problem. `` curl -fsSL https://claude.ai/install.sh | bash -s 2.0.64 ``

worked for me

baixiaoji · 3 months ago

same issue in 2.1.101

dextel2 · 3 months ago
Guys found the fix it's because 2 diffrent model of Opus is installed. You need to uninstall all the previous model and then install all the model at once. i have attached the complete instruction (.md File) Claude_Code_Fix_Guide.md

This actually works! thanks man

allen7u · 3 months ago

May apply to some of you: Make sure your ANTHROPIC_BASE_URL does not include the /v1 suffix.

Claude Code (at least as of v2.1.109) appends /v1/messages to your ANTHROPIC_BASE_URL before sending requests to the model server. So if your Base URL already ends with /v1, it will be concatenated into /v1/v1/messages, which triggers the error mentioned above.

I confirmed this by launching Claude Code with the --debug flag, then searching for lines marked [ERROR] in the most recently generated log file under C:\Users\MY_USER_NAME\.claude\debug:

2026-04-15T09:33:01.204Z [ERROR] API error (attempt 1/11): 404 404 {"error":{"message":"Invalid URL (POST /v1/v1/messages)","type":"invalid_request_error","param":"","code":""}}

You can try doing the same — regardless of what your actual issue turns out to be.

See also:
https://help.apiyi.com/en/claude-code-third-party-api-base-url-setup-guide-en.html

chenkai1997 · 2 months ago
May apply to some of you: Make sure your ANTHROPIC_BASE_URL does not include the /v1 suffix. Claude Code (at least as of v2.1.109) appends /v1/messages to your ANTHROPIC_BASE_URL before sending requests to the model server. So if your Base URL already ends with /v1, it will be concatenated into /v1/v1/messages, which triggers the error mentioned above. I confirmed this by launching Claude Code with the --debug flag, then searching for lines marked [ERROR] in the most recently generated log file under C:\Users\MY_USER_NAME\.claude\debug: `` 2026-04-15T09:33:01.204Z [ERROR] API error (attempt 1/11): 404 404 {"error":{"message":"Invalid URL (POST /v1/v1/messages)","type":"invalid_request_error","param":"","code":""}} `` You can try doing the same — regardless of what your actual issue turns out to be. See also: https://help.apiyi.com/en/claude-code-third-party-api-base-url-setup-guide-en.html

it works for me. v2.1.114

dumengru · 2 months ago

记录一下解决方案,逻辑,将Claude原生模型名称直接映射到自己的模型名称:
第一步,创建CUSTOM_ROUTER_PATH脚本

/**
 * 自定义模型路由 - Claude 模型与 Qwen 模型一对一映射
 *
 * 修改上方的 modelMapping 对象即可调整映射关系
 */
module.exports = async function router(req, config) {
  // ================= 模型映射配置 =================
  const modelMapping = {
    // Claude 模型关键字 -> 实际使用的模型
    "sonnet-4": "dashscope,qwen3.5-plus",      // claude-sonnet-4-6
    "opus-4": "dashscope,qwen3.6-plus",        // claude-opus-4-7
    "haiku": "dashscope,qwen3.5-plus",         // claude-haiku-*
    "sonnet-3": "dashscope,qwen3.5-plus",      // claude-3-sonnet, claude-3.5-sonnet
    "opus-3": "dashscope,qwen3.6-plus",        // claude-3-opus
  };
  // ==============================================

  const requestedModel = req.body.model;

  if (!requestedModel) {
    return null;
  }

  // 按顺序匹配模型关键字
  for (const [keyword, targetModel] of Object.entries(modelMapping)) {
    if (requestedModel.includes(keyword)) {
      return targetModel;
    }
  }

  // 如果是 claude 模型但未匹配到具体映射,默认使用 qwen3.5-plus
  if (requestedModel.includes("claude")) {
    return "dashscope,qwen3.5-plus";
  }

  // 其他模型使用默认路由
  return null;
};

第二步,将CUSTOM_ROUTER_PATH脚本添加到配置中

{
  "LOG": true,
  "LOG_LEVEL": "debug",
  "HOST": "127.0.0.1",
  "PORT": 3456,
  "API_TIMEOUT_MS": 600000,
  "NON_INTERACTIVE_MODE": false,
  "CUSTOM_ROUTER_PATH": "~/.claude-code-router/custom-router.js",
  "providers": [
    {
      "name": "dashscope",
      "api_base_url": "https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions",
      "api_key": "sk-ac4c65d79d7844ddb60773bfeef828cd",
      "models": ["qwen3.5-plus", "qwen3.6-plus"],
      "transformer": {
        "use": ["maxtoken", "enhancetool"]
      }
    }
  ],
  "Router": {
    "default": "dashscope,qwen3.5-plus",
    "background": "dashscope,qwen3.6-plus",
    "think": "dashscope,qwen3.5-plus",
    "longContext": "dashscope,qwen3.5-plus",
    "longContextThreshold": 60000,
    "webSearch": "dashscope,qwen3.5-plus",
    "image": "dashscope,qwen3.5-plus"
  }
}

注意事项:配置文件中的Router不能少(我尝试删除,模型无法正常工作)

FelixIsaac · 2 months ago

If you’re using a gateway/proxy (eg Ollama Anthropic-compatible API) and hitting "There's an issue with the selected model…": check debug logs for has Authorization header: false.

On my setup (Claude Code v2.1.117 -> Ollama http://localhost:11434), missing Authorization header caused backend 404 model ... not found and CC surfaced the generic model error.

Workaround (forces header):

claude --settings '{"env":{"ANTHROPIC_BASE_URL":"http://localhost:11434","ANTHROPIC_CUSTOM_HEADERS":"Authorization: Bearer ollama"}}' --model gemma4:latest

Related locked issue: #39013.

longlz112 · 2 months ago
May apply to some of you: Make sure your ANTHROPIC_BASE_URL does not include the /v1 suffix.可能适用于一些你们:确保你们的 ANTHROPIC_BASE_URL 不包含 /v1 后缀。 Claude Code (at least as of v2.1.109) appends /v1/messages to your ANTHROPIC_BASE_URL before sending requests to the model server. So if your Base URL already ends with /v1, it will be concatenated into /v1/v1/messages, which triggers the error mentioned above.Claude Code(至少在 v2.1.109 版本中)在向模型服务器发送请求之前,会将 /v1/messages 附加到你们的 ANTHROPIC_BASE_URL 上。所以如果你们的 Base URL 已经以 /v1 结尾,它将被连接到 /v1/v1/messages 中,从而触发上述错误。 I confirmed this by launching Claude Code with the --debug flag, then searching for lines marked [ERROR] in the most recently generated log file under C:\Users\MY_USER_NAME\.claude\debug:我通过使用 --debug 标志启动 Claude Code 并在 C:\Users\MY_USER_NAME\.claude\debug 下最近生成的日志文件中搜索标记为 [ERROR] 的行来确认这一点: `` 2026-04-15T09:33:01.204Z [ERROR] API error (attempt 1/11): 404 404 {"error":{"message":"Invalid URL (POST /v1/v1/messages)","type":"invalid_request_error","param":"","code":""}} `` You can try doing the same — regardless of what your actual issue turns out to be.您可以尝试做同样的事情——无论您的实际问题是什么。 See also:  另见: https://help.apiyi.com/en/claude-code-third-party-api-base-url-setup-guide-en.html

it works, thanks

Rishabds7 · 2 months ago

Me too

M2LabOrg · 2 months ago

Same here.

RGoooGR · 2 months ago

🛠️ Fix: "● There's an issue with the selected model (anthropic/claude-3.5-sonnet). It may not exist or you may not have access to it. Run /model to pick a different model." error in Claude Code (Official API)

If you are getting the error below while using your official Anthropic Pro account (and NOT using Ollama), it is likely caused by stale environment variables in Windows.

🔴 The Error

● There's an issue with the selected model (anthropic/claude-3.5-sonnet). It may not exist or you may not have access to it. Run /model to pick a different model.

---

✅ The Solution (Step-by-Step)

  1. Logout of Claude Code: Run claude /logout in your terminal.
  2. Clear Environment Variables: Run the PowerShell script below to remove conflicting ANTHROPIC_ variables.
  3. Restart Terminal: Close your current terminal and open a new one.
  4. Login Again: Run claude /login and authorize via the browser.

💻 Cleanup Script (PowerShell)

Copy and paste this into your PowerShell terminal:

# Clear incorrect Anthropic environment variables
[System.Environment]::SetEnvironmentVariable("ANTHROPIC_MODEL", $null, "User")
[System.Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", $null, "User")
[System.Environment]::SetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", $null, "User")

# Clear session variables
$env:ANTHROPIC_MODEL = $null
$env:ANTHROPIC_BASE_URL = $null
$env:ANTHROPIC_AUTH_TOKEN = $null

Write-Host "Cleanup complete! Please restart your terminal." -ForegroundColor Green
ccjameslai · 2 months ago

For me, I check the settings.json in terminal.integrated.env.windows in vs code. Then, I fix the old ANTHROPIC_API_KEY, and it's solved.

paciox · 2 months ago

Late to the party, but for me it was that the session was somehow "corrupted".
I had to launch a /new session and it worked back to normal.
The corruption had to do with some image i pasted that caused problems.

little-bunnies · 2 months ago

"Claude-opus-4.6 " change to "Claude-opus-4-6 " ,try it!

Zedash · 2 months ago
## 🛠️ Fix: "● There's an issue with the selected model (anthropic/claude-3.5-sonnet). It may not exist or you may not have access to it. Run /model to pick a different model." error in Claude Code (Official API) If you are getting the error below while using your official Anthropic Pro account (and NOT using Ollama), it is likely caused by stale environment variables in Windows. ### 🔴 The Error ● There's an issue with the selected model (anthropic/claude-3.5-sonnet). It may not exist or you may not have access to it. Run /model to pick a different model. ### ✅ The Solution (Step-by-Step) 1. Logout of Claude Code: Run claude /logout in your terminal. 2. Clear Environment Variables: Run the PowerShell script below to remove conflicting ANTHROPIC_ variables. 3. Restart Terminal: Close your current terminal and open a new one. 4. Login Again: Run claude /login and authorize via the browser. ### 💻 Cleanup Script (PowerShell) Copy and paste this into your PowerShell terminal: # Clear incorrect Anthropic environment variables [System.Environment]::SetEnvironmentVariable("ANTHROPIC_MODEL", $null, "User") [System.Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", $null, "User") [System.Environment]::SetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", $null, "User") # Clear session variables $env:ANTHROPIC_MODEL = $null $env:ANTHROPIC_BASE_URL = $null $env:ANTHROPIC_AUTH_TOKEN = $null Write-Host "Cleanup complete! Please restart your terminal." -ForegroundColor Green

Thx! Worked on windows 11 Powershell install 💯

jesustorres-code · 2 months ago

If you want to clear or reset those environment variables in Windows 10 using Command Prompt after logging into your account, run these one by one:

setx ANTHROPIC_BASE_URL ""
setx ANTHROPIC_AUTH_TOKEN ""
setx ANTHROPIC_API_KEY ""

Then:

  1. Close the CMD window.
  2. Reopen CMD (or restart apps using those variables).
  3. Verify they were cleared:
echo %ANTHROPIC_BASE_URL%
echo %ANTHROPIC_AUTH_TOKEN%
echo %ANTHROPIC_API_KEY%

If you want to completely remove the variables instead of setting them to empty strings, use:

reg delete HKCU\Environment /F /V ANTHROPIC_BASE_URL
reg delete HKCU\Environment /F /V ANTHROPIC_AUTH_TOKEN
reg delete HKCU\Environment /F /V ANTHROPIC_API_KEY
Vadimyoureditor · 1 month ago

Tryed everything in this thread noting worked same issue:
There's an issue with the selected model (claude-sonnet-4-6). It may not exist or you may not have access to it. Run
/model to pick a different model.

Windows 10

RakeshM7 · 1 month ago

run : claude /doctor

If it returns the following duplicate installations message:

npm-global at /opt/homebrew/bin/claude
native at /Users/<username>/.local/bin/claude

remove the native installation:
rm /Users/<username>/.local/bin/claude

logout and login again

manugerahgunawan · 19 days ago

I got this issue today in Claude desktop, turns out (in my case) the double opus is spot on. I didn't need a reinstall, though. Just go to Claude settings json e.g. ...\.claude\settings.json, then remove any custom double configuration, then restart Claude. Make sure you killed the background process before it relaunches.

akihirogh · 11 days ago

Had the same issue on Ubuntu 24.04.
The cause was env variable ANTHROPIC_BASE_URL pointing to localhost with Ollama.

unset ANTHROPIC_BASE_URL and removing this env variable from ~/.bashrcsource ~/.bashrc resolved the issue.