Model Not Found / 404 Error: Fix the Model Name in 4 Steps (2026)
When you get "model not found," the model name in your request usually doesn't match any model ID that this endpoint and this API key actually recognize. The most reliable fix is to call /v1/models, list the models available to your key, and copy the returned id exactly. Don't assemble a name by hand from what you see on a web page.
This guide works in order: first figure out the cause, then troubleshoot.
What do "model not found" and 404 actually mean?
These are the common error messages, and they all mean roughly the same thing:
model not foundThe model xxx does not exist404 model does not existThe model xxx does not exist or you do not have access to it
The server received your request and recognized your credentials, but it can't find that name among the models you can access. The exact error structure and wording vary by provider, so check each provider's official docs; this article doesn't go through them one by one.
Note that a 404 can come from two different places:
| Symptom | Likely cause |
|---|---|
| The error text explicitly mentions the model | Wrong model name, or the key has no access to it |
You get a blank page, HTML, or a bare Not Found with no mention of a model | Wrong path, most often a wrong Base URL |
If it's the second case, the model name isn't the problem. This is common in client tools; see Cline OpenAI Compatible returns 401 or 404: how to fill in the Base URL.
What's the difference between a display name and a model ID?
What you see on web pages, pricing pages, and launch announcements is usually a display name meant for humans: it may contain spaces, mixed case, or a word like "Preview." The API request needs the model ID, which is typically a string of lowercase letters, digits, and hyphens, sometimes with a date suffix.
The two are not interchangeable. The rule is simple: whatever the API returns in the id field is the source of truth.
A few more common pitfalls:
- Aliases vs. pinned versions. Some providers offer both an alias that points to the latest version and a dated, pinned version. Both are valid IDs, but not every account has access to both at every point in time.
- Case and stray characters. If you copied along a space, a quotation mark, or a full-width hyphen, the lookup will fail outright.
- Retired or renamed models. A name from an old tutorial may no longer work.
Why do providers name models differently?
Even among "OpenAI-compatible" APIs, providers don't agree on how models must be named. Here are the common cases; always confirm details in the relevant official docs:
- Direct from the vendor: use that vendor's own model ID.
- Aggregation gateways (such as OpenRouter): model IDs often use a "vendor/model" prefix, and leaving out the prefix means no match. On cdnping's Model watch page you can see how models are named and whether they're available on OpenRouter's public API.
- Cloud-hosted platforms: some require a "deployment name" or an "endpoint ID" rather than the model's own name, and entering the model name will actually cause an error.
- Self-hosted or third-party relays: the available models are up to the operator, so their list is the only one that counts.
Command-line tools like Claude Code and Codex have a similar problem: the default model name built into the tool may not be recognized by a third-party endpoint, so you need to set an ID that the endpoint supports explicitly in the configuration.
How do I troubleshoot model not found in 4 steps?
Step 1: Confirm the Base URL and path
Rule out path problems first. OpenAI-format endpoints usually end in /v1, while Anthropic-format endpoints use a different path, so check the relevant docs. Adding or dropping a /v1 segment in a tool's Base URL is a very frequent cause of 404.
Step 2: List the available models with /v1/models
OpenAI-format endpoints generally provide a model list. Example command (replace the address and key with your own):
curl -s https://your-endpoint/v1/models \
-H "Authorization: Bearer $API_KEY"
In the returned JSON, the id of each item in the data array is a model name you can use. For a quick scan, use jq:
curl -s https://your-endpoint/v1/models \
-H "Authorization: Bearer $API_KEY" | jq -r '.data[].id'
Anthropic's official API also has a model list endpoint, but its auth headers differ from OpenAI's (it uses x-api-key and a version header), so follow the official docs. Not every third-party service implements a list endpoint; if there isn't one, check the provider's docs or console.
Step 3: Compare character by character and reproduce minimally
Copy the id from the list exactly and verify it with the simplest possible request:
curl -s https://your-endpoint/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"paste the id here","messages":[{"role":"user","content":"hi"}]}'
If this works, the model name is fine and the problem is in your tool's configuration. If it doesn't, go to the next step.
Step 4: Check key permissions and account status
If the model you want isn't in the list, the usual causes are:
- Your current plan or key doesn't have that model enabled.
- The key belongs to a different project or organization.
- The model isn't available in the region your account is in. For what that means, see What the unsupported_country_region_territory error means; please follow the terms of service and local regulations.
- The authentication itself is broken. In that case look at a 401 first, not a 404; see Claude Code auth conflict and 401: how to fix it.
What if it isn't the model name?
Different status codes point to different layers, so don't treat everything as "wrong model name." A rough breakdown:
| Status code | Common meaning | What to check first |
|---|---|---|
| 401 | Authentication failed | Key, header format |
| 403 | No permission | Account, region, model access |
| 404 | Path or model doesn't exist | Base URL, model ID |
| 429 | Rate limit or quota | What to do about 429 Too Many Requests |
| 5xx | Server-side problem | Official status page, retry |
For the full mapping, see LLM API error codes cheat sheet: what 400 through 529 mean and which to retry. If you suspect a server-side outage rather than a misconfiguration on your end, check the probe results for each official API endpoint on cdnping's API status page.
How can beginners avoid these pitfalls?
Mismatched model names often happen because people have to keep switching names between tools and vendors. If you just want to get things running in a tool like Claude Code or Codex, consider the aggregation gateway approach: point the endpoint at the gateway's address, then choose a capability group from what the gateway supports.
AGI Plan is one such service (AGI Plan is a commercial partner of cdnping): a multi-provider LLM aggregation gateway sold as a monthly subscription, paid in RMB with no overseas credit card needed. Tools like Claude Code and Codex only need one endpoint address changed, and it is compatible with both the OpenAI and Anthropic API formats. To be clear, it is not an officially authorized channel, and some models are labeled "outside China only"; the available scope is whatever the AGI Plan models page says. For the setup process, see the beginner's guide.
Whichever service you use, the troubleshooting method is the same: confirm the ID with the list endpoint first, then change your configuration.
Summary and next steps
- First check whether the error mentions "model"; if it doesn't, check the Base URL first.
- Get the real model ID from
/v1/modelsand copy it exactly. - Verify with a minimal curl request, then go back and configure your tool.
- If the model isn't in the list, check key permissions, plan, and account status, and contact the provider if needed.
If the list endpoint itself returns an error, start from the error code cheat sheet and work down; it's far more effective than repeatedly changing the model name.