OpenAI Codex: what it is, its parts and how to use it

Codex is a coding agent that reads a project, edits files and runs commands. Its parts, how it differs from ChatGPT and the payment options.

6 min · · агенты · development

Codex is OpenAI's coding agent. It does not work like a chat but like an executor: it reads the project, proposes and makes edits, runs commands and tests, looks at the result and continues. Below is a short account of what Codex AI is, what parts it has, how it differs from ChatGPT and how to use it, including with your own provider.

The description follows the README of github.com/openai/codex and OpenAI's documentation as of October 18, 2026. The product lineup and access terms change, so check OpenAI's site for the current state.

What Codex consists of

Under the name Codex there are now several ways to work with the same agent.

  • Codex CLI. A console agent which, per the repository description, runs locally on your computer. The CLI code is open (Apache-2.0 license).
  • Editor extension. The Codex extension for VS Code and compatible editors (Cursor, Windsurf); Xcode and JetBrains have their own integrations.
  • Desktop app. Started with codex app or from the Codex App page on OpenAI's site; its features are described in OpenAI's documentation.
  • Cloud agent (Codex Web). Lives at chatgpt.com/codex, with tasks executed in the cloud. Per the documentation it needs ChatGPT sign-in.

Here the focus is the CLI: it is the easiest to connect to your own provider. How the extension and the app work with third-party providers, check in OpenAI's documentation.

How Codex differs from ChatGPT

ChatGPT is a chat: you paste code and get text. Codex works with your repository directly:

  • reads files and searches the project instead of waiting for a paste;
  • edits files and shows a diff;
  • runs commands in a sandbox with configurable approval (approval_policy);
  • can connect external tools via MCP and use skills and hooks;
  • reads the AGENTS.md file with project instructions (see the article AGENTS.md for Codex CLI).

In other words, "what is Codex for": editing and refactoring in an existing project, triaging failing tests, reviewing changes, migrations, explaining unfamiliar code. How well it turns out depends on the task and the model, so try small pieces first.

How to install and start

Per the repository README, on macOS and Linux:

bash
curl -fsSL https://chatgpt.com/codex/install.sh | sh

On Windows (PowerShell):

bash
powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"

Alternatives: npm install -g @openai/codex or brew install --cask codex. After installing, run codex in the project directory. On Windows Codex runs both natively and in WSL. A script from the internet runs code on your machine: if you do not want that, install with a package manager.

Sign-in and payment options

OpenAI's documentation names two paths:

  1. Sign in with ChatGPT. Codex is included in a number of ChatGPT subscriptions (see OpenAI's help for the list of plans and the usage allowance); subscription usage has limits.
  2. Sign in with an API key. Usage is billed at the API rates of the chosen provider, and some features tied to a ChatGPT account are limited or unavailable.

A third path follows from the provider being set in config.toml: you can point to any compatible address. Then you pay for tokens and no subscription is needed. Below is an example for the Zukko gateway. We do not quote OpenAI subscription terms because they change: see the current plans on the service's site.

Using Codex with your own provider

The configuration lives in ~/.codex/config.toml:

bash
model = "gpt-6.1-sol"
model_provider = "zukko"
model_reasoning_effort = "medium"

[model_providers.zukko]
name = "zukko"
base_url = "https://api.zukko.pro/v1"
env_key = "ZUKKO_API_KEY"
wire_api = "responses"

Create the fetch_... key in the dashboard and set it through the ZUKKO_API_KEY environment variable. Notes: base_url contains /v1; wire_api = "responses" is, per OpenAI's documentation, the only supported value, and the gateway accepts this format at POST /v1/responses. Step-by-step setup and the second method (the key in auth.json) are in the Codex documentation. To limit spending you can set a daily and monthly limit on the key.

According to the Zukko documentation, GPT and Claude models work in Codex and GLM models do not. The model is changed in config.toml or at launch with the --model flag. Choose by price, context and intelligence index, and test quality on your own tasks.

What it can cost

An agent sends the model the accumulated history at every step, so more tokens are used than in a chat. An example: a session of 30 requests, on average 40,000 input tokens and 1,000 output tokens each. Input 30 × 40,000 = 1,200,000, output 30 × 1,000 = 30,000 tokens. Prices per 1M tokens as of October 18, 2026, ignoring cache.

ModelZukko input / output, $Calculation, $Official input / output, $Calculation at those, $
gpt-6.1-sol0.27 / 1.321.2 × 0.27 + 0.03 × 1.32 = 0.3642 / 101.2 × 2 + 0.03 × 10 = 2.70
claude-sonnet-5-50.4 / 21.2 × 0.4 + 0.03 × 2 = 0.542 / 102.70
claude-opus-5-50.8 / 41.2 × 0.8 + 0.03 × 4 = 1.084 / 201.2 × 4 + 0.03 × 20 = 5.40

This is an illustrative calculation: real sessions are shorter and longer. For GPT models the gateway accounts for cache reads (prompt_tokens_details.cached_tokens), billed at the read price from the table (for gpt-6.1-sol that is $0.013 per 1M), and cache writes are not billed separately. So on long sessions the total may come out lower than the no-cache calculation. For Claude the cache discount comes with the Anthropic format; through the Responses API in Codex rely on the actual charges in the dashboard. Artificial Analysis intelligence index: claude-opus-5-5 58, gpt-6.1-sol 52, claude-sonnet-5-5 48. The current list: GET https://api.zukko.pro/v1/models.

The balance is topped up from $1: SBP (the payment page adds an 8.5% fee on top), cryptocurrency or MasterCard cards. There is no subscription.

What a newcomer should keep in mind

  • Start in the mode where Codex asks for confirmation and move to a freer one once you understand its behavior.
  • Work in a git repository and commit before and after tasks.
  • Do not leave secrets in the repository: the agent reads project files.
  • For long sessions set a limit on the key: how to set a daily and monthly limit.
  • You can compare Codex with Anthropic's terminal agent in the article Codex or Claude Code.

FAQ

Is Codex the same as ChatGPT?

No. ChatGPT is a chat, Codex is an agent that works with your project's files and commands. Access to Codex may be part of a ChatGPT subscription, but it is a separate product.

What can Codex do?

Read and edit code, run commands and tests, connect MCP servers and skills, follow instructions from AGENTS.md, work in the console, the editor, the desktop app and the cloud. How well it handles your task, check in practice.

Do I need a ChatGPT subscription for Codex?

The cloud part needs ChatGPT sign-in. The console Codex and the extension can be used with an API key or with your own provider, as shown above.

Can I use Claude models in Codex?

Per the Zukko documentation, yes: GPT and Claude models work through the Responses API in Codex. Pick, for example, claude-sonnet-5-5 and compare the result and price on your task.

To try it, create a key in the Zukko dashboard, add the provider to config.toml and run codex in a small repository.

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.

Get API keyDocumentation

api.zukko.pro · fetch_*

Codex AI: what it is, how it works and how to use it · Zukko