Back to guides
Tutorial·November 21, 2026·20 min read

How to use Codex: a CLI tutorial in Portuguese, from installation to AGENTS.md and the cost of each task

Install the CLI, run codex in your project folder, sign in, and make your requests in Portuguese. This tutorial covers the rest: AGENTS.md, permissions, commands, codex exec, ChatGPT plan limits, and how to use an API key with a balance topped up with Pix.

Codex is OpenAI's coding agent: it reads your project, edits files, and runs commands for you, in the terminal (Codex CLI), in your editor (an extension for VS Code, Cursor, and Windsurf), in the ChatGPT desktop app, or in the cloud. To use the CLI, install Codex, go to your project folder, run codex, sign in, and ask for what you need in Portuguese. On macOS and Linux, installing takes a single line: curl -fsSL https://chatgpt.com/codex/install.sh | sh. On Windows, there's an installer for PowerShell. You can also install with npm and, on macOS and Linux, with Homebrew.

There are two ways to run Codex. When you sign in with your ChatGPT account, you use your plan's quota: Plus costs US$ 20 per month and is the first plan for which the pricing page lists the CLI and the extension. With an API key, you pay per token, with no monthly fee. From Brazil, the difference matters: Go, Plus, and Pro subscriptions bought on chatgpt.com accept Pix, but OpenAI's API credits are sold only in dollars and require a standard credit or debit card. Through Kunavo, an independent API gateway that works with Codex CLI, you use your own key and top up your balance with Pix, in reais; a 20-step task on GPT-5.6 Sol costs about US$ 1.29, not counting caching.

Updated on November 21, 2026. Commands, plans, and limits come from the official Codex documentation (CLI, sign-in, pricing) and from OpenAI's help center, read in the original English: the Portuguese editions of these pages are machine-translated, and OpenAI itself says so at the top of each one. Kunavo's prices come straight from Kunavo's model catalog.

Where Codex runs: CLI, extension, app, and cloud

WhereHow to openChatGPT sign-inAPI key
Codex CLI, in the terminalcodex in the project folderYes, starting with Plus, according to the pricing pageYes
Extension for VS Code, Cursor, and WindsurfCodex icon in the editor's sidebarYes, starting with Plus, according to the pricing pageYes
ChatGPT desktop app, for macOS and WindowsChoose Codex after signing inYesYes
Codex cloud: web tasks, code review, SlackOn the web, in the desktop app, or on your phoneYes, on eligible plansNo

When it comes to plans, the two official sources disagree: the help center says Codex is included in every ChatGPT plan, including Free and Go, but the Codex pricing page lists only GPT-6 Luna in the desktop app for Free and Go, subject to a gradual rollout, and mentions the CLI and the extension only from Plus up. Codex cloud is for eligible Plus, Pro, Business, Enterprise, Healthcare, and Education accounts, and cloud tasks can be opened and tracked in the desktop app, on the web, or on your phone.

How to install Codex

The official documentation leads with OpenAI's own installers; npm and Homebrew remain valid alternatives, with Homebrew only on macOS and Linux. Pick a single method so you don't end up with two copies and update the wrong one. On macOS and Linux:

terminal
# macOS e Linux: o instalador oficial (rode de novo para atualizar)
curl -fsSL https://chatgpt.com/codex/install.sh | sh

# Ou com npm (o mesmo comando atualiza)
npm install -g @openai/codex

# Ou com Homebrew (para atualizar: brew upgrade --cask codex)
brew install --cask codex

On Windows, in a new PowerShell window:

PowerShell
# Windows: numa janela nova do PowerShell (rode de novo para atualizar)
powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"

To update, run the same installation command again; with Homebrew, use brew upgrade --cask codex. If something seems broken, codex doctor generates a local report that checks the installation, configuration, authentication, runtime, Git, and terminal. The CLI is open source, under the Apache-2.0 license, in the openai/codex repository; the extension and Codex cloud are not.

How to install Codex on Windows: native or WSL2

