model_not_found (404): The model does not exist, fixed

The short version
model_not_foundis a 404: the model does not exist or is not available to this request.- Typical causes are a typo, a retired model, project permissions, or an ID format from another service.
- Anthropic returns the same condition as a 404
not_found_error. - The reliable fix is to fetch valid IDs from the models endpoint and compare.
What the error looks like
A report on OpenAI's developer forum shows this body:
{
"error": {
"message": "The requested model 'gpt-4-1106-preview' does not exist.",
"type": "invalid_request_error",
"param": "model",
"code": "model_not_found"
}
}
Developers also report The model ... does not exist or you do not have access to it. Wording changes, so branch on code. OpenAI's docs advise checking the ID, the model, the project, and whether the resource was deleted.
Anthropic documents a 404 not_found_error with this shape:
{
"type": "error",
"error": {
"type": "not_found_error",
"message": "The requested resource could not be found."
},
"request_id": "req_011CSHoEeqs5C35K2UUqR7Fy"
}
Common causes
| Cause | Example | Fix |
|---|---|---|
| Typo | gpt-40 with a zero for the letter o | Copy the ID from the list |
| Retired model | An old dated ID | Move to the successor |
| Key cannot use it | The project does not allow the model | Check permissions |
| ID format mismatch | An ID copied from another service | Check the list for that endpoint |
| Wrong path | A doubled /v1 | Check base_url |
Get the right ID from the endpoint
Ask the API rather than guessing:
curl -s https://api.fastmetal.ai/v1/models \
-H "Authorization: Bearer $FASTMETAL_API_KEY" \
| python3 -c "import json,sys; print('\n'.join(sorted(m['id'] for m in json.load(sys.stdin)['data'])))"
Your code can also suggest close matches:
import difflib
import os
from openai import NotFoundError, OpenAI
client = OpenAI(
api_key=os.environ["FASTMETAL_API_KEY"],
base_url="https://api.fastmetal.ai/v1",
)
wanted = "deepseek-v4-1-flash"
try:
resp = client.chat.completions.create(
model=wanted,
messages=[{"role": "user", "content": "Hello"}],
max_tokens=64,
)
print(resp.choices[0].message.content)
except NotFoundError:
ids = [m.id for m in client.models.list().data]
print("Close matches:", difflib.get_close_matches(wanted, ids, n=5, cutoff=0.4))
FastMetal's ID rules
- Anthropic models carry a prefix (
anthropic-claude-sonnet-5). Others are plain (gpt-6.1-sol,kimi-k3). - IDs keep their dots (
deepseek-v4.1-flash). - Catalog URLs swap dots for hyphens (
/models/deepseek/deepseek-v4-1-flash), so a URL slug is not an ID.
Claude Code can make other problems look like model errors. With /v1 on ANTHROPIC_BASE_URL, it requests /v1/v1/messages, gets a 404, and reports a model access problem.
Claude Code's built-in Haiku IDs, such as claude-haiku-4-5-20251001, are rejected by FastMetal with a 400 (tested October 2026). Set ANTHROPIC_DEFAULT_HAIKU_MODEL to a catalog ID such as anthropic-claude-haiku-4-5. Steps are in the Claude Code guide.
Browse the model catalog for what is available and the pricing page for rates.
FAQ
A model that worked yesterday now returns 404. Why?
It may have been retired or renamed. Fetch the model list and see whether the ID is still there.
The model is in the list but I still get 404. What now?
Check that the endpoint you are calling supports that model, then check key or project permissions.
Will retrying fix model_not_found?
No. The ID or the permission has to change, so exclude this error from retries.
Can I reuse model IDs from another service?
Usually not, since each endpoint has its own format. On FastMetal, use the IDs returned by /v1/models.
Wrapping up
When you see model_not_found, compare against the endpoint's own list instead of guessing. On FastMetal, watch the prefix and the dots.
To see every model you can call, create a free account.