cursor icon indicating copy to clipboard operation
cursor copied to clipboard

Unable to add Google API Key

Open khflower opened this issue 9 months ago • 44 comments

{ "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" } }

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

khflower avatar Mar 03 '25 05:03 khflower

1.0 pro is not an official listed model please visit

https://ai.google.dev/gemini-api/docs/models/gemini

For more info

ShivaBhattacharjee avatar Mar 03 '25 08:03 ShivaBhattacharjee

I'm running into the same problem on Cursor, and it won't let me pick a model to check my API key against

Laplace-bit avatar Mar 07 '25 07:03 Laplace-bit

I'm having the same issue. I check the same API call but with the gemini-2.0-flash and it worked.

Neirpyck avatar Mar 07 '25 08:03 Neirpyck

Same, I think this is a bug in cursor chosing the wrong model by default

bc-csewell avatar Mar 07 '25 13:03 bc-csewell

same

ryhara avatar Mar 11 '25 04:03 ryhara

same!

itosho avatar Mar 12 '25 01:03 itosho

same

iairu avatar Mar 15 '25 12:03 iairu

same

chyang-ken avatar Mar 16 '25 07:03 chyang-ken

its a bug in latest version.

kyoku321 avatar Mar 16 '25 13:03 kyoku321

Has anyone managed to adjust this by messing with curl directly and changing the call to "2.0-flash"?

xMath7 avatar Mar 16 '25 14:03 xMath7

1.0 pro is not an official listed model please visit

https://ai.google.dev/gemini-api/docs/models/gemini

For more info

Certainly not supported, validation has a built-in model and there is no way to specify it yourself. Error in default model during API validation.

sv222 avatar Mar 17 '25 21:03 sv222

+1, I have the same issue. To be sure, this is not a problem with users picking an invalid model in Cursor's settings. Cursor seems to have hard-coded verifying a Gemini API key with a call to a specific URL requesting the gemini-1.0-pro model which no longer exists.

agupta7 avatar Mar 25 '25 16:03 agupta7

Same here! Seems Cursor "pushes" to use their subscription!🤬

AirVetra avatar Mar 25 '25 18:03 AirVetra

Cursor has provided a curl snippet that forces to check against gemini-1.0-pro:generateContent, but if I change to gemini-1.5-pro, with same API Key, it works as expected. Any solutions?

diaraujo13 avatar Mar 25 '25 19:03 diaraujo13

Cursor has provided a curl snippet that forces to check against gemini-1.0-pro:generateContent, but if I change to gemini-1.5-pro, with same API Key, it works as expected. Any solutions?

How would it be possible to switch to Gemini 1.5 or 2.0 through installation?

CadeAGrana avatar Mar 25 '25 21:03 CadeAGrana

Cursor has provided a curl snippet that forces to check against gemini-1.0-pro:generateContent, but if I change to gemini-1.5-pro, with same API Key, it works as expected. Any solutions?

How would it be possible to switch to Gemini 1.5 or 2.0 through installation?

That`s how I got it working: I just pasted the API Key in input, enabled Google API Key, added the models I wanted (gemini-1.5-pro, gemini-2.5-pro-exp-03-25, gemini-2.0-pro-exp), switched to AI Pane and changed from Agent Mode to Ask (since Custom API Keys are not fully implemented w/ Agent Mode). It looks like that only the Verify button is buggy and not affect the model usage inside Cursor

diaraujo13 avatar Mar 25 '25 23:03 diaraujo13

O Cursor forneceu um snippet curl que força a verificação em gemini-1.0-pro:generateContent, mas se eu mudar para gemini-1.5-pro, com a mesma chave de API, funciona como esperado. Alguma solução?

Como seria possível mudar para o Gemini 1.5 ou 2.0 por meio da instalação?

Foi assim que eu consegui fazer funcionar: eu apenas colei a chave da API na entrada, habilitei a chave da API do Google, adicionei os modelos que eu queria (gemini-1.5-pro, gemini-2.5-pro-exp-03-25, gemini-2.0-pro-exp), mudei para o Painel de IA e mudei do Modo Agente para Perguntar (já que as Chaves de API Personalizadas não são totalmente implementadas com o Modo Agente). Parece que apenas o botão Verificar está com bugs e não afeta o uso do modelo dentro do Cursor

Acabei de ver que tu é BR eheheh Vou tentar aqui, amigo! Obrigado.

CadeAGrana avatar Mar 25 '25 23:03 CadeAGrana

Cursor has provided a curl snippet that forces to check against gemini-1.0-pro:generateContent, but if I change to gemini-1.5-pro, with same API Key, it works as expected. Any solutions?

How would it be possible to switch to Gemini 1.5 or 2.0 through installation?

That`s how I got it working: I just pasted the API Key in input, enabled Google API Key, added the models I wanted (gemini-1.5-pro, gemini-2.5-pro-exp-03-25, gemini-2.0-pro-exp), switched to AI Pane and changed from Agent Mode to Ask (since Custom API Keys are not fully implemented w/ Agent Mode). It looks like that only the Verify button is buggy and not affect the model usage inside Cursor