Codex runs natively on Windows: the desktop app, the CLI, and the extension use a Windows-specific sandbox, without WSL, and that's the path OpenAI recommends by default (Windows sandbox). Tutorials that tell you to use WSL because Windows support is supposedly “experimental” are out of date. WSL2 is still an option if your work already lives in Linux: install Codex inside the distribution with the macOS and Linux command, and keep your repositories in your Linux home directory, because /mnt/c can be slower. WSL1 has not been supported since Codex 0.115, when the Linux sandbox switched to bubblewrap (WSL documentation).

How to open Codex and sign in

Go to your project folder and run codex. The first time, Codex asks you to choose how to sign in: Sign in with ChatGPT opens your browser and uses your plan's quota, and you can also sign in with an OpenAI API key. The login commands, for when you need them outside the interface:

terminal
cd ~/projetos/minha-api      # a pasta do seu projeto
codex                         # na primeira vez, escolha como entrar

# Os comandos de login, fora da interface:
codex login                   # login com o ChatGPT, pelo navegador (o padrão)
codex login --device-auth     # máquina sem navegador (beta); antes, ative o login por
                              # código de dispositivo nas configurações de segurança do ChatGPT
printenv OPENAI_API_KEY | codex login --with-api-key   # chave de API da OpenAI (macOS e Linux)
codex login status            # mostra qual login está ativo
codex logout                  # apaga as credenciais salvas

With an API key, three things change: OpenAI bills usage to your API platform account, at API rates, rather than against your plan's quota; features that depend on the ChatGPT workspace or the cloud are limited or unavailable (sign-in documentation); and the models are the ones your API organization can use (models documentation). Your login is stored in ~/.codex/auth.json, a plain-text file with no encryption, or in the operating system's credential store, and the CLI and the editor extension use the same saved login.

Your Kunavo key doesn't go through codex login: the key lives in an environment variable that config.toml points to, as shown in the section on paying from Brazil, further down.

Your first task in Codex

Before opening Codex, create a Git checkpoint so you can undo whatever Codex changes. Use git status to check what will go into that commit: a .env file that .gitignore doesn't cover, for example, shouldn't go in.

terminal
# 1. Um checkpoint no Git antes de começar
git status                    # confira o que vai entrar no commit
git add -A
git commit -m "checkpoint antes do Codex"

# 2. Abra o Codex na raiz do repositório
codex

