Skip to content

Gemini API 404 NOT_FOUND: Model Path & Version Fixes ​

An HTTP 404 NOT_FOUND from the Gemini API almost always says models/<name> is not found for API version v1beta, or is not supported for generateContent. It happens when the model ID is misspelled or retired, the models/ prefix is duplicated or missing, or an OpenAI-compatible path is mixed with native Gemini endpoints.

Quick answer

Check three things:

  1. Path format: Native Gemini uses .../v1beta/models/<model>:generateContent; OpenAI-compatible clients use .../v1/chat/completions with "model": "<model>" (no models/ prefix).
  2. Method support: Calling :generateContent on an embedding-only or image-only model returns 404.
  3. Model lifecycle: Retired snapshots (e.g. legacy gemini-1.5-* or removed preview tags) return 404; switch to a current model ID such as gemini-4-argon or gemini-3.8-flash.

Typical Error Response ​

json
{
  "error": {
    "code": 404,
    "message": "models/gemini-1.5-pro is not found for API version v1beta, or is not supported for generateContent. Call ListModels to see the list of available models and their supported methods.",
    "status": "NOT_FOUND"
  }
}

Common Causes and Fixes ​

1. Duplicated or Missing models/ Prefix ​

Different SDKs expect different forms of the model string:

InterfaceCorrect model valueCommon mistake causing 404
Native REST URL/v1beta/models/gemini-4-argon:generateContent/v1beta/models/models/gemini-4-argon:generateContent
Google Gen AI SDK (google-genai)model="gemini-4-argon"Passing a retired preview slug or full URL
OpenAI-compatible (/v1/chat/completions)"model": "gemini-4-argon""model": "models/gemini-4-argon"

2. Mixing Native Gemini Endpoints with OpenAI-Compatible Base URLs ​

If you use the OpenAI SDK (openai in Python/Node) against Gemini, base_url must point to the OpenAI-compatible endpoint, not the native v1beta root:

python
from openai import OpenAI

client = OpenAI(
    api_key="sk-YOUR_KEY",
    base_url="https://byesu.com/v1",  # OpenAI-compatible endpoint
)

resp = client.chat.completions.create(
    model="gemini-4-argon",
    messages=[{"role": "user", "content": "Hello"}],
)

For Google's official OpenAI compatibility layer directly, the base URL is https://generativelanguage.googleapis.com/v1beta/openai/. Dropping /openai/ makes the SDK request /v1beta/chat/completions, which returns 404.

3. Retired Models or Wrong API Version (v1 vs v1beta) ​

  • Preview models are frequently exposed only on v1beta and return 404 on v1.
  • Deprecated models are removed after their shutdown date. List live models directly before pinning an ID:
bash
# Official Gemini ListModels
curl "https://generativelanguage.googleapis.com/v1beta/models?key=$GEMINI_API_KEY"

# Or via OpenAI-compatible gateway
curl https://byesu.com/v1/models -H "Authorization: Bearer $BYESU_API_KEY"

4. Calling :generateContent on an Embedding Model ​

Embedding models support :embedContent / /v1/embeddings, not :generateContent. Sending a chat request with an embedding model ID triggers the same NOT_FOUND message.

Checking Active Models on a Gateway ​

On byesu, see the live Model APIs catalog (including Gemini 4 Argon and Gemini 3.8 Flash) or query GET https://byesu.com/v1/models with your token. If you get 400 INVALID_ARGUMENT instead of 404, see Gemini 400 INVALID_ARGUMENT.

Got a problem? Contact support or join our group.