wanted to confirm that this worked for me as well (added API Key, ignored the warning / verify - and asked the Agent which model it is - after selecting it in the drop down)

ionut85 avatar Mar 27 '25 13:03 ionut85

adding the API key and ignoring the warning of verify doesn't work for me.

When trying to run anything in the chat window, I get this error message:

Unauthorized User API key
(Request ID: 05782...e6a53)

dentroai avatar Mar 27 '25 22:03 dentroai

adding the API key and ignoring the warning of verify doesn't work for me.

When trying to run anything in the chat window, I get this error message:

Unauthorized User API key
(Request ID: 05782...e6a53)

You should manually verify your API KEY trough a request. Take as example the same curl command provided by Cursor, but instead of gemini-1.0, try with gemini-1.5, and your API key. Run and see if returns the same message


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

diaraujo13 avatar Mar 27 '25 23:03 diaraujo13

adding the API key and ignoring the warning of verify doesn't work for me. When trying to run anything in the chat window, I get this error message:

Unauthorized User API key
(Request ID: 05782...e6a53)

You should manually verify your API KEY trough a request. Take as example the same curl command provided by Cursor, but instead of gemini-1.0, try with gemini-1.5, and your API key. Run and see if returns the same message


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

Doesn't help - got the following, but again error hile asking model throu Gemini API

{ "candidates": [ { "content": { "parts": [ { "text": "Hi\n" } ], "role": "model" }, "finishReason": "STOP", "avgLogprobs": -0.00066317361779510975 } ], "usageMetadata": { "promptTokenCount": 9, "candidatesTokenCount": 2, "totalTokenCount": 11, "promptTokensDetails": [ { "modality": "TEXT", "tokenCount": 9 } ], "candidatesTokensDetails": [ { "modality": "TEXT", "tokenCount": 2 } ] }, "modelVersion": "gemini-1.5-pro-002"

AirVetra avatar Mar 27 '25 23:03 AirVetra

Same here...

S1nPur1ty avatar Mar 28 '25 03:03 S1nPur1ty

same

Another5405 avatar Mar 29 '25 10:03 Another5405

Im so done with cursor

Sophanos avatar Mar 29 '25 20:03 Sophanos

Cursor is breaking down hard lately. Since 1 of march. Different errors every single day. "User is unauthorized", BYO keys not working. Models not working. It's just a mess. Can you please stablize this app.

eonist avatar Mar 30 '25 18:03 eonist

“Unauthorized User API key” despite working key. Version 0.48.5 :-(

matze10000 avatar Mar 31 '25 06:03 matze10000

Just skip this question and use it directly.

WangHaoyuuu avatar Mar 31 '25 12:03 WangHaoyuuu

Just skip this question and use it directly.这个问题就直接跳过,直接用就行。

Image I saw the API call in Gemini Studio, so don’t need to click verify, just use it directly

WangHaoyuuu avatar Mar 31 '25 12:03 WangHaoyuuu

Just skip this question and use it directly.这个问题就直接跳过,直接用就行。

Image I saw the API call in Gemini Studio, so don’t need to click verify, just use it directly

that does not work either.

Image

genesiscz avatar Mar 31 '25 20:03 genesiscz

According to the reply on reddit from dev by Cursor, they have fixed the issue and are working with ‘Google’ staff to resolve it. Whatever :)

Sophanos avatar Mar 31 '25 23:03 Sophanos