404 code on all API calls

Calling the Gemini API from my server is now resulting in 404’s, regardless of which API i am calling. This degradation happened a few days (sorry i can’t pinpoint the exact date).

When i make the identical curl request from my laptop, I get a 200 response.
My server is located in us-east-i (Hetzner).

Request:

curl --request GET \
  --url 'https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash-preview-image-generation?key=XXXX' \
  --header 'content-type: application/json'

Response:

{
  "error": {
    "code": 404,
    "message": "Model is not found: models/gemini-2.0-flash-preview-image-generation for api version v1beta",
    "status": "NOT_FOUND"
  }
}

My ipinfo:

{
  "ip": "178.156.132.34",                                                                                                                               "hostname": "static.34.132.156.178.clients.your-server.de",
  "city": "Ashburn",
  "region": "Virginia",
  "country": "US",
  "loc": "39.0437,-77.4875",
  "org": "AS213230 Hetzner Online GmbH",
  "postal": "20147",
  "timezone": "America/New_York",
  "readme": "https://ipinfo.io/missingauth"
}

That’s a weird issue, especially since the same request works from your laptop. It might be worth checking if the model you’re calling is still supported under v1beta, or if there’s been a version change. Sometimes region-based restrictions or cloud provider IPs (like Hetzner) can cause unexpected behavior. You could try the call from another server or VPN to compare, and maybe test with a different API version if available. Also, a quick look at Google’s API status or changelog might shed some light

I really don’t get it.

This is my request, same API key used everywhere.

curl --request GET \
  --url 'https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash-preview-image-generation?key=XXX' \
  --header 'content-type: application/json'
  1. Works locally (200 response)
  2. Hetzner returns a 404
  3. Cloudflare worker returns a 404
{
  "error": {
    "code": 404,
    "message": "Model is not found: models/gemini-2.0-flash-preview-image-generation for api version v1beta",
    "status": "NOT_FOUND"
  }
}

I tried to generate a new API key and I still get the same outcome.

It works when I proxy through Vercel. What a mess…