TroubleshootingBeginner

How to Fix 'Model Not Found' and Deprecated Model Errors

Resolve model_not_found errors caused by typos, retired models, or access your account lacks.

6 minBeginner

A model_not_found error means the model id you sent is not one the API will serve to your account right now. The three common causes are a typo in the id, a model that was retired or renamed, and a model your account does not yet have access to. Each has a quick check.

  • Your API key
  • curl or your SDK
  • The provider's current model list page

Step 1: List the models your key can use

Do not trust a model id from an old blog post. Ask the API which models your key can actually call, then copy an exact id from that list.

zsh - models
$curl https://api.openai.com/v1/models -H "Authorization: Bearer $OPENAI_API_KEY"
{ "data": [ { "id": "gpt-4o" }, { "id": "gpt-4o-mini" }, { "id": "o3-mini" } ] }
$

Step 2: Check for typos and version drift

Model ids are exact strings. A missing suffix or a dated snapshot that no longer exists will fail. Compare your id character by character against the list from step 1.

Editor - config
Explorer
config.js
.env
config.js
1const MODEL = "gpt-4o"; // correct
2// const MODEL = "gpt4o"; // typo, 404
3// const MODEL = "gpt-4-0314"; // retired snapshot, 404
A single missing hyphen turns a valid id into a model_not_found.

Step 3: Handle deprecated models

Providers retire old models on a schedule. If your id worked last year but fails now, it was likely deprecated. Read the deprecation notice for the recommended replacement and swap the id.

Map old ids to new ones
Keep model ids in one config constant, not scattered across the codebase. When a model retires you change one line instead of hunting through files.

Step 4: Request access if needed

Some new or specialized models require you to be on a paid tier or to request access. If the id is correct and current but still not found, check whether your account tier includes it.

Result

After listing available models and copying the exact id into a single config constant, the call succeeds. A developer whose app broke overnight discovered their pinned dated snapshot had been retired, and switching to the current alias fixed every call at once.

Watch related tutorials

Tags
#models#404#deprecation#openai