OpenRouter/OpenAI API not verifying

Describe the Bug

Hello, the following issue has already been reported:
https://forum.cursor.com/t/cannot-enable-openai-api-key/123006/3

I was also encountering it while trying to add my OpenRouter key

Steps to Reproduce

Attempt to add OpenAI API key, add OpenRouter instead with the correct URL, click ‘Verify’ to no avail

Expected Behavior

An error message, or better yet, a pass

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 1.3.5
VSCode Version: 1.99.3
Commit: 9f33c2e793460d00cf95c06d957e1d1b8135fad0
Date: 2025-07-30T00:25:05.701Z
Electron: 34.5.1
Chromium: 132.0.6834.210
Node.js: 20.19.0
V8: 13.2.152.41-electron.0
OS: Darwin arm64 24.5.0

Additional Information

It appears that there are two issues:

  1. There is no error message pop-up to indicate that something went wrong (unlike the Gemini one, for example)
  2. The verification attempts to hit 4o, which may or may not be available to the user to test (the Bedrock one has a good open input for verification)

The offending request is:

{
    "model": "gpt-4o",
    "messages": [
        {
            "role": "system",
            "content": "You are a helpful assistant."
        },
        {
            "role": "user",
            "content": "Test prompt using gpt-3.5-turbo"
        }
    ],
    "temperature": 1,
    "max_tokens": 10,
    "stream": false
}

FWIW, I was able to get it all working and while the issue gets fixed, you can just paste this swizzle in you console to override all fetch requests and bypass the check:

:light_bulb: Temporary Fix:

(function() {
  const originalFetch = window.fetch;
  window.fetch = async function(url, options) {
    const response = await originalFetch(url, options);
    return new Response(response.body, {
      status: 200,
      statusText: 'OK',
      headers: response.headers
    });
  };
})();

then try to verify again

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

Hey, thanks for the report. Can you check the dev tools panel when you try to verify the API key? Also, what happens if you don’t press the verify button but toggle the API key switch instead?

Additionally, try disabling all models except the one related to the OpenRouter model. Also, try updating Cursor to version 1.3.8.

I’m facing the same verification issue with OpenRouter/OpenAI keys—no error popup appears, which makes it hard to troubleshoot. The console swizzle workaround helped temporarily. I’ve also been switching between Claude AI and GPT models lately, and Claude’s setup was smoother in comparison. Is there a way to force verify using gpt-3.5 instead of gpt-4o like how Claude models allow manual input?

While we are working on an update that improves this, note:

  • Disable all models that are not available in your custom API
  • If a model available on your API key account is not listed you can add it manually in Cursor Settings > Models.

This should make it possible to verify your own API URL & key.
(it has been confirmed by a user in their own thread)