On August 31, 2026, OpenAI is retiring GPT-5.4 and GPT-5.4 mini from Codex for users who sign in to Codex with a ChatGPT account. The official migration path is explicit: replace GPT-5.4 with GPT-5.6 Terra, and replace GPT-5.4 mini with GPT-5.6 Luna.[1]
The most important nuance is easy to miss: this is not a retirement of GPT-5.4 from the OpenAI API. OpenAI explicitly says the change does not affect the API or Codex usage with your own API key.[1]
So the simplified statement:
GPT-5.4 was retired on August 31, 2026.
is inaccurate.
The precise version is:
GPT-5.4 and GPT-5.4 mini are being retired from Codex
when users authenticate with ChatGPT.
The API and Codex with your own API key are not affected by this change.
For teams using Codex, the work is broader than changing a model selector. OpenAI specifically tells users to update workspace defaults, saved model settings, managed configurations and automations before August 31.[1]
The migration also brings technical advantages. GPT-5.6 Terra keeps the 1,050,000-token context window of GPT-5.4, reduces standard API pricing from $2.50/$15 to $2/$12 per million input/output tokens, and has a newer knowledge cutoff. GPT-5.6 Luna is much cheaper and increases context from GPT-5.4 mini's 400K to 1.05M.[6][7][8][9]
That does not make the move a zero-risk drop-in replacement. GPT-5.6 adds max reasoning, has different documented API model defaults for reasoning, and introduces capabilities not present in the 5.4 generation. OpenAI recommends running evals on representative workloads rather than assuming identical behavior.[10]
Information status: August 31, 2026. The cited OpenAI documentation gives the retirement date but not a specific cutoff hour, so this article does not invent a local-time midnight deadline.
TL;DR
| Question | Verified answer |
|---|---|
| What happens on August 31, 2026? | GPT-5.4 and GPT-5.4 mini leave Codex when signed in with ChatGPT |
| GPT-5.4 replacement | GPT-5.6 Terra |
| GPT-5.4 mini replacement | GPT-5.6 Luna |
| Does the OpenAI API lose GPT-5.4? | Not as part of this change |
| Is Codex with your own API key affected? | No |
| What should be audited? | workspace defaults, saved model settings, managed configs, automations |
| Can Enterprise config enforce the model? | Yes. Managed requirements.toml takes priority over workspace defaults |
| GPT-5.4 context | 1.05M |
| GPT-5.6 Terra context | 1.05M |
| GPT-5.4 mini context | 400K |
| GPT-5.6 Luna context | 1.05M |
| Terra/Luna max output | 128K |
| Terra/Luna knowledge cutoff | February 16, 2026 |
| GPT-5.4 API price | $2.50 input / $0.25 cached / $15 output per 1M tokens |
| Terra API price | $2.00 / $0.20 / $12.00 |
| GPT-5.4 mini API price | $0.75 / $0.075 / $4.50 |
| Luna API price | $0.20 / $0.02 / $1.20 |
| Terra/Luna reasoning | none, low, medium, high, xhigh, max |
| Terra/Luna documented API default | medium |
| GPT-5.4 / mini reasoning | none, low, medium, high, xhigh |
| GPT-5.4 / mini documented API default | none |
Does gpt-5.6 mean Terra? | No. The gpt-5.6 alias routes to GPT-5.6 Sol |
| Does API pricing equal Codex plan limits? | No |
| Key migration rule | change the model, pin reasoning, run evals, then tune prompts |
What exactly is OpenAI retiring?
OpenAI says GPT-5.4 and GPT-5.4 mini will no longer be available in Codex when you sign in with a ChatGPT account on August 31, 2026.[1]
Codex can be accessed through several surfaces, including:
- the ChatGPT desktop app in Codex mode,
- Codex CLI,
- the Codex IDE extension,
- Codex on the web.[1]
This should not be interpreted as a full retirement of those models across every OpenAI product.
The official migration map
OpenAI gives two explicit replacements:[1]
GPT-5.4 → GPT-5.6 Terra
GPT-5.4 mini → GPT-5.6 Luna
This is a product-specific Codex migration mapping, not a claim that the new names map one-to-one to older architectural tiers.
OpenAI positions Terra as the GPT-5.6 model that balances intelligence and cost, and Luna as the cost-sensitive, high-volume option.[5][6][7]
What is NOT affected?
OpenAI names two unaffected scenarios:[1]
OpenAI API
Codex used with your own API key
If a production application currently calls:
gpt-5.4
through the OpenAI API, the August 31 Codex notice does not by itself mean that request stops working on that date.
The same applies to Codex used in BYOK mode.
Should you still migrate API workloads from GPT-5.4?
Possibly, but that is a separate decision.
OpenAI's current model guidance recommends the GPT-5.6 family as the current direction for new and migrated workloads. When migrating from GPT-5.4, OpenAI recommends starting with the same reasoning setting and then testing one level lower on representative tasks.[10]
The GPT-5.6 family was previewed with GPT-5.6 Sol on June 26, followed by the broader GPT-5.6 launch announced by OpenAI on July 9, 2026.[11][12]
That is optimization guidance, not an API retirement deadline.
GPT-5.4 vs GPT-5.6 Terra
| Parameter | GPT-5.4 | GPT-5.6 Terra |
|---|---|---|
| Context window | 1,050,000 | 1,050,000 |
| Max output | 128,000 | 128,000 |
| Knowledge cutoff | Aug 31, 2025 | Feb 16, 2026 |
| API input / 1M | $2.50 | $2.00 |
| Cached input / 1M | $0.25 | $0.20 |
| API output / 1M | $15.00 | $12.00 |
| Reasoning | none, low, medium, high, xhigh | none, low, medium, high, xhigh, max |
| Documented API default reasoning | none | medium |
At standard token rates, Terra is 20% cheaper than GPT-5.4 for input, cached input and output.
GPT-5.4 mini vs GPT-5.6 Luna
| Parameter | GPT-5.4 mini | GPT-5.6 Luna |
|---|---|---|
| Context window | 400,000 | 1,050,000 |
| Max output | 128,000 | 128,000 |
| Knowledge cutoff | Aug 31, 2025 | Feb 16, 2026 |
| API input / 1M | $0.75 | $0.20 |
| Cached input / 1M | $0.075 | $0.02 |
| API output / 1M | $4.50 | $1.20 |
| Reasoning | none, low, medium, high, xhigh | none, low, medium, high, xhigh, max |
| Documented API default reasoning | none | medium |
Luna's standard API token rates are roughly 73% lower than GPT-5.4 mini's.
Its documented context window is also 2.625× larger.
API price and Codex plan limits are different systems
This is one of the easiest comparison mistakes to make.
A price such as:
$ / 1M tokens
is not the same metric as:
how many Codex messages do I get on Plus or Pro?
The Codex pricing page currently shows approximate local-message ranges within a five-hour usage window. In one of the plan views it lists:[2]
GPT-5.4: 20–100 local messages / 5h
GPT-5.6 Terra: 20–110 local messages / 5h
GPT-5.4 mini: 60–350 local messages / 5h
GPT-5.6 Luna: 50–280 local messages / 5h
Those are ranges, not guarantees. OpenAI says actual usage depends on task size, complexity and model, and additional weekly limits may apply.[2]
So a model can be much cheaper per API token without the bundled Codex message limit increasing in the same ratio.
Business and Enterprise credit rates also change
The current credit-based rate card for supported Work and Codex activity lists:[3]
| Model | Input credits / 1M | Cached / 1M | Output / 1M |
|---|---|---|---|
| GPT-5.4 | 62.5 | 6.25 | 375 |
| GPT-5.6 Terra | 50 | 5 | 300 |
| GPT-5.4 mini | 18.75 | 1.875 | 113 |
| GPT-5.6 Luna | 5 | 0.5 | 30 |
OpenAI says these rates apply to supported Codex and Work activity and actual charges depend on token consumption.[3]
The most important migration trap: reasoning defaults
The API model pages for GPT-5.4 and GPT-5.4 mini document none as the default reasoning effort.[8][9]
The Terra and Luna model pages document medium as the default.[6][7]
If you migrate your own API workload and simultaneously:
change the model
+
do not explicitly set reasoning.effort
you may change not only the model but also latency, token use and behavioral profile.
That is why OpenAI recommends using the existing reasoning level as the initial migration baseline.[10]
Codex workspace defaults are not necessarily API defaults
Codex workspace administrators and owners can configure:
- starting model,
- reasoning level,
- speed,
- Fast Mode availability,
- new-chat behavior.[1]
So the documented API default must not be assumed to describe every Codex session.
Managed environments should inspect their effective workspace configuration.
requirements.toml takes precedence over workspace defaults
OpenAI documents this control hierarchy for managed workspaces:[1]
managed requirements.toml
→ workspace starting defaults
→ member's local starting choice
Changing only the model default in the UI may therefore be insufficient if an enforced managed requirement still references or restricts models differently.
What exactly should be inventoried?
OpenAI explicitly lists four areas:[1]
workspace defaults
saved model settings
managed configurations
automations
In practice, POLPROG also recommends auditing:
- local Codex profiles,
- CLI launch scripts,
- CI/CD,
- team documentation,
- project templates,
- environment variables,
- internal wrappers,
- onboarding instructions.
Those additional items are practical engineering recommendations, not OpenAI requirements.
How to find GPT-5.4 references in a repository
On macOS or Linux, a useful first pass is:
rg -n --hidden \
-g '!node_modules' \
-g '!.git' \
'gpt-5\.4(-mini)?|GPT-5\.4( mini)?' .
If user-level Codex configuration matters too:
rg -n 'gpt-5\.4(-mini)?' ~/.codex 2>/dev/null
This is not an official OpenAI migration command. It is a normal text audit to find hard-coded model references.
Do not perform blind global search-and-replace
Replacing:
gpt-5.4 → gpt-5.6-terra
can be correct in a model configuration.
But the same text may also appear in:
- historical documentation,
- snapshot tests,
- articles,
- logs,
- migration examples,
- changelogs.
Blind replacement can destroy historical meaning.
Be careful with the gpt-5.6 alias
OpenAI's current model documentation says:
gpt-5.6 → GPT-5.6 Sol
Therefore, if you specifically intend the official Codex replacement Terra, using:
gpt-5.6
in the API does not select Terra.
Use the explicit IDs:
gpt-5.6-terra
or:
gpt-5.6-luna
Example API migration to Terra
The August 31 Codex deadline does not require this API change. But if you intentionally migrate your API workload, pin both model and reasoning.
from openai import OpenAI
client = OpenAI()
response = client.responses.create(
model="gpt-5.6-terra",
reasoning={"effort": "medium"},
input="Review this pull request and identify correctness regressions."
)
print(response.output_text)
OpenAI recommends the Responses API for GPT-5.6 reasoning, tool-calling and multi-turn workflows.[10]
Example high-volume migration to Luna
from openai import OpenAI
client = OpenAI()
response = client.responses.create(
model="gpt-5.6-luna",
reasoning={"effort": "low"},
input="Classify this issue and return the owning engineering team."
)
print(response.output_text)
Luna is positioned for cost-sensitive, high-volume workloads.[7]
Do not change prompt and model at the same time
OpenAI's migration guidance recommends changing the model while keeping prompts functionally stable first, then tuning prompts based on eval results.[10]
This preserves the ability to answer:
Did the regression come from the model,
or from the prompt rewrite?
Changing everything at once destroys that baseline.
How should reasoning be tuned after migration?
A practical workflow aligned with OpenAI guidance is:[10]
old effort
→ same effort on GPT-5.6
→ repeat the eval one level lower
→ compare quality, latency and cost
GPT-5.6 supports:
none
low
medium
high
xhigh
max
Reserve max for the hardest quality-first workloads where evals show a measurable benefit.[10]
Terra or Luna?
Choose Terra if:
- you used GPT-5.4 in Codex,
- tasks involve multi-file changes,
- you need a balance of capability and cost,
- the agent follows complex instructions,
- you need a strong general coding model.
Choose Luna if:
- you used GPT-5.4 mini,
- the workload is high-volume and repetitive,
- cost and throughput matter most,
- tasks are smaller or tightly scoped,
- the model acts as a subagent or classifier.
This follows OpenAI's official Codex migration map and current model positioning.[1][5][6][7]
When should Sol be considered instead of Terra?
OpenAI positions GPT-5.6 Sol as the flagship model for complex professional work and coding.[5]
However, the official replacement for GPT-5.4 in the Codex retirement notice is Terra, not Sol.[1]
Moving to Sol should therefore be treated as a separate quality-versus-cost decision, not as a required migration step.
Context: Terra preserves 1.05M, Luna jumps from 400K to 1.05M
GPT-5.4 and Terra:
1.05M → 1.05M
GPT-5.4 mini and Luna:
400K → 1.05M
A larger context window can matter for repo-level coding, but nominal context size does not guarantee perfect whole-repository reasoning.
Teams should still test retrieval, context selection and agent behavior on real codebases.
Long context has separate API pricing consequences
For Terra and Luna, OpenAI states that prompts above 272K input tokens are priced at:
2× input price
1.5× output price
A bigger context window is therefore not a reason to inject an entire monorepo without context discipline.
A newer knowledge cutoff does not replace tools
GPT-5.4 and GPT-5.4 mini:
Aug 31, 2025 cutoff
Terra and Luna:
Feb 16, 2026 cutoff
That improves base model recency, but it does not replace web search, repository context, file search or actual project documentation.
GPT-5.6 availability in Codex depends on plan
OpenAI's current availability documentation says:[4]
- Free and Go receive limited Terra access through Work/Codex,
- Plus, Pro, Business and Enterprise have broader access to the GPT-5.6 family depending on product and plan,
- Luna is broadly available within the GPT-5.6 product family.
Exact product limits should always be checked against current pricing because those limits can change.[2][4]
Migrating automations matters more than the visible model selector
A user notices a missing model selector immediately.
An automation may run unattended:
nightly refactor
scheduled code review
maintenance task
dependency update
repository audit
If the old model is persisted in automation configuration, the issue may surface only at the next scheduled run.
That is why OpenAI explicitly lists automations among the items to update.[1]
Enterprise: audit all three configuration layers
Managed requirements
Centrally enforced and highest priority.[1]
Workspace defaults
Starting model and reasoning configured by admins.[1]
Local choice
A member's starting selection, where policy permits it.[1]
A complete audit must cover all three.
How to run a useful migration eval
Build a set of 20–50 representative tasks, for example:
- fix a real bug,
- refactor several files,
- add tests,
- migrate a dependency,
- diagnose a regression,
- implement a small feature,
- review a pull request,
- write technical documentation.
Measure:
task success rate
test pass rate
post-review corrections
diff size
out-of-scope changes
tool calls
latency
token usage
credit usage
retry rate
Do not reduce the comparison to which model “sounds smarter”.
One-day minimum migration plan
Step 1
Inventory every GPT-5.4 and GPT-5.4 mini reference.
Step 2
For Codex with ChatGPT authentication:
GPT-5.4 → GPT-5.6 Terra
GPT-5.4 mini → GPT-5.6 Luna
Step 3
Check workspace defaults and managed configuration.
Step 4
Update automations.
Step 5
Pin reasoning where behavior stability matters.
Step 6
Run smoke tests on representative repositories.
Step 7
Only then optimize reasoning, prompts and cost.
What should you avoid?
- Do not say GPT-5.4 is “gone from the API”.
- Do not assume
gpt-5.6means Terra. - Do not equate API token price with Codex plan limits.
- Do not change model, prompt and reasoning together without a baseline.
- Do not forget automations.
- Do not assume a larger context window automatically means better results.
- Do not publish an unverified retirement hour.
- Do not present Sol as the official GPT-5.4 replacement in this Codex notice.
Production migration checklist
Inventory
- Found all
gpt-5.4references. - Found all
gpt-5.4-minireferences. - Checked workspace defaults.
- Checked saved model settings.
- Checked managed configurations.
- Checked automations.
- Checked CLI scripts.
- Checked CI/CD.
Configuration
- Replaced GPT-5.4 with Terra for Codex/ChatGPT auth.
- Replaced GPT-5.4 mini with Luna.
- Checked
requirements.toml. - Checked workspace starting model.
- Checked reasoning level.
- Checked Fast Mode policy.
- Did not use
gpt-5.6alias when Terra is required. - Used explicit model IDs in API workloads where stability matters.
Evals
- Preserved the old prompt as baseline.
- Tested the same reasoning effort.
- Tested one effort level lower.
- Measured test pass rate.
- Measured retry rate.
- Measured latency.
- Measured token usage.
- Measured credit usage.
- Reviewed out-of-scope changes.
- Tested long agent sessions.
Operations
- Updated team documentation.
- Updated onboarding.
- Updated repository templates.
- Updated scheduled tasks.
- Added post-migration error monitoring.
- Defined a fallback model.
- Checked current Codex pricing.
- Checked current plan limits.
POLPROG verdict
The August 31, 2026 change matters, but it is narrower than the headline “OpenAI retires GPT-5.4” would suggest.
The facts are:
GPT-5.4 and GPT-5.4 mini
↓
retire in Codex when authenticated with ChatGPT
GPT-5.4 → GPT-5.6 Terra
GPT-5.4 mini → GPT-5.6 Luna
OpenAI API → not affected by this specific change
Codex + your own API key → not affected by this specific change
Technically, the new mapping is attractive.
Terra preserves GPT-5.4's 1.05M context window, has a newer cutoff and 20% lower standard API token prices.[6][8]
Luna raises context from GPT-5.4 mini's 400K to 1.05M and lowers standard token rates by roughly 73%.[7][9]
The operational change is more important than the model name itself.
Teams must verify:
model selection
reasoning defaults
managed policy
automations
limits
cost model
evals
The safest migration is therefore:
Change the model according to OpenAI's official mapping, keep the current prompt and reasoning level as your baseline, run evals, and only then optimize cost and latency.
That avoids turning a seemingly simple GPT-5.4 to GPT-5.6 migration into an uncontrolled simultaneous change to model, reasoning, cost, agent behavior and test outcomes.

