The Codex extension for VS Code: features and your own provider
The Codex extension lives in the VS Code sidebar and uses the same config.toml as the CLI. Features, connecting a gateway and the limits.
6 min · · IDE · агенты
The Codex extension adds a sidebar with OpenAI's agent to VS Code: it sees open files and selected code, proposes edits and shows them as a diff. A common question: can you use this extension with your own provider instead of signing in with ChatGPT. The short answer: provider settings live in config.toml, which the extension shares with the Codex CLI, but one nuance with sign-in should be verified on your version. Everything in order below.
The extension details come from OpenAI's Codex documentation as of October 18, 2026. The interface is updated often, so check item names against your version.
What the extension does
According to OpenAI's documentation, the extension provides:
- Editor context. You can add an open file, a selection or a recent chat to the prompt, and Codex starts from the code you are looking at.
- Reviewing changes. A short summary and a focused diff beside the code; you can keep edits partially and follow up in the same chat.
- Delegation. Quick iterations run locally, and for a bigger task you can connect cloud Codex (Codex web) and return for the result in the same editor.
- Shared settings with the CLI. The model, reasoning effort, permissions, sandbox and MCP servers are read from
config.tomland are the same for the extension and the console.
The extension is not limited to VS Code: install links exist for Cursor, Windsurf and VS Code Insiders. Xcode and JetBrains have separate Codex integrations.
Installing and first launch
- Install the extension with the identifier
openai.chatgpt(it is called Codex in the Marketplace) in VS Code, Cursor or Windsurf. - Click the Codex icon in the sidebar. If it is missing, open the Command Palette and run Codex: Open Codex Sidebar.
- On the sign-in screen choose an authorization method. For working with a key there is an API key option (it is called "Use API Key" on the screen).
- Open a project and give a small task: explain code or make a targeted edit.
It is worth making a git commit before edits: the documentation itself advises creating such checkpoints before and after a task.
Connecting your own provider
Agent settings are read from ~/.codex/config.toml. You can open the file straight from the extension: the gear icon in the top corner of the panel, then Codex Settings, then Open config.toml. The extension and the CLI use the same configuration layers, including the default provider.
Add the Zukko gateway:
model = "gpt-6.1-sol"
model_provider = "zukko"
[model_providers.zukko]
name = "zukko"
base_url = "https://api.zukko.pro/v1"
env_key = "ZUKKO_API_KEY"
wire_api = "responses"Here base_url contains /v1, and wire_api = "responses" is, per OpenAI's documentation, the only supported value: Codex talks through the Responses API, which the gateway accepts at POST /v1/responses. According to the Zukko documentation, GPT and Claude models work in Codex and GLM does not.
Create the fetch_... key in the dashboard. Then there are two ways to pass it.
Option A: an environment variable (env_key). Set ZUKKO_API_KEY at user level and fully restart VS Code. An important detail: the editor must receive the variable at startup. If you put it in a shell profile but launch VS Code from a menu, the process may not see it. It is more reliable to start the editor from a terminal (code .) or to set the variable system-wide.
Option B: the auth.json file. This method is described in the Zukko Codex documentation: config.toml gets requires_openai_auth = true and the key goes into ~/.codex/auth.json as { "OPENAI_API_KEY": "fetch_..." }. The downside: the same file is used by account sign-in, so a later sign-in with ChatGPT will overwrite the key.
The extension reads config.toml from the .codex folder in the home directory. If you work on Windows with WSL, keep in mind that Windows and WSL have different home directories and therefore different configuration files.
What to verify on your version
Honestly about the non-obvious. OpenAI's documentation says the extension, the desktop app and the CLI support both sign-in methods, ChatGPT and an API key. What exactly the sign-in screen shows when the provider is already set in config.toml does not follow unambiguously from the documentation and may differ between versions. If the extension asks you to sign in, choose the API key option and paste your Zukko key, then confirm from the spending records in the dashboard that requests really go through the gateway. If your outcome differs, check the current extension documentation.
Limits worth knowing in advance:
- cloud Codex (Codex web) and tasks delegated from the extension to the cloud require ChatGPT sign-in, per OpenAI's documentation; they are unavailable with an API key;
- features tied to a ChatGPT workspace are limited or unavailable when signed in with a key;
- extension settings with the
chatgpt.*prefix are set in the editor settings, not inconfig.toml.
What it costs
With the gateway you pay for tokens, no subscription is needed. Let us estimate an editor session: 20 requests, on average 15,000 input tokens (open files and history) and 700 output tokens. Input 20 × 15,000 = 300,000, output 20 × 700 = 14,000 tokens. Prices as of October 18, 2026 per 1M tokens, ignoring cache; volumes below are in millions of tokens.
gpt-6.1-sol(input $0.27, output $1.32): 0.3 × 0.27 + 0.014 × 1.32 = 0.081 + 0.01848 ≈ $0.0995.claude-sonnet-5-5(input $0.4, output $2): 0.3 × 0.4 + 0.014 × 2 = 0.12 + 0.028 = $0.148.
For GPT models the gateway sees cache reads (prompt_tokens_details.cached_tokens) and bills them at the read price from the table; cache writes are not billed separately for GPT. Which model handles your code better, check yourself by comparing the result and the price. The Artificial Analysis intelligence index is 52 for gpt-6.1-sol and 48 for claude-sonnet-5-5, but that is no guarantee on a particular task.
A daily and monthly key limit set in the dashboard helps control spending. Check current prices in GET https://api.zukko.pro/v1/models. You can top up the balance via SBP (the payment page adds an 8.5% fee on top), cryptocurrency or a MasterCard card.
The extension or other options
If OpenAI's agent in a panel does not suit you, VS Code has other extensions that connect to the gateway directly, such as Cline and Kilo Code (the Roo Code extension, according to a notice in its documentation, was shut down on May 15, 2026). Their setup is described in the VS Code extensions docs. The console Codex and how it differs from Claude Code are covered in Codex or Claude Code.
FAQ
Does the Codex extension work without a ChatGPT subscription?
OpenAI's documentation allows sign-in with an API key. The own-provider scheme is covered in detail above, and the article Codex without a ChatGPT subscription describes the console variant.
One config for the extension and the console?
Yes, OpenAI's documentation calls the configuration layers shared between the CLI and the extension. By changing config.toml you change the behavior of both.
Why does the extension not see the environment variable?
The editor process received its environment before you set the variable, or it was started from a menu rather than a terminal. Set the variable system-wide, fully close VS Code and open it again.
The extension is silent or unresponsive, what to do?
For Windows the documentation names a possible cause: C++ tools are missing (Visual Studio Build Tools with the C++ workload and the Microsoft Visual C++ Redistributable). Install them and fully restart VS Code.
To try it, create a key in the Zukko dashboard, add the provider to config.toml and open the Codex panel.
zukko
Pay 25×
less
for Claude Code & ChatGPT
One fetch_* key and base URL api.zukko.pro — for Cursor, Claude Code, Codex, and any SDK.
Related articles
- Claude Code in Zed: connecting an external agent to your own keyIn Zed you can open Claude Code as a terminal thread, as an external agent over ACP, or configure the built-in agent. We cover each option and connect it to your key.
- Claude Code for 1C: setting up an agent to work with a configurationThe agent edits BSL text modules, not the infobase. How to dump a configuration, what goes into CLAUDE.md, how to check edits and what it costs.
- Cursor CLI: the Cursor agent in the terminal, install and setupThe Cursor agent works in the terminal as well as the editor, with the agent command. Install it, configure it, run it in scripts and compare it with Claude Code and Codex.
- Cline in Russia: installation and model setup without a foreign cardThe Cline extension runs locally, so the only question is where model requests go and how you pay for them. Step-by-step setup with one key and a task cost estimate.