Unable to add Google API Key

Get the following error

{
  "error": {
    "code": 404,
    "message": "models/gemini-1.0-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"
  }
}

The code tries to call

curl https://generativelanguage.googleapis.com/v1beta/models/gemini-1.0-pro:generateContent -H "Content-Type: application/json" --header "X-Goog-Api-Key: XXXXXXXXXXXXXX" --header "anthropic-version: 2023-06-01" -d '{
  "generationConfig": {},
  "safetySettings": [],
  "contents": [
    {
      "role": "user",
      "parts": [
        {
          "text": "Testing. Just say hi and nothing else."
        }
      ]
    }
  ]
}'

As per gemini API 18th Feb update, gemini 1.0 pro is no longer available.

8 Likes

same issue

1 Like
  1. Press ctrl+shift+p
  2. select Reload the window
    now it will work perfectly
1 Like

Reloading did not fix the issue for me.

2 Likes

Same issue.
I also had my Google API key set up before but somehow it disappeared…

Nope, same error. Also, the curl command includes a copy/pasted pointless header "anthropic-version: 2023-06-01".

I’ve been facing this exact same issue.

1 Like

I’m facing same issue.

1 Like

Same issue here. What worked for me was toggling off the google API key and for some reason I was able to use the google models in the chat.

I’m facing same issue here.

Try all options exposed here in thread without success.

Error:

{
  "error": {
    "code": 404,
    "message": "models/gemini-1.0-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"
  }
}

if I use the curl suggested by google to test, this works fine:

curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent?key=GEMINI_API_KEY" \
-H 'Content-Type: application/json' \
-X POST \
-d '{
  "contents": [{
    "parts":[{"text": "Explain how AI works"}]
    }]
   }'

Please help!

Having the exact same issue. It seems cursors tries to validate a model which no longer exists.

For anyone coming accross. The API key will still work. You can add your own gemini model now like.

gemini-2.5-pro-exp-03-25
and it will work.

It’s just the validation script in cursor is outdated.

This issue occurs in Cursor 0.45.17.
It does not occur in Cursor 0.47.8.

The reason is that it tries to verify the api key via models/gemini-1.0-pro, which is no longer supported by google.

{
  "error": {
    "code": 404,
    "message": "models/gemini-1.0-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"
  }
}

Updating to the latest version does not cause this problem.

Unfortunately, in my CodeBase, 0.47 does something stupid
that prevents even simple Markdown modifications (whether Sonnet 3.7, gemini, or o1).

I can’t update it…

The only current workaround in 0.45.17 is to not use the custom google API KEY.

It occurs in 0.47.8 for me :man_shrugging:

1 Like

Same here.

Version: 0.47.8
VSCode Version: 1.96.2
OS: Darwin arm64 24.3.0

{
“error”: {
“code”: 404,
“message”: “models/gemini-1.0-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”
}
}

How exactly do you do this? We can check the already present models (including the Gemini ones) but that is subject to the 50 requests quota I think. how do you add new model with your own API key?

Just in cursor settings > models > add model.

You also add Ur API key here

Just checked this. I don’t get the option to add API key when I add the model but when I use Gemini models it doesn’t increase my request count so I guess it does use the API key I added even if it is unable to validate it. Anyways thanks for this.

How did you add the API key if you don’t have the option :sob::joy:

I thought you meant that we get the option to add the API key seperately everytime we add a new model (specific to that model). But I didn’t see anything there except the option to add the model name. I realised that it is using the same API key that we add in the Cursor Settings > Models (then one which has like 3 options - OpenAI, Anthropic, Google) even if it wasn’t able to validate it.

Cursor is clearly ignoring this issue as it is easy to fix. The reason why we get the error message that says gemini 1.0 pro doesn’t exist is because it no longer is usable with the google api key. I believe cursor is planning on phasing out their allowing you to use their key. Which is extremely annoying, enshitification continues. I DO NOT want to have to pay extra to use “max” when I can simply use the key?

3 Likes