Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
When I tried to add my OpenAI API key in Cursor and clicked Verify, the button kept spinning forever and then failed with a warning.
I intercepted the request Cursor was sending and saw that it was posting to the OpenAI API with this payload: {
“model”: “gpt-5”,
“messages”: [
{“role”:“system”,“content”:“hello.”},
{“role”:“user”,“content”:“Test prompt using gpt-3.5-turbo”}
],
“temperature”: 1,
“max_tokens”: 10,
“stream”: false
}
The API responded with:{
“error”: {
“message”: “Unsupported parameter: ‘max_tokens’ is not supported with this model. Use ‘max_completion_tokens’ instead.”,
“type”: “invalid_request_error”,
“param”: “max_tokens”,
“code”: “unsupported_parameter”
}
}
So the issue was not with my API key itself — Cursor was sending the wrong parameter for the new OpenAI models.
Solution / Workaround:
Since the new Responses API requires max_output_tokens (and not max_tokens or max_completion_tokens), I had to put a local proxy in front of the OpenAI API. The proxy rewrites the request:
If it sees max_tokens or max_completion_tokens, it converts them to max_output_tokens.
It enforces the minimum required value (>=16).
It also converts /v1/chat/completions requests into /v1/responses when needed.
I run this proxy in Docker, point Cursor’s Override OpenAI Base URL to http://localhost:8787/v1, and now the Verify button works fine.
Steps to Reproduce
Open Cursor and go to Settings → Models.
Add your OpenAI API key.
Enable Override OpenAI Base URL and keep it pointing to https://api.openai.com/v1.
Click Verify.
Observe that the button keeps spinning and eventually fails.
Expected Behavior
When I add my OpenAI API key in Cursor and click Verify, the app should successfully validate the key and show a confirmation message. Cursor should send the request to the OpenAI API using the correct parameters for the current models (for example, max_output_tokens in the Responses API) so that the request is accepted without errors.
Operating System
Linux
Current Cursor Version (Menu → About Cursor → Copy)
idk, it’s on my job pc
Does this stop you from using Cursor
No - Cursor works, but with this issue