OpenAI API and Override Base URL Values

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Not a bug, a question.

Hello to all Cursor-ista’s out there.

I’m trying to replace the OpenAI API key and Override OpenAI Base URL with my own cause i want to dynamically change these values upon command with a bash script.

I’ve searched and searched, i had help from my trusty cursor ide, checked all json files and querries all the vscdb sqlite3 database’s without success.

It’s such a hassle to get into Cursor settings each time and swap the values.. :-/ #meh

If anyone from the mod team or any other redditor can help me out, i’ll produce a nice github repo to share the script with anyone. I will provide 2 versions one via bash (or other) script, and one with gui maybe with zenity or other library, to have it stay on your task/menu bar and wait for a right click to switch to the one you want.

Kudos to the Cursor team!

Steps to Reproduce

No steps to reproduce

Expected Behavior

Well, i’d like to be able to change the values via script

Screenshots / Screen Recordings

Operating System

Linux

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.2.44
VSCode Version: 1.105.1
Commit: 20adc1003928b0f1b99305dbaf845656ff81f5d0
Date: 2025-12-24T21:41:47.598Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Linux x64 6.18.3-pikaos

For AI issues: which model did you use?

Auto, i think it was compose 1.

For AI issues: add Request ID with privacy disabled

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the report.

Unfortunately, changing API keys programmatically via a script isn’t supported right now.

API keys are stored in Cursor’s secure storage and aren’t written to regular config files or SQLite databases, so that’s why you didn’t find them there.

For now, the only way is through the GUI: Cursor Settings > Models.

If you really need to switch between different API endpoints, you can leave a feature request in the Feature Requests category and describe your use case. The team reviews those requests.

1 Like

Thank you for the prompt reply.

I had hope.. but.. i did find where and how the OpenAI API key is stored, so first step for me is done, to switch to my personal api key instead of my work api key.

Now i need to find the override base url value.. :man_supervillain:

edit.. found the override url too.. so i’m ok i have the solution.

Thank you @deanrie no worries i got this! :stuck_out_tongue:

1 Like