For everyday work in Codex, keep GPT-6.1 Sol as the default, switch on Astra for heavy sessions, and hand GPT-6 Luna the mechanical edits and bulk operations. The model is set by the model line in config.toml, the --model flag or the /model command. What follows, in order: a table of models, profiles, reasoning levels, and a token estimate at codexkey prices as of October 29, 2026.
What the Codex agent is and why the model matters
Codex is OpenAI's coding agent: it reads a repository, edits files and runs commands in a sandbox. Per the Codex documentation, in a folder under Git it starts in Auto mode, meaning it can write inside the working folder and asks for confirmation for anything outside it. Outside Git the default is read-only. The network is off in the standard mode. The agent takes project rules from AGENTS.md.
Output quality and your bill depend on the model more than on the client, so the question "which Codex" really means "which model". A search for "codex 6" is about a model too. The CLI itself is numbered 0.x, and, for example, GPT-6.1 Terra needs version 0.159.0 or newer. The six in the query refers to GPT-6.
Which models Codex offers
On its models page OpenAI recommends four. The limit estimates come from the Codex pricing page, and API prices from the OpenAI pricing page.
| Model | How OpenAI describes it | Estimated messages per 5 hours, Plus | OpenAI API, input / output per 1M |
|---|---|---|---|
gpt-6-astra | the most powerful, for hard work on code, apps and research | 5-45 | $10 / $50 |
gpt-6.1-sol | close to Astra, suited to long repetitive work | 15-160 | $2 / $10 |
gpt-6.1-terra | fast and economical, text, images, computer use | 35-285 | $1 / $5 |
gpt-6-luna | the most economical, narrow bulk tasks | 350-3000 | $0.10 / $0.50 |
There is also gpt-6-sol (15-150): in the API OpenAI calls GPT-6.1 Sol the newer Sol model. The limits in the table are estimates, and actual usage depends on context length, reasoning and tool calls.
What codexkey has
As of October 29, 2026 the catalog has no GPT-6.1 Terra, but the previous generation, GPT-5.6, is still there. Prices per 1M tokens:
| ID | Input | Output | Cache read |
|---|---|---|---|
gpt-6-astra | $0.68 | $3.3 | $0.08 |
gpt-6.1-sol | $0.28 | $1.42 | $0.02 |
gpt-6-sol | $0.14 | $0.68 | $0.02 |
gpt-6-luna | $0.04 | $0.22 | $0.04 |
gpt-5.6-sol | $0.24 | $1.16 | $0.04 |
gpt-5.6-terra | $0.14 | $0.68 | $0.02 |
gpt-5.6-luna | $0.06 | $0.34 | $0.02 |
This is the codexkey price list as of October 29, 2026; see the models page for current prices. GPT-5.6 is in the catalog for comparing against past runs and for projects tied to that generation's behavior. A new project should start with GPT-6.
Here is how we would combine them. Main model: gpt-6.1-sol. If a task has hit its ceiling twice in a row, use gpt-6-astra for one session. For boilerplate edits, renames and generation from a template, gpt-6-luna fits. More on Astra is in What is GPT-6 Astra, and the overview of the whole line is in GPT-6 and GPT-5.6 for the API.
How to choose and switch the model in Codex
There are four ways, from permanent to one-off:
| Way | What it does |
|---|---|
model = "gpt-6.1-sol" in config.toml | sets the default model |
codex --model gpt-6.1-sol or -m | model for a single run |
/model in a session | changes the model and reasoning level on the fly |
codex exec -m gpt-6-luna "..." | model for a non-interactive run |
The desktop app has Power, Smarter and Faster presets, and you pick a specific model under Advanced. Through codexkey the model value goes into the request unchanged, so the ID must match the catalog. Provider setup (base_url, wire_api = "responses") is covered in the Codex guide.
Profiles in Codex: Astra, Sol and Luna in one command
Older guides, including the setup page in the codexkey documentation, describe profiles as a [profiles.astra] table inside config.toml. As of Codex 0.134.0 that no longer works: the --profile flag does not read [profiles.*] tables from config.toml, and a top-level profile = "..." key is not supported. A profile is now a separate file, ~/.codex/<name>.config.toml. Codex loads config.toml first and then layers the profile on top (advanced configuration). The provider from the main file stays in force, so the profile only needs the differences.
File ~/.codex/astra.config.toml:
model = "gpt-6-astra"
model_reasoning_effort = "high"
File ~/.codex/luna.config.toml:
model = "gpt-6-luna"
model_reasoning_effort = "low"
Launch:
codex --profile astra
codex exec --profile luna "add a copyright header to every file in src"
A profile name can contain letters, digits, hyphens and underscores. If you upgraded Codex and your profiles from config.toml stopped working, move each one into its own file.
Reasoning effort: how long the model should think
The model_reasoning_effort parameter sets how deep the reasoning goes. The accepted values depend on the model and the client; OpenAI names low, medium, high, xhigh, max and ultra. The lowest level is called Light in the app and the IDE, and Low in the CLI. Ultra spreads work across subagents, and most tasks need neither Max nor Ultra.
| Level | When to use |
|---|---|
low | pinpoint edits with a clear result |
medium | typical development, a balance of speed and depth |
high, xhigh | hard multi-step debugging |
max | one difficult task that needs more time to think |
The higher the level, the longer the reasoning chain and the more output tokens. Check whether a given model supports a level with a test request: the list depends on the client version.
Codex tokens: budgeting a month
A token is a piece of text, usually shorter than a word. The bill has three parts. Input tokens: your prompt, files, conversation history and tool output; an agent generally passes the accumulated history to the model at every step. Cached input: a repeated prefix is read at a lower price, and the codexkey catalog has a separate column for it. Output tokens: the model's answer, edits and reasoning.
You can see usage in a session with the /status command: it shows the active model, the approval policy and the current token count.
The formula for one task: fresh input × input price + cached input × cache-read price + output × output price, all divided by a million. Now an example on assumptions we chose ourselves and did not measure on real agents. A task takes 60,000 new input tokens, 240,000 tokens from cache and 30,000 output tokens, with 200 tasks a month (ten per workday). The price of writing to cache is not counted.
| Model | One task | 200 tasks a month |
|---|---|---|
gpt-6-astra | $0.159 | $31.8 |
gpt-6.1-sol | $0.064 | $12.8 |
gpt-5.6-sol | $0.059 | $11.8 |
gpt-6-sol | $0.034 | $6.7 |
gpt-6-luna | $0.019 | $3.7 |
A mixed plan: 40 tasks on Astra, 100 on GPT-6.1 Sol and 60 on Luna give 40 × 0.159 + 100 × 0.0642 + 60 × 0.0186 = $13.9, about 44 percent of the "everything on Astra" bill. Caching matters for the total as well. If you count all of Astra's input without cache, a task costs $0.303, and the month comes to $60.6.
The cheap model comes with a caveat. If Luna makes three attempts on your task instead of one, the saving is gone. Count the price of a solved task: take ten closed tickets, run them on two models, and compare passing tests and total tokens. We covered subscription limits and window resets separately in Codex limits.
Codex API: key, exec and automation
People who search for "codex api" usually mean one of three things. First: signing in with an API key instead of ChatGPT, described in Codex CLI with an API key. Second: the non-interactive codex exec in scripts and CI. According to the documentation it runs read-only by default, edits need --sandbox workspace-write, and you can get the result as a JSON stream with --json. Third: calling the model directly from your own code, as in the OpenAI-compatible API reference.
codex exec --sandbox workspace-write --profile astra "find why the payments_spec test fails and fix it"
In CI, set the key for a single command rather than for the whole pipeline job, so that third-party scripts in the step cannot read it. OpenAI's documentation names the CODEX_API_KEY variable for this, and with the codexkey provider use the one named in env_key. Installing Codex on a PC is covered in Download Codex: desktop app, CLI and VS Code. To choose between Codex and Claude Code, see the comparison Claude Code or Codex.
FAQ
Which model should I choose in Codex?
For everyday work start with GPT-6.1 Sol: OpenAI describes it as close to Astra, and in the codexkey catalog it is about 2.3-2.4 times cheaper than Astra. Turn on Astra for hard sessions and Luna for bulk mechanical edits. Check the choice on your own tasks.
How do I switch the model in Codex?
In a session with the /model command, at launch with the flag codex --model gpt-6.1-sol, and as a default with the model line in config.toml. For a non-interactive run use codex exec -m. In the app you pick the model under Advanced below the input box.
How do I turn on Astra in Codex?
Set model = "gpt-6-astra" in the config or run codex --model gpt-6-astra. It is more convenient to move it into a profile: the file ~/.codex/astra.config.toml and the launch codex --profile astra. On a ChatGPT subscription Astra is available from the Plus plan, with a hard message cap per five-hour window.
What are Codex 6 and GPT-6 Codex?
There is no separate "Codex 6" version. These are the GPT-6 models (Astra, Sol, Luna) running inside Codex. The Codex CLI itself is numbered 0.x, and support for individual models is tied to the client version.
How are tokens counted in Codex?
Input tokens (prompt, files, history, tool output) add up with cached input at a reduced price and output tokens including reasoning. The sum is multiplied by the model's price per million. The current usage in a session is shown by /status.
How much does Codex cost per month by tokens?
It depends on the model and the load. Under our assumptions (200 tasks of 330,000 tokens each, 240,000 of them from cache) and codexkey prices as of October 29, 2026: about $3.7 on Luna, $12.8 on GPT-6.1 Sol and $31.8 on Astra. Work out the real bill on your own repository.