A practical guide to choosing the right Codex model, controlling reasoning, managing your usage, and getting more development work done without wasting your allowance.
Codex can do an enormous amount of programming work. You can give it an application idea, ask it to build the foundation, add features, investigate bugs, and eventually help you get the finished software ready for release.
But the amount of usage you consume along the way can vary considerably.
A simple change might use very little of your allowance. A complicated task involving dozens of files, repeated testing, and several rounds of investigation can consume substantially more.
There's also a temptation to choose the most powerful model and leave the reasoning level turned up throughout development. That can be worthwhile for difficult problems, but it isn't necessarily the most efficient way to complete an entire project.
This guide will help you choose the right model and reasoning level, understand where your usage goes, and organize your development sessions so Codex can concentrate on the work that matters.
We'll focus on Codex as a coding agent, whether you're building your first application or working on a larger, established project.
First, understand what you're actually paying for
Before trying to save tokens, it's useful to understand how Codex measures usage.
If you're signed in with your ChatGPT account, your subscription provides an included amount of Codex usage. The amount available depends on your plan, and larger tasks generally consume more of your allowance than small ones.
Usage also depends on your model, reasoning settings, context, and the tools Codex uses. That means two requests that look similar can consume very different amounts.
Depending on your plan, Codex also shares an agentic usage allowance with supported products such as ChatGPT Work. These limits are different from some of ChatGPT's ordinary conversation limits.
If you reach your included allowance, you may be able to purchase additional usage credits, depending on your plan and account.
If you're using Codex with your own API key, the situation is different. You're paying according to API pricing rather than drawing from your ChatGPT subscription's included Codex allowance.
Then there's the context window. This is the amount of information the model can work with at once, including your instructions, conversation history, files, and command outputs.
A long conversation can accumulate an enormous amount of context even if the individual tasks were fairly simple.
These distinctions matter because they affect how you save money. Subscription users generally want to make their allowance last longer. API users also need to consider actual token prices, while everyone benefits from avoiding unnecessary work.
OpenAI explains the different arrangements in its Codex pricing and usage documentation.
Know the Codex model ladder
Codex gives you several models to choose from. The strongest model isn't necessarily the right choice for every programming task, and the cheapest model isn't necessarily the most economical way to complete difficult work.
The current general-purpose lineup includes four main options.
| Model | Where it fits | Good starting point for |
|---|---|---|
| GPT-5.6 Luna | Fast and economical | Small fixes and predictable changes |
| GPT-5.6 Terra | Balanced capability and cost | Ordinary features and everyday programming |
| GPT-5.6 Sol | Higher-capability work | Substantial features, application foundations, and interconnected systems |
| GPT-6 Astra | Most demanding work | Difficult bugs, unusual architecture, and complex development |
These are practical recommendations rather than universal performance rankings. OpenAI documents the models and their capabilities in its official model overview. Available models also depend on your plan and Codex configuration.
Luna deserves particular attention.
If you're changing text, adjusting CSS, repositioning controls, or modifying a small piece of existing functionality, Luna may be entirely sufficient.
Terra is a useful option for normal development. Adding forms, working with an existing database, implementing familiar features, or extending a reasonably well-structured application are good reasons to consider it.
Sol becomes more attractive when several parts of the application need to work together or when important decisions will affect future development.
Astra is intended for especially demanding problems. Difficult architecture, unfamiliar integrations, complicated debugging, and substantial development tasks are the kinds of work where its additional capability may be useful.
You can change models using the model selector in Codex or the /model command in the CLI. The models available will depend on your account and configuration.
The important thing is to recognize that a project doesn't have the same requirements from beginning to end. You might use Sol to establish an application's foundations, Terra to implement ordinary features, Luna for small improvements, and Astra when you encounter a particularly difficult problem.
The Codex Task Scale
One way to make model selection easier is to classify the task before you start.
The following scale divides programming work into eight broad levels. It's a practical guide we've developed for this article, not an official OpenAI classification.
| Level | Type of work | Starting model | Reasoning |
|---|---|---|---|
| 0 | Mechanical edits | Luna | Low |
| 1 | Small isolated tasks | Luna | Low |
| 2 | Routine implementation | Terra | Medium |
| 3 | Significant features | Terra / Sol | Medium / High |
| 4 | Complex subsystems | Sol | High |
| 5 | App foundations and major structural work | Sol | High / XHigh |
| 6 | Difficult architecture or unfamiliar problems | Sol / Astra | High / XHigh |
| 7 | Exceptionally demanding problems | Astra | XHigh / Max |
These are starting points. Available reasoning levels depend on the model and your Codex setup. The table is intended to help you choose an appropriate configuration, not to establish that any model will always perform better on a given task.
Imagine you're building a personal finance application.
You've already created the database, established how transactions are stored, and implemented several screens. Now you want to add a page where users can filter transactions by month.
That's fairly ordinary implementation work. Terra with Medium reasoning would be a reasonable starting point, particularly if the application already has similar features that Codex can follow.
Now imagine you're building the same application from scratch.
You need to decide how accounts and transactions are represented, how balances are calculated, how recurring transactions work, and what happens when a user edits historical information.
These are foundational decisions. Several future features will depend on them, so Sol with higher reasoning becomes more attractive.
Later, you might encounter a strange bug where transaction balances occasionally become incorrect after two operations happen almost simultaneously.
That problem could justify Astra even if the relevant code is relatively small.
The task determines the model. The number of lines of code doesn't.
Big jobs aren't always difficult jobs
It's easy to associate large amounts of code with difficult programming.
Suppose you need Codex to update 80 files because you're changing an old naming convention throughout an application.
The number of affected files sounds intimidating, but the actual task might be predictable. Find the relevant occurrences, make the replacements, and verify that nothing was missed.
Terra may be entirely capable of handling this. If the replacement is completely mechanical, a conventional search-and-replace tool may be more appropriate than asking an AI model to perform every individual edit.
Now consider something considerably smaller.
Your application occasionally displays the wrong value when two background operations finish in an unexpected order. The relevant code might be only 40 lines long.
Codex needs to investigate how the operations interact, identify the actual cause, and develop a correction that doesn't introduce another problem.
That's a much more demanding job, despite involving very little code.
This distinction is particularly useful when working on larger projects. Once the main architecture is established, you may have thousands of lines of straightforward implementation ahead of you.
There's no reason to assume that every additional feature requires the same model and reasoning level you used to build the foundations.
Four questions that help you choose the model
You don't need to memorize the entire task scale. Before starting, consider four things about the job in front of you.
How much of the project does this affect? Changing a single button is different from replacing a navigation system used throughout the entire application.
Is this a familiar programming task? Building a normal contact form is well-understood work. Integrating an unfamiliar hardware device might require considerably more investigation.
Will other features depend on this decision? If you're establishing how an application handles authentication, payments, stored data, or other important systems, getting the structure right now can make future development much easier.
What happens if Codex gets it wrong? A styling mistake is usually simple to correct. A poorly designed database migration or purchase system can create substantially more work.
If the task is small, familiar, and easy to reverse, Luna or Terra is a sensible place to begin.
When you're creating important features that affect several parts of the project, consider Sol.
For unusually difficult problems that involve substantial uncertainty or investigation, Astra becomes another option.
The question about future dependencies deserves particular attention. A seemingly small architectural decision made at the beginning of a project can influence how dozens of later features are implemented.
Spend your reasoning allowance where those decisions are being made.
The three-option strategy
You don't have to predict the difficulty of every programming task perfectly.
A more practical approach is to think in terms of three choices: Recommended, Economy, and Escalate.
Suppose you're adding a search feature to an existing application. It needs to search a database, display results, and support several filters.
Recommended: Sol with Medium reasoning. This is a reasonable starting point when the feature involves several components and you want Codex to handle the implementation without requiring you to specify every detail.
Economy: Terra with Medium reasoning. If the database is already established, similar search functionality exists elsewhere in the application, and the requirements are clear, Terra may be sufficient.
Escalate: Sol with High reasoning or Astra. Perhaps the feature turns out to require complicated indexing, unusual permission rules, or changes to how information is stored throughout the application. The job has become more demanding than originally expected.
This strategy helps you avoid spending premium-model usage unnecessarily while giving you a clear reason to increase capability when the work becomes more complicated.
There's no need to switch models after every small instruction. Choose a sensible model for the current stage and reconsider when the task changes significantly.
Reasoning level matters too
Model selection is only part of the equation.
Codex also lets you adjust how much reasoning the model uses. In the CLI, you can select a model with /model and adjust reasoning with /reasoning, when the relevant controls are available.
OpenAI explains these commands in its Codex CLI command reference.
The guiding principle is straightforward: use more reasoning when the task requires difficult decisions and less when the work is already clearly defined.
Suppose you want to add a settings button that opens an existing screen. The functionality is already implemented, and the task involves connecting the new button to it.
Luna with Low reasoning would be a sensible starting point.
Now suppose you're developing a new authentication system that needs to manage account registration, password recovery, persistent sessions, and secure access to user information.
That deserves substantially more attention.
Higher reasoning can help with difficult tasks, but it can also consume more usage. Starting every job at the maximum setting isn't necessarily going to produce a meaningful improvement.
One habit worth developing is checking your selected model and reasoning level when beginning a new development session.
The settings you used for a difficult architectural problem may still be active when you return to adjust a few buttons.
There's little reason to carry the same level of reasoning expenditure into every subsequent task.
The cheapest model isn't always the cheapest way to finish
This is an important distinction that gets overlooked when people compare AI model prices.
Imagine you're implementing a complex feature with Terra because it costs less per token than Sol.
Terra struggles with the architecture, makes several incorrect assumptions, and produces an implementation that needs substantial revision. You spend additional requests explaining the problems and eventually switch to Sol to rebuild the feature.
You may have consumed more usage than you would have by starting with Sol.
The same applies to Astra. Its higher per-token price doesn't automatically mean it will be more expensive to finish a difficult task.
OpenAI reports that Astra achieved lower estimated API costs per task than some earlier models in certain evaluations, despite its higher per-token pricing. This doesn't establish that Astra is cheaper for every coding problem, but it demonstrates why per-token price alone is an incomplete measure of efficiency.
You can find the underlying discussion in OpenAI's model guidance.
A small, predictable task is unlikely to benefit enough from an expensive model to justify the additional usage.
A genuinely difficult problem may be a different story.
Consider the entire job: investigation, implementation, corrections, verification, and any work that needs to be redone.
Sometimes spending more at the beginning is precisely how you avoid spending more later.
Your conversation history can become expensive
Model choice isn't the only thing affecting usage.
Codex carries conversation context as you work. Your previous instructions, the files it has examined, command outputs, and earlier decisions can all contribute to the amount of information it processes.
Imagine you've spent several hours building an application.
Codex has examined the navigation system, investigated a database problem, installed a dependency, run tests, and modified numerous files.
You then decide to change the spacing between two buttons.
The task is small, but your conversation has accumulated a substantial amount of unrelated information.
Codex provides several commands that help manage this.
Use /compact when the conversation gets too large
The /compact command summarizes the current conversation, retaining important information while reducing the amount of context carried forward.
It's particularly useful when you're halfway through implementing a large feature and don't want to lose the decisions already made.
You can compact after reaching a natural milestone, such as completing the application's main architecture and moving into the next development stage.
Compaction isn't free, and summaries can lose details. There's no need to use it after every few messages.
Start a fresh conversation for unrelated work
If you've completed the authentication system and are moving on to something unrelated, a fresh conversation may be more useful than continuing the existing one indefinitely.
In the Codex CLI, /new starts a fresh chat without leaving the session. /clear also starts a fresh chat while clearing the terminal view.
Your project files and persistent project instructions remain available.
Just make sure important decisions have been written into the project documentation rather than existing exclusively in a conversation you're about to leave.
The principle is simple. Continue a conversation while its history is useful. Start a new one when that history has become unnecessary baggage.
Stop making Codex rediscover your project
Here's another common source of wasted usage.
You want Codex to modify a particular screen, and you already know which file contains it.
Instead of identifying the file, you ask Codex to inspect the application and find the relevant code.
Codex may search through directories, examine several files, and read unrelated components before finding the screen you wanted.
Sometimes that investigation is necessary. Finding the correct files is part of what makes a coding agent useful.
But if you already know where the feature lives, point Codex in the right direction.
For example, tell it that the change belongs in src/components/Navigation.tsx and that it should reuse the existing button styles.
You can also reference files directly in the CLI using @ or its file-selection commands.
This gives Codex a clear starting point and reduces the chances of unnecessary investigation.
However, avoid restricting its exploration so severely that it can't identify an important dependency.
If changing a component requires inspecting another file, let Codex do so.
The goal is to eliminate unnecessary searching without preventing the investigation needed to complete the task correctly.
Keep AGENTS.md useful, not enormous
For larger projects, AGENTS.md can make a substantial difference to how Codex works.
It's a file containing persistent instructions that Codex reads when starting work. You can use it to explain the project's structure, establish coding conventions, identify important documentation, and define how changes should be verified.
You might tell Codex to reuse the existing styling system instead of introducing a new component library, or to follow an established pattern when implementing new screens.
These instructions save you from explaining the same requirements in every conversation.
But there's a drawback to making the file unnecessarily large.
Codex loads project guidance into its context. Lengthy instructions that aren't relevant to the current task still consume space, and contradictory or outdated instructions can create confusion.
OpenAI's AGENTS.md documentation explains how Codex discovers instructions and how more specialized guidance can be organized into files closer to the relevant code.
Keep the main file focused on rules that genuinely apply throughout the project.
Detailed instructions for a particular subsystem can live in separate documents or appropriately placed instruction files.
A useful distinction is to put stable project rules in AGENTS.md and explain temporary task requirements in your current prompt.
For example, the rule that your application uses a particular styling system belongs in project guidance.
The instruction to move a button 20 pixels downward belongs in the current task.
There's no need to make every temporary design decision a permanent rule.
Stop Codex from doing unnecessary work
Codex can inspect files, run commands, modify code, test changes, and investigate problems on its own.
That autonomy is useful, particularly when you're building substantial features.
But it can also lead to unnecessary work if the instructions are vague or the scope isn't clear.
Suppose you ask Codex to fix a minor spacing problem on a settings screen.
It changes the CSS, examines several other screens, runs the complete test suite, performs a broader review, and proposes changes to the styling architecture.
The original task may have required only a small CSS adjustment and a quick visual check.
For straightforward, isolated changes, tell Codex to keep the edit targeted and verify the relevant behavior without unnecessarily rebuilding or retesting the entire application.
For important structural changes, authentication systems, payments, or database modifications, more extensive verification is appropriate.
OpenAI's model guidance discusses calibrating testing to the scope of coding changes rather than repeatedly running broad tests when a small edit doesn't warrant them.
The same applies to unnecessary refactoring.
If you ask Codex to fix one button, you probably don't want it reorganizing the entire UI system unless the existing structure is genuinely causing the problem.
A clear scope helps prevent this.
It also makes the results easier to review because you can see exactly what Codex changed and why.
Planning might be one of the biggest token savers of all
Imagine you're about to build a mobile application.
You have a good idea of what you want, but several important decisions are unresolved.
How many screens should the app contain? What information needs to be saved? Will it require user accounts? How will navigation work? What features should be included in the first version?
You could ask Codex to begin building immediately and make those decisions along the way.
But if you subsequently change your mind about how the application should work, you may need to rebuild substantial portions of the implementation.
A more efficient approach is to establish the important requirements first.
For larger projects, doing the initial planning in ChatGPT can be useful. You can discuss the application, compare implementation approaches, and develop a reasonably complete specification before handing it over to Codex.
That doesn't mean planning in ChatGPT is entirely free or that it always uses a separate allowance. Usage depends on the product and plan you're using.
The potential saving comes from reducing unnecessary implementation and rework.
When to plan directly inside Codex
If you're working on an existing project, Codex may be better positioned to develop the implementation plan because it can examine the actual code.
Suppose you want to add offline functionality to an application that already has a database, network requests, and several interconnected screens.
Codex needs to understand how those systems currently work before recommending an implementation.
Its Plan Mode is designed for this kind of task. In the CLI, you can enter it using /plan, allowing Codex to investigate and propose a plan before making changes.
The distinction is useful.
ChatGPT is a natural place to explore what you want to build and settle product requirements. Codex is useful for investigating how those requirements fit into an existing codebase.
You can use either tool for both activities, but choose the workflow that gives the model the information it actually needs.
And don't spend an hour planning a two-minute change.
Planning should remove uncertainty and prevent wasted implementation. If the task is already straightforward, get on with it.
More agents don't automatically mean better value
Codex supports more ambitious workflows involving parallel tasks and delegated work.
That can be useful when separate pieces of a project can genuinely be completed independently.
For example, one agent might investigate an unfamiliar API while another examines an existing application's architecture.
But parallel work isn't inherently cheaper.
Additional agents may need their own context, make overlapping investigations, or produce changes that require reconciliation.
If two agents both need to understand the same complicated subsystem, splitting the task may duplicate work rather than reduce it.
For a relatively small feature, a single focused Codex session may be sufficient.
Parallel development becomes more attractive when the tasks are genuinely independent and the benefit of completing them simultaneously outweighs the additional usage and coordination.
The same principle applies to repeatedly launching new investigations into a problem that hasn't been clearly defined.
Before sending more agents into the project, establish what question you're trying to answer and whether the work can be divided cleanly.
Check your usage before upgrading
If you're regularly exhausting your Codex allowance, investigate where it's going before assuming you need a more expensive plan.
The Codex CLI provides /status for inspecting the active model, context usage, and rate-limit information. The /usage command can also display account token activity when supported by your authentication setup.
You can also review your usage through the account dashboard.
Consider how you've been working.
Perhaps you've left Astra selected for ordinary development. Maybe you're using High or Max reasoning for every small change, running numerous parallel sessions, or carrying one conversation through an entire project without managing its context.
You might also have optional usage credits enabled, allowing additional spending after your included allowance is exhausted.
Checking these things will give you a clearer idea of whether the problem is your subscription allowance or how you're using it.
Sometimes switching to more economical models for ordinary work and managing your conversations more carefully will be sufficient.
Other times, if you're completing substantial productive work every day, a larger allowance may genuinely make sense.
The important thing is to understand what you're purchasing and what you're getting from it.
When saving tokens becomes expensive
There's a trap on the other side of all this.
Suppose you're implementing an important feature and choose Luna because you want to conserve usage.
It struggles with the problem. You explain the requirements again, ask it to correct several mistakes, and eventually switch to Terra or Sol to repair the implementation.
You haven't necessarily saved anything.
The same problem can occur when you use low reasoning for work that needs careful investigation. A complicated problem may require several unsuccessful attempts when a more appropriate model and reasoning setting could have handled it more effectively from the beginning.
Don't keep trying the same approach indefinitely just because it's cheaper per request.
If Codex repeatedly misunderstands a task, first check whether your instructions and relevant project context are clear. If they are, consider moving to a more capable model or increasing the reasoning level.
For a long session filled with failed attempts, starting a fresh conversation with a clearer description of the problem may also help.
The real objective isn't to minimize the number of tokens used.
It's to get the result you wanted without spending more than necessary.
A practical Codex workflow
A sensible development workflow begins with a reasonably clear idea of what you're building.
For a larger application, settle the important requirements and architectural decisions before beginning substantial implementation. Use Sol with higher reasoning when several systems need to work together or future features will depend on the choices you're making.
Once the foundation is established, Terra can handle much of the ordinary implementation. Luna becomes useful for small, predictable changes, particularly during polishing.
When you encounter a genuinely difficult problem, bring in Sol with higher reasoning or Astra rather than repeatedly asking a cheaper model to attempt something it cannot handle reliably.
Keep your AGENTS.md instructions concise, direct Codex toward relevant files when you know where they are, and use fresh conversations when moving between unrelated tasks.
Make verification proportional to the changes you've made. An application-wide architectural change deserves more attention than adjusting the spacing on a button.
Most importantly, judge your efficiency by how much useful work you complete.
Saving tokens is worthwhile when it allows you to continue building, avoid unnecessary spending, and complete more projects with the resources available.
It becomes counterproductive when you're spending so much effort conserving usage that you're preventing Codex from doing the job properly.
Spend more reasoning where decisions matter. Save usage where the work is straightforward.
The result should be a development process where you spend less time managing the agent and more time getting your software finished.
Related reading
If you're also working with Anthropic's coding agent, read our guide to saving money and tokens in Claude Code. It covers Claude's model selection, reasoning effort, context management, and practical ways to make its usage allowance last longer.
