Skip to content

[Bug] "Model not found" for virtually any Anthropic model #6918

Open

Description

@GutHib

📦 Deployment Method

Docker

📌 Version

2.16.1

💻 Operating System

Other Linux

📌 System Version

Almalinux 9.8

🌐 Browser

Other

📌 Browser Version

Tried various browsers (Edge, Opera, Vivaldi)

🐛 Bug Description

Hi,

I'm currently trying to integrate Claude/Anthropic into Nextchat (setup via Docker on Almalinux). I thought it's a trivial exercise of just entering some configuration data, but after two days, I'm about to give up.

After overcoming several obstacles, I'm stuck at a "model not found" error with models that clearly exist.

{
"error": {
"message": "The model claude-sonnet-5-5 does not exist or you do not have access to it.",
"type": "invalid_request_error",
"param": null,
"code": "model_not_found"
}
}

Troubleshooting with the Anthropic chatbot:

 curl https://api.anthropic.com/v1/messages \
 -H "x-api-key: YOUR_KEY" \
 -H "anthropic-version: 2023-06-01" \
 -H "content-type: application/json" \
 -d '{"model":"claude-sonnet-5-5","max_tokens":10,"messages":[{"role":"user","content":"Hi"}]}' 
 If that works but Nextchat doesn't, the problem is in Nextchat's configuration or how it constructs requests. (https://code.claude.com/docs/en/errors)

The result:

{"model":"claude-sonnet-5-5","id":"msg_011Cg6kV95af4UdPzjpqhjXp","type":"message","role":"assistant","content":[{"type":"text","text":"Hi there! How can I help you"}],"container":null,"stop_reason":"max_tokens","stop_sequence":null,"stop_details":null,"usage":{"input_tokens":11,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":10,"output_tokens_details":{"thinking_tokens":0},"service_tier":"standard","inference_geo":"global","speed":"standard"},"diagnostics":null}

So since the model ID works perfectly with the Anthropic API directly, it seems like the issue is on Nextchat's side: how it's formatting requests, which headers it's sending, or possibly an outdated API version string.

📷 Recurrence Steps

Launch Docker (in this case, via Wireguard):

docker run -d
--name nextchat
--restart unless-stopped
-p 10.8.0.1:3000:3000
-e ANTHROPIC_API_KEY="<VALID_KEY>"
-e CUSTOM_MODELS="-all,+claude-sonnet-5-5"
yidadaa/chatgpt-next-web:latest

Configure Custom API via Nexchat Client configuration

  • Anthropic
  • https://api.anthropic.com/v1/messages [or leave blank or just https://api.anthropic.com - doesn't matter]
  • Insert key
  • Model name: -all,+claude-sonnet-5-5 [also tried tons of different ones here, this one was tested and confirmed via CURL]

Try to chat. See error.

🚦 Expected Behavior

Since the model is valid, Claude should respond.

📝 Additional Information

Went for this several times, for hours and hours, with and without the help of AI, but couldn't find the needle in the haystack (and I don't think it exists). Filing this as a bug now.

Activity

  1. 2EU55 commented on Oct 28, 2026

    @2EU55

    The successful direct Anthropic request is useful: the next thing to check is which provider NextChat assigns to the newly added model.

    Please try an explicit provider in the model declaration:

    CUSTOM_MODELS=-all,+claude-sonnet-5-5@Anthropic
    

    After recreating the container with that environment value, open a new chat and explicitly select the Anthropic entry. If there is also a browser-side custom-model declaration, make it consistent with the server setting.

    This provider syntax is present in the v2.16.1 custom-model parser: when a model is not in the catalog, it uses the explicit provider name, or otherwise the custom model name, to construct the provider. The API selection code chooses the Anthropic client for the Anthropic provider and otherwise defaults to the OpenAI client.

    For the Anthropic custom endpoint, use https://api.anthropic.com, rather than the full Messages URL; the Anthropic client appends its request path.

    To distinguish the cases, check the browser Network panel for the failing chat request: is it using an Anthropic Messages route or an OpenAI Chat Completions route, and is the Messages path appended twice? Only the path/status are needed; please do not share request headers, keys, or conversation payloads.

    This is a routing/configuration check, not a confirmed reproduction of your Docker image. The model ID is taken from your successful request; I have not made a paid API call. This response was prepared with AI assistance and checked against the linked public source.

  2. GutHib commented on Oct 28, 2026

    @GutHib
    Author

    It took me a day to figure out the @Anthropic naming, not even Gemini was able to suggest it (only mention of it I ever saw was in this issue from last year: #6402). Didn't help much, though, as none of the current Anthropic models work with Nextchat anymore, because of unsupported top_k, top_p and temperature parameters that you can't turn off. In the end, you need some sort of proxy to filter them out.

  3. 2EU55 commented on Oct 29, 2026

    @2EU55

    Thanks for identifying the second blocker. My earlier provider setting addresses routing only; it does not resolve sampling-parameter compatibility.

    For the reported v2.16.1, the Anthropic request builder includes temperature, top_p, and a hard-coded top_k: 5. Changing their UI values does not remove those fields.

    If you maintain your own image, a narrowly scoped local workaround for the exact model ID in the report is to insert this immediately after the requestBody declaration:

    if (modelConfig.model === "claude-sonnet-5-5") {
      delete requestBody.temperature;
      delete requestBody.top_p;
      delete requestBody.top_k;
    }

    The same version's request type declares these fields optional. Test the change in a separate build before replacing your running instance; the Dockerfile compiles and copies application assets, so an environment variable alone cannot apply this source change.

    PR #6891 is still unmerged at this check. It only omits top_p for Claude 4 model names, retaining temperature and top_k; it does not match the model ID in this report. It should not be presented as a complete fix for this case, and I cannot recommend an upgrade as a verified solution.

    This is a source-based way to omit the rejected fields, not an end-to-end model compatibility guarantee. I have not reproduced your Docker deployment or made a paid API call. The exact model ID is taken from the issue, not independently verified against a provider. Prepared with AI assistance and checked against the linked source.

  4. GutHib commented on Oct 29, 2026

    @GutHib
    Author

    Thank you for the detailed reply. I'm afraid mine was too ambiguous - by "some sort of proxy" I didn't refer so an unsolved problem, what I meant to say that there are several solutions that can do the trick, I have a small script now that works for me.

    Since things finally work, I'd rather not break it again by trying a new approach, still got to clean dozens of dead ends from my desktop and document what did the trick. But for mere users like me, please be more specific about the file that your workaround should be applied to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions