External Publication
Visit Post

VSCode Extension with API Key

OpenAI Developer Community February 27, 2026
Source

Here are the steps I took to get Codex extension working in VSCode:

  1. Quit VSCode.

  2. Edit the file ~/.codex/config.toml to include the following:

trusted_workspace = true
preferred_auth_method = "apikey"
  1. Open the file ~.codex/auth.json and delete all the contents. Save.
  2. In terminal export your OpenAI key:

% export OPENAI_API_KEY="your-api-key-here"

  1. Start VSCode:

% code .

  1. Install the Codex extension. And login using “Use API Key ”:

Discussion in the ATmosphere

Loading comments...