BYOK incorrectly throws API rate limits errors

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

I’m using my own Google key and I often run into API rate limit errors despite having enough headroom on my Google account. I have verified this by running direct Gemini calls through a continuous shell command which keeps returning successfully while simultaneously running into this in Cursor. It’s also not a rare occurrence, I’d say it happens roughly 20% of the times.

Steps to Reproduce

  1. Add a Google API key to the Cursor IDE
  2. Use any Gemini model throughout the day
  3. You’ll see the rate limit error roughly 10-20% of the time (depending on time of day)

Screenshot 2026-10-29 at 1.02.55 PM

Expected Behavior

No rate limit errors should occur unless you are actually running into a rate limit at the provider ie. Google in this cae

Operating System

MacOS

Version Information

3.27.22 (Universal)

For AI issues: which model did you use?

All Google models - Gemini flash, Gemini pro & Argon

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

Thanks for the detailed report.

When you bring your own Google key, Cursor still routes the request through its own servers to build context and the prompt, so a Cursor agent turn and a direct shell call take different paths and send very different amounts of data. An agent turn carries a large prompt (lots of context and tokens), while a quick shell call sends almost nothing. Since Gemini’s limits are largely per-minute token and request limits, the heavier Cursor traffic can hit a per-minute limit on your key even while your lightweight shell loop stays under it. Newer models like Argon can also have tighter limits.

It’s also worth knowing that this error in Cursor can show up both for a real provider rate limit and when Google’s endpoint is briefly overloaded or returning an error, so the “rate limit” wording by itself doesn’t always mean Google actually rate-limited you.

To pin it down, could you share the specific model you had selected when it happened (and confirm it was a pinned Gemini model, not Auto, since Auto doesn’t use your key), and a Request ID from a failing turn if you can grab one. It also helps to check your Google AI Studio / Cloud quota dashboard and request logs around those timestamps to see whether Google logged a 429 on those heavier requests. That tells us quickly whether the limit is coming from Google or whether Cursor is mislabeling a transient error.

Thanks for the quick response, Mohit. It makes sense that Cursor routes the calls internally with wrapper/harness data. The issue happens quite frequently and I’m very thoroughly aware of all limits on Google’s end - RPM, TPM, RPD etc.

The API key I’ve added to Cursor is a Tier 3 API key which we use on our development servers as well and these keys have very high limits and we pretty much run under 20% usage on all metrics so a rate limit on Google’s end makes no sense. I’ve also actively monitored the Google dashboards several times to confirm when Cursor shows this error - a rate limit was never actually hit during these times.

I’m happy to send over the request ID the next time it happens - I don’t have one handy. I ran into this while using Argon yesterday but have seen it many times before with Flash as well. I’ll provide exact details the next time I capture it.

Here is a request ID that failed today, @mohitjain

e9b9c362-c50c-4def-a03b-62de57bad37f

I ran into the continuous rate limit errors today, below are the relevant request IDs:

30715162-b767-4214-86e1-806c9d4f3575
fda640dc-8ede-4c19-9748-94db0b849479
2db4d963-c408-47e2-805f-2193721886d6
904d188f-fd96-48e4-9cc7-a1de5ecfcda0

Hi @akai, thanks for the request IDs. I traced all five, and they match what you saw on your Google dashboards.

Each one did get a 429 back from Google on your key, but it’s Google’s generic “Resource has been exhausted” response with no quota named. When a key actually hits its RPM or TPM limit, Google names that limit in the error, and none of yours do. So this isn’t your key’s limits. It looks like short bursts of capacity pressure on Google’s side, mostly on Gemini 4 Argon, and it isn’t specific to your account.

On our side, Cursor labels this as “User API Key Rate limit exceeded”, which is misleading here. I’ve passed that to the team.

Our advice for now:

  1. When it happens, wait a few seconds and resend. These tend to come in short bursts.
  2. For long agent runs, Gemini 3.8 Flash on the same key hits this much less often than Argon.

I experienced same issue for Gemini 4 Argon model with custom API key on Cursor.

Is there any solution?

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Hi Cursor Team,

My name is Xuanming, and I’m reaching out from ChatAndBuild.

We are currently using Cursor with our own custom API keys for both GPT and Gemini models. Everything has been working well overall, except that we frequently encounter rate limit errors when using the Gemini 4 Argon model.

We have already checked our Gemini API usage with the Google team, and they confirmed that we have not exceeded any of our API rate limits. They recommended that we reach out to the Cursor team to investigate further.

Could you please help us understand why these rate limit errors are occurring? Is there any issue or limitation related to our Cursor team plan or the way custom Gemini API keys are handled for the Gemini 4 Argon model?

We would appreciate your help in investigating this issue.

Looking forward to your response.

Best regards,
Xuanming
ChatAndBuild

Steps to Reproduce

Set custom Gemini key on setting.
Open new chat on Cursor.
Keep sending prompt on the chat thread, then you will get rate limit error frequently.

Expected Behavior

Our API key has very high rate limit, so rate limit error shouldn’t occur

Operating System

Windows 10/11
MacOS
Linux

Version Information

Version: 3.28.7 (user setup)
VS Code Extension API: 1.128.0
Commit: 25b52e7d03ebf2d5608914158e119f7992432a30
Date: 2026-11-03T02:20:44.943Z
Layout: IDE
Build Type: Stable
Release Track: Default
Electron: 42.11.16
Chromium: 148.0.7778.280
Node.js: 24.19.0
V8: 14.8.178.38-electron.0
xterm.js: 6.1.0-beta.291
OS: Windows_NT x64 10.0.26100

Does this stop you from using Cursor

No - Cursor works, but with this issue