Opviera AI
Cost control

Which Codex Model Is Cheapest? Comparing Costs for Everyday Coding Tasks

The cheapest coding model is easy to identify on a price list. The cheapest way to complete a coding task takes more investigation.

A model that handles documentation or a small edit efficiently may struggle with a defect spread across several files. Repeated attempts, longer conversations, and additional review can change the economics.

If you are searching for the cheapest Codex model, compare both the published rates and the cost of producing a change your team can accept.

This guide compares current recommended OpenAI models used in Codex, explains their billing differences, and shows how to evaluate everyday coding costs.

Which Codex model is cheapest?

GPT-6 Luna is the lowest-priced option among the current recommended Codex models compared here. At Standard API speed for short-context requests, its rates are $0.10 per million uncached input tokens and $0.50 per million output tokens.

OpenAI’s current Codex model guidance positions Luna for focused, repeatable work, GPT-6.1 Sol for more complex coding, and Astra for the most demanding workflows. Availability depends on your account, client, sign-in method, and workspace settings.

This makes Luna a sensible starting point to evaluate for bounded tasks. It does not mean Luna is the lowest-cost choice for every completed feature or debugging session.

For a wider comparison across providers, see our guide to the cheapest models for Claude Code and Codex.

A Codex model does not need “Codex” in its name

Codex is the coding agent and product experience. Its underlying model can have a general GPT model name.

That distinction matters when comparing the cheapest Codex models. Older articles may focus on models whose names contain “Codex,” while the current recommended lineup uses different names.

OpenAI’s documentation lists several older Codex models as deprecated or retired for ChatGPT sign-in. API availability can differ. Check the model supported by your deployment before copying an older recommendation.

This comparison focuses on GPT-6 Luna, GPT-6.1 Sol, and GPT-6 Astra, rather than ranking every historical API model or third-party gateway option.

Compare current Codex model API prices

The following rates come from OpenAI’s official API pricing. Prices are in USD per million tokens at Standard speed for short-context requests.

Model Uncached input Cached input reads Cache writes Output
GPT-6 Luna $0.10 $0.01 $0.125 $0.50
GPT-6.1 Sol $2.00 $0.10 $2.50 $10.00
GPT-6 Astra $10.00 $1.00 $12.50 $50.00

Long-context requests and other processing modes have different rates. Additional tools, regional processing, and contractual terms can also affect the amount charged.

For Luna specifically, requests exceeding 272,000 input tokens use higher rates for the full request: twice the input and cache rates, and 1.5 times the output rate. See the GPT-6 Luna model specifications.

These are API prices. They should not be used to calculate the number of tasks included in a ChatGPT subscription.

What do everyday coding tasks cost?

To compare request costs, use:

Estimated request cost = (uncached input tokens ÷ 1,000,000 × input rate) + (billable output tokens ÷ 1,000,000 × output rate)

Add cache reads, cache writes, and non-token charges where applicable.

The table below uses three hypothetical workloads. All use uncached input, Standard API speed, and short-context pricing.

Illustrative workload Input tokens Billable output tokens GPT-6 Luna GPT-6.1 Sol GPT-6 Astra
Small edit or explanation 1,500 300 $0.0003 $0.0060 $0.0300
Drafting tests with relevant code 8,000 2,000 $0.0018 $0.0360 $0.1800
Investigating a bug with larger context 20,000 5,000 $0.0045 $0.0900 $0.4500

These figures are calculations using assumed token counts, not measured task costs or coding benchmarks. Actual models may consume different amounts of input and output to complete the same work.

For example, 1,000 requests matching the test-drafting row would cost $1.80 on Luna, $36 on Sol, or $180 on Astra under these assumptions.

However, one request is not necessarily one finished task. A coding agent may inspect files, edit code, run checks, and make further requests before completing a change.

Also count reasoning tokens correctly. OpenAI bills reasoning tokens as output tokens, even when they are not visible in the response. Use provider-reported usage rather than estimating costs from the displayed code alone.

Which model should you evaluate for each task?

Treat model selection as a policy you test against your repository.

GPT-6 Luna: bounded, repeatable work

Evaluate Luna for tasks with clear requirements and straightforward checks.

Examples include documenting a function, explaining a short snippet, generating a small test file, or implementing a narrowly defined change.

Give it the relevant source code and acceptance criteria. A request such as “add tests for an empty list and preserve existing behaviour” is easier to assess than “improve these tests.”

GPT-6.1 Sol: broader implementation work

Evaluate Sol when the task spans several files, requires more planning, or repeatedly fails your checks on a smaller model.

