So as of a few minutes ago I think I figured it out. I had to install the codex CLI and then open the auth.json file in my IDE. I wiped out the existing token & refresh data from there and just saved the API key in that file, as well as set the config.toml file to have API key as my preferred auth method. After restarting VS code and opening the extension, it seems to be using the API key now!
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Introducing the Codex IDE extension | 30 | 14044 | October 21, 2025 | |
| Can't setup Codex CLI with custom base url and api key, via terminal env variables or command options? | 2 | 6062 | October 24, 2025 | |
| Visual Studio Code extension for Codex | 23 | 18910 | December 13, 2023 | |
| Fix for vscode/cursor plugin: stream error: exceeded retry limit, last status: 401 Unauthorized | 9 | 8836 | October 29, 2025 | |
| Login with OPENAI_API_KEY environment variable | 3 | 694 | January 21, 2026 |