OpenAI 'model does not exist' Error (model_not_found): Causes & Fix

Quick Fix

Getting The model 'X' does not exist or you do not have access to it? Check, in order:

  • The exact model name — typos, wrong version date, or a renamed/retired model. List models to see what’s actually available.
  • Whether your account/project has access — some models need org verification or a paid account.
  • The right endpoint — calling a chat model on /completions, or an embeddings model on /chat/completions, throws this too.

OpenAI returns an HTTP 404 with code model_not_found when the model string in your request doesn’t resolve to something your account can call. The message is deliberately ambiguous — “does not exist or you do not have access” — because OpenAI won’t reveal whether a model exists to accounts that can’t use it. So the fix is a short checklist: confirm the name, your access, and the endpoint.

What this error means

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

It bundles several distinct situations under one message:

One error, several root causes.
Root causeTell-tale signFix
Wrong/typo'd name Slightly-off string (gpt-5-turbo)Use the exact id from the models list
Retired model Worked before, now 404sSwitch to the replacement model
No access Real model, new/unverified accountVerify org / add billing
Wrong endpoint Chat model on /completionsCall the matching endpoint

Common causes

  • Typo or wrong version. gpt-4o vs gpt-4-o, or a dated snapshot (-2024-08-06) that’s wrong. Model ids are exact strings.
  • Retired or renamed model. A model you used months ago was deprecated and shut down — see the deprecations tracker for what replaced it.
  • No access on your account. Newer or higher-end models can require a verified organization or a paid account; unverified accounts get the same 404.
  • Wrong endpoint for the model type. Embeddings models don’t work on /chat/completions; chat models don’t work on the legacy /completions. Mismatched pairs surface as model_not_found.
  • Wrong project/org key. A key scoped to a project without access to that model.
  • Fine-tuned model id is off. Fine-tunes have long ids (ft:gpt-4o-mini:org::id); a wrong suffix 404s.

How to fix it

List the models you can actually call

The fastest disambiguation: ask the API what your key has access to.

cURL — list available models
curl https://api.openai.com/v1/models \
-H "Authorization: Bearer $OPENAI_API_KEY" | python3 -c "import sys,json;[print(m['id']) for m in json.load(sys.stdin)['data']]"
Python — verify a model id exists for your key
from openai import OpenAI
client = OpenAI()

available = {m.id for m in client.models.list().data}
target = "gpt-4o"
if target not in available:
  raise SystemExit(f"{target!r} not available to this key. "
                   f"Did you mean one of: {sorted(a for a in available if 'gpt-4o' in a)}")
print("OK:", target)

If the model is real but you lack access

  • Verify your organization in the dashboard (Settings → Organization) — some models gate on verification.
  • Add billing / move off the free tier if the model requires a paid account.
  • Confirm the key’s project has the model enabled.

If the model was retired

Check the model deprecations tracker for the official replacement and update your model string. Pin to a dated snapshot you control so a future rename doesn’t silently break you — and handle the 404 gracefully with a fallback:

Python — fall back when a model id 404s
import openai
from openai import OpenAI
client = OpenAI()

PREFERRED = "gpt-5.5"
FALLBACK = "gpt-4o"

def create(messages, model=PREFERRED):
  try:
      return client.chat.completions.create(model=model, messages=messages)
  except openai.NotFoundError:
      # Model id invalid/retired/no-access — fall back and log to fix the config.
      return client.chat.completions.create(model=FALLBACK, messages=messages)

How to prevent it

  • Centralize model ids in config, not scattered string literals, so updates are one-line.
  • Validate the id against models.list() at startup and fail fast with a clear message.
  • Watch deprecations so a shutdown doesn’t surprise you — the deprecations tracker lists retirement dates and replacements.
  • Match the endpoint to the model type (chat vs embeddings vs responses).
Insulate yourself from model churn

Model ids change across providers as families are renamed and retired. OpenRouter gives you one OpenAI-compatible API across many models, so swapping a retired id for its successor is a one-string change. (Affiliate link.)

What to do next

  1. List your available models and copy the exact id.
  2. Check the deprecations tracker if a once-working model now 404s.
  3. Verify your org / billing if the model is real but inaccessible.
  4. Add a fallback so a bad id degrades gracefully instead of crashing.

Frequently asked questions

Why does OpenAI say a model doesn't exist when I know it does?
The message intentionally merges 'doesn't exist' and 'you don't have access' so it can't be used to probe which models exist. If the id is correct, the cause is usually access — verify your organization, add billing, or confirm the project has that model enabled.
How do I see which models my key can use?
Call GET /v1/models (client.models.list()). It returns exactly the model ids your key can access, which is the quickest way to catch a typo, a retired id, or a missing-access situation.
My model worked last month and now 404s — what happened?
It was almost certainly deprecated and shut down. Check the deprecations tracker for the official replacement and update your model string; pin to a dated snapshot so future renames don't break you silently.
Can the wrong endpoint cause model_not_found?
Yes. Calling a chat model on the legacy /completions endpoint, or an embeddings model on /chat/completions, surfaces as model_not_found. Match the endpoint to the model type.
Does a fine-tuned model throw this error?
It can if the fine-tune id is wrong. Fine-tuned ids look like ft:gpt-4o-mini:org::abc123 — a mistyped suffix or a deleted fine-tune returns model_not_found. List your models to confirm the exact id.