Compare whether the higher request cost buys fewer attempts or less review effort. The result should determine where Sol belongs in your workflow.

GPT-6 Astra: demanding investigations

Evaluate Astra for difficult debugging, substantial architectural changes, and workflows requiring sustained reasoning across many steps.

Its higher price needs to be justified by the outcome. Record whether it resolves issues that other models leave unfinished and how much developer time it saves.

These task categories are suggested evaluation buckets, not guarantees of performance.

The cheapest request can become an expensive task

A price list measures token rates. Your team needs to measure delivery.

A low-cost request that produces an incorrect patch adds another attempt, another review, and possibly a longer conversation. A more expensive model may complete that particular task with less rework.

Use two measurements:

API cost per accepted task = total API cost across all attempts ÷ number of accepted tasks

Total delivery cost = API cost + developer review and rework cost

Define “accepted” before comparing models. For coding, that might require passing tests, meeting the requested behaviour, and approval after review.

Include unsuccessful runs in the expenditure total. Looking only at the cost of successful attempts hides the money spent reaching them.

API costs and subscription usage need separate comparisons

With an API key, usage follows API pricing. With ChatGPT sign-in, Codex follows the applicable subscription limits and credit arrangements.

OpenAI’s Codex pricing documentation explicitly separates API token prices from subscription usage. Included task capacity cannot be inferred from the API price table.

For a subscription comparison, record the plan fee, included usage, purchased credits, and the models available to your account.

For an API comparison, record token categories, processing mode, model, and additional charges.

Track these billing arrangements separately, then combine their actual expenditure in your overall AI budget.

How to reduce Codex costs beyond choosing a cheaper model

Keep the task and context focused

Provide the files needed to investigate the problem. Avoid sending unrelated source code or large logs when a focused extract will answer the question.

For long workflows, review how conversation history grows. A cheap model processing unnecessary context still creates avoidable expense.

Our guide to prompt compression for Claude Code and Codex explains another approach to reducing bulky context. Evaluate its effect on both quality and cost.

Measure caching rather than assuming savings

Repeated, stable context may qualify for lower-priced cache reads. Cache writes have a separate API cost for the current models in this comparison.

OpenAI’s prompt-caching documentation explains the matching and reuse requirements. Monitor actual cache usage and total input cost before deciding whether a change helped.

Match reasoning effort to the problem

Use the supported reasoning settings available in your client. Evaluate whether a lower effort setting is sufficient for a simple task, and allow more reasoning where the work needs it.

Compare the resulting quality, latency, and total billable output. A shorter visible answer does not necessarily mean less reasoning.

Limit unproductive retries

Set an escalation policy. When the same acceptance check repeatedly fails, stop the loop and review the cause or switch to a more capable model.

Retain useful findings during escalation so the next attempt does not repeat the entire investigation.

For the wider budgeting approach, read AI spend control and governance for engineering teams.

Run a small comparison before changing team defaults

Start with a representative set of recent tasks:

  1. Choose examples of small edits, tests, and debugging.
  2. Define the same acceptance criteria for every model.
  3. Keep the starting code and relevant context comparable.
  4. Record costs across all requests, retries, and review.
  5. Compare accepted-task cost and turnaround time.

Use the results to decide which tasks can start on Luna, which should start on Sol, and which justify Astra.

Review the policy when model pricing, availability, or your workloads change.

Frequently asked questions

What is the cheapest Codex model currently?

As of 9 October 2026, GPT-6 Luna is the lowest-priced model among the current recommended Codex options compared here. Its short-context Standard API rates start at $0.10 per million input tokens and $0.50 per million output tokens.

Does the cheapest Codex model always save money?

Compare completed work. Repeated failures, longer sessions, and additional review can offset a lower token price.

Can I use API prices to estimate included subscription tasks?

No. Codex subscription usage has its own limits and credit arrangements. Use the pricing rules for your actual sign-in and billing method.

How should I compare the cheapest Codex models?

Use representative tasks, consistent acceptance checks, and complete usage records. Compare cost per accepted task alongside quality and developer review time.

Choose the cheapest model that completes the work reliably

GPT-6 Luna is the starting point for evaluating inexpensive, focused Codex work in the current recommended lineup.

The next decision should come from your own tasks. Measure complete workflow costs, escalate when necessary, and reserve more expensive models for work where they improve the outcome.

Explore more practical guidance on the Opviera blog.

Written by Chamod S.

Get More Coding Value from Your AI Budget

Understand which models and workflows drive your Codex costs. Explore how Opviera can help you improve spending visibility and make more informed AI budget decisions.