Google API Key Integration Issue

Cursor Bug Report: Google API Key Integration Issue

Issue Summary

Cannot use personal Google API key for Gemini-2.5-pro model.

Environment

  • Cursor v0.48.4
  • VSCode v1.96.2
  • macOS Darwin arm64 24.3.0
  • Date: 2025-03-29

Errors

  1. When using gemini-2.5-pro-exp-03-25:

    "Role must be either user or assistant, but got tool"
    Request ID: ede8f892-8d33-4ffa-ad1d-8095dece8468
    
  2. When verifying Google API Key in settings:

    {
      "error": {
        "code": 404,
        "message": "models/gemini-1.0-pro is not found for API version v1beta, or is not supported for generateContent.",
        "status": "NOT_FOUND"
      }
    }
    

Cursor is hardcoding an invalid Google model name in the key verification step. This model is not able to be changed.

  1. With provided curl test command:
    Incorrect headers (Anthropic headers included in Google API request)

Steps to Reproduce

  1. Added Google API key to Cursor settings
  2. Verified key is valid (confirmed with separate curl test)
  3. Attempted to use gemini-2.5-pro-exp-03-25
  4. Received error messages

User Verification

Key is valid and works with gemini-2.0-flash in independent testing.

Additional Feedback

  • Pricing model of $0.05 per request for “fast” requests is excessive
  • Request option to use personal Google Cloud paid account keys
  • Would pay $40-50 monthly for unlimited “pro”/“fast” requests with personal key
3 Likes

I just ran into the same issue, I can also confirm this worked ~two days ago when I first tried gemini-2.5-pro-exp-03-25

Same here

Same here. Does anyone know a solution? I see a lot of folks already using it, but no one explains how they managed to set it up correctly.

2 Likes

hi.

Same promble, hope Cursor fix this ASAP.

same problem, please fix ASAP

same problem

I agree with you I would pay 50$ to use my own API key. I can’t stand anymore cursor nerfing the models.. Sometimes I’m more productive using ge mini’s own chat than using the same model in the cursor chat and the nerf context is an absurd problem