{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreiestlssyifwar4uqtsbknfhro7b4q7gqadhx4wlhcmnhngay4ah6i",
    "uri": "at://did:plc:lk3jfj3zq4k4wxnk474axylu/app.bsky.feed.post/3mfueua5zlkl2"
  },
  "path": "/t/vscode-extension-with-api-key/1355263#post_10",
  "publishedAt": "2026-02-27T17:55:14.000Z",
  "site": "https://community.openai.com",
  "textContent": "Here are the steps I took to get Codex extension working in VSCode:\n\n  1. Quit VSCode.\n\n  2. Edit the file `~/.codex/config.toml` to include the following:\n\n\n\n\n\n    trusted_workspace = true\n    preferred_auth_method = \"apikey\"\n\n\n  3. Open the file `~.codex/auth.json` and delete all the contents. Save.\n  4. In terminal export your OpenAI key:\n\n\n\n`% export OPENAI_API_KEY=\"your-api-key-here\"`\n\n  5. Start VSCode:\n\n\n\n`% code .`\n\n  6. Install the Codex extension. And login using “**Use API Key** ”:\n\n\n\n",
  "title": "VSCode Extension with API Key"
}