OpenAI API Key cannot be saved

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

I entered the API Key, and when I tried using the Ctrl + S shortcut to switch tabs, the API Key became an empty string. However, the Base URL didn’t have this problem. Why is this?

Steps to Reproduce

Enabling the OpenAI API Key option and entering a custom API Key, then switching tabs, the API Key will now be an empty string; only the Base URL will be recorded correctly.

Screenshots / Screen Recordings

Operating System

Windows 10/11

Version Information

Version: 3.16.17 (user setup)
VS Code Extension API: 1.128.0
Commit: 6b2afae0257df2bb5e1835f15165dc2f0de056b0
Date: 2026-08-14T01:41:12.803Z
Layout: IDE
Build Type: Stable
Release Track: Default
Electron: 40.10.3
Chromium: 144.0.7559.236
Node.js: 24.15.0
V8: 14.4.258.32-electron.0
xterm.js: 6.1.0-beta.291
OS: Windows_NT x64 10.0.26200

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the report. Everything here is working as intended, let me explain.

The OpenAI API Key field is a write-only secret input. The key is saved to encrypted secret storage as soon as you enter it. There’s no separate Save button, and Ctrl+S doesn’t apply here. For security reasons, Cursor never shows the saved key again, so after you switch tabs the field will always look empty. Base URL is not a secret, so it stays visible, which is the difference you noticed.

Please check by going back to the Models tab:

  • The key field shows the placeholder “Secret saved. Enter a new key to replace it”
  • There’s a toggle next to the section title called “Use OpenAI API key”

If that’s what you see, the key is saved and you’re all set.

If it still says “Enter your OpenAI API Key” and the toggle is missing, then the save didn’t go through. Please send a screenshot of that state and we’ll dig in.