Inside Codex, three steps:

  1. /init generates a draft AGENTS.md in the current folder (more on that file just below).
  2. Make your request in Portuguese, referencing the file (with @, which searches the project's files). For example: O teste em @tests/test_pedidos.py está falhando. Ache a causa, corrija e rode o pytest.
  3. Before the next commit, /diff shows the Git diff, including new files that Git doesn't track yet, and /review asks Codex to review the changes.

Write the request the way you'd write it to a colleague: what's wrong, where (the file path helps), and how to tell when it's done. For bigger tasks, start in plan mode, with /plan or Shift+Tab: Codex gathers context, asks questions, and proposes a plan before touching the code (best practices). Like the result? Make another commit. Don't like it? Run git stash -u: the changes are taken out of your files and stashed in case you change your mind, and the project goes back to the checkpoint. A checkpoint before and another after each task is what the CLI documentation itself recommends.

  • @ searches for a project file and puts the file's path in your request.
  • ! at the start of a line runs a shell command, with the same permissions and the same sandbox as the session.
  • Tab, while Codex is working, queues a message for after Codex finishes; Enter sends the instruction right away, mid-task.
  • Esc twice, with the input field empty, edits your previous message and forks the conversation from that message.

AGENTS.md: the project's rules, in Portuguese

AGENTS.md is an instructions file that Codex reads before starting any work. It holds what the code doesn't say on its own: how to run the tests, what must not be changed, what “done” means. /init creates a draft in the current folder; review the draft, adjust it, and commit it along with the code. An example for a Python API:

AGENTS.md
# AGENTS.md

## Idioma
- Responda em português do Brasil.
- Código, nomes de variáveis e mensagens de commit em inglês.

## Projeto
- API em Python 3.12 com FastAPI; código em app/, testes em tests/.

## Comandos
- Instalar dependências: pip install -r requirements.txt
- Testes: pytest -q (rode depois de qualquer mudança em app/)
- Lint: ruff check . (corrija os avisos antes de terminar)

## Regras
- Não mexa em migrations/ nem no arquivo .env.
- Não adicione dependências sem perguntar antes.
- Valores em dinheiro sempre em centavos (int), nunca float.
- Para validar CPF e CNPJ, use app/validadores.py; não escreva outra função.

## Definição de pronto
- Testes e lint passando.
- Um resumo curto do que mudou e por quê.

Writing the file in Portuguese and stating the language for responses is our suggestion, not OpenAI's. What OpenAI does say is that AGENTS.md is the best place to record how you and your team want Codex to work in the repository (best practices); and, written in Portuguese, AGENTS.md can be read and maintained by the whole team.

Where Codex looks (AGENTS.md documentation):

  • Global: ~/.codex/AGENTS.md applies to every project; if ~/.codex/AGENTS.override.md exists, Codex reads the override file instead.
  • Project: from the repository root down to the folder where you opened Codex, at most one file per folder. Files closer to the current folder are added last and therefore take precedence.
  • Size: by default, Codex stops combining files once the total reaches 32 KiB (project_doc_max_bytes).

OpenAI recommends a short, precise file over a long one full of vague rules: start with the basics and add a rule when Codex repeats the same mistake.

Permissions and sandbox: what Codex does without asking

When it runs on your computer, Codex works inside an operating system sandbox, usually limited to the project folder and with network access off by default, and it follows an approval policy that defines when Codex must ask for permission. On launch, Codex recommends Auto mode in a Git repository and read-only mode in folders outside Git; depending on your configuration, Codex may start in read-only mode until you mark the folder as trusted.

ModeHow to enableWhat Codex can do
AutoSuggested when you open Codex in a Git repository; or --sandbox workspace-write --ask-for-approval on-requestReads and edits files and runs commands in the project folder; asks for approval to work outside that folder or use the network
Read-only/permissions, or --sandbox read-only --ask-for-approval on-requestReads files and runs commands in the read-only sandbox; anything beyond that sandbox may require approval
Never ask-a never (--ask-for-approval never)Doesn't ask for approval; the chosen sandbox still applies
Full access--yolo (--dangerously-bypass-approvals-and-sandbox)No sandbox and no approvals; OpenAI doesn't recommend it

Even in Auto mode, the project's .git, .agents, .codex, and .aws folders stay protected, read-only. To switch modes mid-session, use /permissions. And if an old tutorial tells you to put approval_policy = "untrusted" in config.toml, don't: that value has been retired and can keep Codex from starting (approvals and security).

Codex CLI commands for everyday use

Inside Codex, type / to see the list of commands. The ones you'll use most (CLI reference):

CommandWhat it does
/initGenerates a draft AGENTS.md in the current folder
/permissionsChanges what Codex can do without asking, for example switching between Auto and read-only
/modelChooses the model and, when available, the reasoning effort
/statusShows the active model, the approval policy, the folders with write permission, and token usage
/diffShows the Git diff, including files that Git doesn't track yet
/reviewAsks Codex to review changes that haven't been committed yet
/compactSummarizes the conversation to free up context
/planEnters plan mode
/newStarts a new conversation without leaving the CLI
/resumeResumes a saved conversation
/mentionAttaches a file or folder to the conversation
/usageShows your ChatGPT account's token usage; without ChatGPT sign-in, it tells you that you need to sign in
/importImports configuration, projects, and conversations from Claude Code or Cursor
/quit or /exitExits the CLI

If you're coming from Claude Code, /import saves you time: besides configuration and projects, the command looks for up to 50 conversations from the last 30 days. The comparison between the two agents is in Claude Code vs Codex.

Flags that apply to any run: -m switches the model, -C sets the working directory, -i attaches an image to the first request (a screenshot of an error, for example), --search turns on live web search, and -p loads a profile, ~/.codex/<nome>.config.toml. Your default settings live in ~/.codex/config.toml (configuration); on Windows, the Codex folder is %USERPROFILE%\.codex, so the file is %USERPROFILE%\.codex\config.toml (Codex on Windows). A trusted project can have its own .codex/config.toml.

codex exec: Codex in scripts and CI

codex exec (or just codex e) runs a task without the interactive interface, for scripts, scheduled jobs, and CI pipelines. Progress goes to stderr and only the final answer goes to stdout, so you can redirect or pipe the result:

terminal
# Só leitura (o padrão do codex exec): analisa sem alterar nada
codex exec "resuma a estrutura do repositório e aponte os 5 trechos mais arriscados"

# Com permissão para editar a pasta do projeto
codex exec --sandbox workspace-write "corrija o teste que falha em tests/test_pedidos.py e rode o pytest"

# Eventos em JSON Lines para o seu script, sem salvar a sessão em disco
codex exec --json --ephemeral "liste os TODOs do projeto" > eventos.jsonl

# Grava a resposta final num arquivo (ela continua saindo no stdout)
codex exec -o notas-da-versao.md "escreva as notas de versão dos últimos 10 commits"

By default, codex exec runs in a read-only sandbox; grant only the permissions the job needs, and save --sandbox danger-full-access for an isolated environment, such as a CI container. The --full-auto option, which many tutorials still use, no longer exists: replace it with --sandbox workspace-write, or with --approve-for-me, which routes approval requests to automatic review (non-interactive mode). For automation, the documentation recommends an API key instead of ChatGPT sign-in; by default, codex exec also loads your ~/.codex/config.toml and the provider configured in that file.

Outside a Git repository, codex exec refuses to run, to prevent destructive changes. The --skip-git-repo-check option lifts that restriction, but use it only in an environment you know is safe (non-interactive mode). That's why a scheduled job in a folder without Git fails right at the start.

Codex in VS Code, Cursor, and the desktop app

In VS Code, Cursor, Windsurf, and VS Code Insiders, Codex is the openai.chatgpt extension from the marketplace; if the icon doesn't appear, run Codex: Open Codex Sidebar from the Command Palette. Xcode and JetBrains IDEs have their own integrations (extension documentation), and, according to the help center, the extension works in most VS Code forks; in other IDEs, run the CLI in the integrated terminal.

The Codex desktop app is now the ChatGPT app itself, for macOS and Windows (there's a guide for Linux): after signing in, you choose between ChatGPT and Codex (app documentation). The app, the CLI, and the extension use the same config.toml (models). For a Kunavo key, this guide uses the CLI, which runs the same way in the editor's integrated terminal.

ChatGPT plans and Codex usage limits

Prices from the Codex pricing page, in dollars. On chatgpt.com, the subscription can be billed in reais and paid with Pix (Go, Plus, and Pro), but OpenAI warns that the local price may not be a direct conversion of the US price and asks you to check the price and currency at checkout, so this guide doesn't convert the amounts (help center). If you subscribe through the app on iPhone or Android, the App Store or Google Play manages the subscription.

PlanPriceWhat the plan includes for Codex
FreeUS$ 0GPT-6 Luna in the desktop app, subject to a gradual rollout
GoUS$ 8 per monthGPT-6 Luna in the desktop app, subject to a gradual rollout
PlusUS$ 20 per monthCodex on the web, in the CLI, in the extension, and on iOS; automatic code review and Slack integration; more usage by buying ChatGPT credits separately
ProUS$ 100, US$ 200, or US$ 500 per monthEverything in Plus; Ultrafast mode on the US$ 500 Pro plan
BusinessUS$ 20 per user per month on the annual plan (2 or more users); US$ 25 on the monthly planChatGPT and Codex in the desktop and mobile apps; a workspace with admin controls
Enterprise and EduOn requestEverything in Business, with enterprise controls

How much usage fits in a plan? OpenAI estimates how many messages in local sessions (CLI, extension, and desktop app) fit into each five-hour window on Plus (and on standard Business) and warns that these are estimates, not fixed limits: consumption depends on the model and the task, and cloud tasks can use more. According to the same pricing page, GPT-6.2 Sol and GPT-6.2 Astra are available on Plus, in the Codex app and CLI (availability by plan).

ModelLocal messages per 5 hours on Plus
GPT-6.2 Sol17–180
GPT-6.2 Astra6–50
GPT-6.1 Sol15–160
GPT-6.1 Terra35–285
GPT-6 Sol15–150
GPT-6 Astra5–45
GPT-6 Luna350–3,000

Pro currently has no five-hour limit. Weekly limits may also apply (the pricing page doesn't say how large they are), and local messages and cloud conversations share the same quota. When you hit the limit, the request in progress can run to completion, within fair use; after that, on Plus and Pro, you can buy credits without changing plans, and any user can keep working locally with an API key, at API rates. Limits and reset times are on the usage dashboard, and in the CLI, /status shows how much is left. According to the help center, starting a new conversation doesn't reset the quota.

If you spend hours a day in Codex, the plan tends to cost less than paying per token; if you code only now and then, the key usually wins, because an idle month costs nothing. The math, with the break-even point, is in the Codex pricing guide, and what to do when you hit the cap is in Codex usage limits.

Codex with an API key, paying from Brazil without an international card

OpenAI's own API key comes with two obstacles for anyone in Brazil. API credits are sold only in dollars (help center) and require a standard credit or debit card: prepaid cards don't work, and among the reasons for declines, OpenAI cites banks that block online or international purchases and incomplete 3D Secure verification (declined cards). The minimum purchase at OpenAI is US$ 5 (US$ 10 by default), lower than Kunavo's minimum, and the credits expire after one year (prepaid credits).

The other route is a provider compatible with the Responses API, the only format Codex accepts from a custom provider: in config.toml, wire_api = "responses", with the provider accepting POST /v1/responses (gateway compatibility). Endpoints that serve only Chat Completions, and the old wire_api = "chat", don't work in current Codex (models and providers). Kunavo is an independent gateway that serves the Responses API and accepts Pix, charged in reais. The full configuration, with a curl test, is in the Codex CLI with an API key guide. In short: base_url is https://api.kunavo.com/v1, env_key holds the name of the variable that stores your sk-kn- key, never the key itself, and the default model is gpt-5-6-sol.

Use caseModel (ID)Kunavo, input / output per 1M tokensOne task on KunavoThe same task at OpenAI today
Default: day-to-day implementing, fixing, and refactoringgpt-5-6-solUS$ 2.00 / US$ 12.00US$ 1.29US$ 2.48 (promotional price)
A cheaper alternative to the default, from the GPT-6 generationgpt-6-solUS$ 0.80 / US$ 4.00US$ 0.50US$ 1.24
Mechanical tasks: repetitive tests, renaming, formatting, summarizing logsgpt-5-6-terraUS$ 0.70 / US$ 4.20US$ 0.45US$ 1.29
When the other models can't handle it: a bug with no apparent cause, a change across several modulesgpt-6-astraUS$ 4.00 / US$ 20.00US$ 2.48US$ 6.20

“One task” here means 20 steps, each with about 25,000 input tokens (system prompt, history, and files read) and 1,200 output tokens, with no cache: the most expensive scenario. The minimum top-up, US$ 10, covers about 8 of these tasks on GPT-5.6 Sol. To switch models for a single run, use codex -m gpt-6-sol, with the ID written with hyphens; config.toml stays the same. To simulate with your own numbers, use the cost calculator; the rates for every model are on the pricing page, and the default model's page is at GPT-5.6 Sol.

The OpenAI column uses the prices from the OpenAI API pricing page, read on November 21, 2026. For GPT-5.6 Sol, it's the promotional price OpenAI charges today, until November 30, 2026: US$ 4.00 for input and US$ 20.00 for output per 1M tokens, versus US$ 5.00 and US$ 30.00 before the promotion (API changelog). At the pre-promotion price, the same task would cost US$ 3.22 at OpenAI.

Two honest caveats. Kunavo's Codex documentation verified the configuration with GPT-5.6 Sol on September 6, 2026; the other three models use the same Responses endpoint but weren't part of that verification, so if one of those models misbehaves, go back to the default. And the newest models OpenAI recommends for Codex today, such as GPT-6.2 Sol (model selection), aren't on Kunavo: no GPT-6.1 or GPT-6.2 model is for sale in the catalog.

The table ignores the cache on purpose. Because Codex resends the history at every step, much of the input can be read from the cache, and on these four models a cache read costs 0.10× the input price (US$ 0.20 per 1M tokens on GPT-5.6 Sol); input written to the cache for the first time costs 1.25× the input price. With 20,000 of each step's 25,000 input tokens read from the cache and the rest written to it, the task on GPT-5.6 Sol drops to about US$ 0.62, the same calculation as in the Codex pricing guide. If the prompt of a single request exceeds 272,000 tokens, the entire request is billed at 2× the input price and 1.5× the output price: prefer short sessions, one per task. The cost of each call shows up in Usage.

And what Kunavo doesn't offer: a dedicated quota and an SLA. Capacity is shared; if you need a contractual guarantee, the way to get one is to contract directly with OpenAI. In return, there's no monthly fee, the balance doesn't expire, and failed calls aren't charged (Billing).

When something goes wrong

SymptomCause and solution
Codex ignores the model or model_provider setting in the fileIn TOML, top-level keys must come before the first table, such as [model_providers.kunavo].
401 or missing-key error with your Kunavo keyThe key isn't getting through: check that the variable named in env_key exists in the terminal that launched Codex (echo $KUNAVO_API_KEY on macOS and Linux; echo $env:KUNAVO_API_KEY in PowerShell) and that env_key contains the variable's name, not the key.
404 on just one modelThe ID has a dot (gpt-5.6-sol); on Kunavo, IDs use hyphens (gpt-5-6-sol).
404 on every requestbase_url must end in /v1; Codex appends /responses on its own.
402The balance has run out, or the key or the key's group has reached the monthly spend limit set for it: top up in Billing or adjust the limit in API Keys (API errors).
403The key's IP allowlist doesn't include the address you're calling from.

Paying from Brazil with Pix

The step-by-step guide to paying with Pix is in how to pay with Pix, and the same balance works for GPT models through the API (OpenAI API with Pix). That balance pays for API calls: it doesn't turn into a ChatGPT subscription or into credit on OpenAI's platform.

Kunavo is prepaid: any of the methods below tops up the same API balance.

  • From anywhere: USDT on TRON (TRC-20), Ethereum (ERC-20) or BNB Chain (BEP-20), or USDC on Base, Ethereum (ERC-20) or BNB Chain (BEP-20), sent to the address and for the exact amount the top-up page gives you.
  • In local currency: Alipay (mainland China), AlipayHK (Hong Kong), Pix (Brazil), GCash (Philippines), Touch 'n Go eWallet / Boost (Malaysia), PayNow (Singapore) and K PLUS / LINE Pay (Thailand); the top-up page shows the amount in that currency before you pay.
  • Card payments are being enabled and cannot be used yet.

To get started: create an account, top up in Billing, and create the key in API Keys. The full key is shown only once, so save it in an environment variable before closing the window.

Frequently asked questions

How do I use Codex?

Install the CLI (on macOS and Linux, curl -fsSL https://chatgpt.com/codex/install.sh | sh; on Windows, the PowerShell installer; npm also works, and so does Homebrew, on macOS and Linux), go to your project folder, run codex, and sign in with ChatGPT or with an API key. Then make your requests in Portuguese, referencing the files. /init creates a draft AGENTS.md for you to complete with the project's rules; /diff shows what changed, and /review asks Codex for a review. Commit before and after each task so you can roll back.

Is Codex free?

Partly. The CLI is free and open source (Apache-2.0), and OpenAI's help center says Codex comes with every ChatGPT plan, including Free and Go; but for those two plans, the Codex pricing page lists only GPT-6 Luna in the desktop app, subject to a gradual rollout, and shows the CLI and the extension starting with Plus, at US$ 20 per month. Outside a plan's quota, each request is billed per token on an API key: through Kunavo, a 20-step task on GPT-5.6 Sol costs about US$ 1.29, not counting caching.

How do I install Codex on Windows?

Open a new PowerShell window and run powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"; to update, run the same command. Codex runs natively on Windows, with a Windows-specific sandbox, without needing WSL. If you prefer to work in Linux, WSL2 is still an option (install Codex inside WSL2 with the macOS and Linux command); WSL1 has not been supported since Codex 0.115.

Can I use Codex without a ChatGPT subscription?

Yes. OpenAI's help center says the ChatGPT Free plan includes Codex, but the pricing page lists only GPT-6 Luna in the desktop app for the Free plan, subject to a gradual rollout. The other way is an API key billed per token: an OpenAI key works in the CLI, the extension, and the desktop app, but not in Codex cloud (web tasks, code review, Slack), and OpenAI's API credits are sold only in dollars and require a standard credit or debit card. With Kunavo, the route that Kunavo's documentation has verified is the CLI: you declare the provider in ~/.codex/config.toml and top up a prepaid balance, including with Pix, with no monthly fee.

What is AGENTS.md, and how do I create one?

It's a Markdown instructions file that Codex reads before doing any work: test and lint commands, folders that must not be changed, conventions, and what counts as done. /init generates a draft in the current folder, which you review and put under version control. Codex combines the global ~/.codex/AGENTS.md with the project's AGENTS.md files, from the root down to the current folder (files closer to the current folder take precedence), up to 32 KiB by default. OpenAI recommends a short, precise file.

Can I pay for Codex with Pix?

For a ChatGPT plan, yes: Go, Plus, and Pro subscriptions bought on chatgpt.com accept Pix. For OpenAI's API credits, no: they're sold only in dollars and require a standard credit or debit card. With an API key through Kunavo, yes: with Pix, in reais, you top up the prepaid balance that pays for Codex's calls.

From anywhere: USDT on TRON (TRC-20), Ethereum (ERC-20) or BNB Chain (BEP-20), or USDC on Base, Ethereum (ERC-20) or BNB Chain (BEP-20), sent to the address and for the exact amount the top-up page gives you. In local currency: Alipay (mainland China), AlipayHK (Hong Kong), Pix (Brazil), GCash (Philippines), Touch 'n Go eWallet / Boost (Malaysia), PayNow (Singapore) and K PLUS / LINE Pay (Thailand); the top-up page shows the amount in that currency before you pay. No other wallet or bank transfer is offered. Card payments are being enabled and cannot be used yet.

Which model should I use in Codex with an API key?

With an OpenAI key, you can use the models available to your API organization, and OpenAI recommends starting with GPT-6.2 Sol. Kunavo doesn't offer any GPT-6.1 or GPT-6.2 model; on Kunavo, the default is gpt-5-6-sol (US$ 2.00 for input and US$ 12.00 for output per 1M tokens), the model in the setup that Kunavo's documentation verified on September 6, 2026. gpt-6-sol costs less per task, gpt-5-6-terra is for mechanical tasks, and gpt-6-astra is for the hardest work, but those three models weren't part of that verification: if one of those models misbehaves in Codex, switch back to gpt-5-6-sol. To switch models for a single run, use codex -m with the hyphenated ID.

Does Codex work in VS Code?

Yes: in VS Code, Cursor, Windsurf, and VS Code Insiders, Codex is the openai.chatgpt extension (if the icon doesn't appear, run “Codex: Open Codex Sidebar” from the Command Palette). According to OpenAI's help center, the extension works in most VS Code forks; in other IDEs, run the CLI in the integrated terminal. Xcode and JetBrains have their own integrations, and the CLI and the extension use the same saved login.