GPT-4o API Retirement: How to Migrate Before January 2027
OpenAI removes GPT-4o, GPT-4o mini, GPT-4.1 and GPT-4.1 mini from its API on 14 January 2027. Here is what to switch to, the cost math and a migration plan.
On this page
- Key takeaways
- Which OpenAI models are being retired?
- What should you replace GPT-4o with?
- How much cheaper is GPT-6 Luna than GPT-4o?
- What breaks when you switch to GPT-6 Luna?
- What happens to fine-tuned GPT-4o models?
- How to migrate from GPT-4o step by step
- Azure OpenAI and other platforms
- Frequently asked questions
- Your next step
- Sources
Last updated: 22 October 2026
Quick answer: OpenAI will remove GPT-4o, GPT-4o mini, GPT-4.1 and GPT-4.1 mini, including fine-tuned versions, from its API on 14 January 2027. It announced the change on 14 October 2026 and recommends GPT-6 Luna as the replacement, which costs $0.10 per million input tokens versus $2.50 for GPT-4o. The ChatGPT app is not affected.
If your chatbot, automation, plugin or SaaS feature calls GPT-4o or GPT-4.1 through the OpenAI API, it will stop working on 14 January 2027 unless you switch models. That gives developers about three months, and some older models, such as the first GPT-4o snapshot and GPT-4.1 nano, shut down even sooner, on 23 October 2026.
This guide covers exactly which models are retiring, what to switch to, how the costs compare, the technical changes that break code during migration, and a step-by-step plan to finish before the holidays.
Key takeaways
- Removal date: 14 January 2027 for GPT-4o, GPT-4o mini, GPT-4.1 and GPT-4.1 mini snapshots and all fine-tunes built on them.
- Replacement: GPT-6 Luna, which is 20 to 25 times cheaper than GPT-4o on list price and has a context window of about 1 million tokens.
- Biggest gotcha: Luna reasons by default, so set reasoning effort to none for simple tasks and for function calling in Chat Completions.
- Fine-tuning is winding down: new self-serve jobs end on 6 January 2027, and Luna cannot be fine-tuned.
- Azure OpenAI customers have until 14 April 2027 for the same models.

Which OpenAI models are being retired?
OpenAI is retiring the GPT-4o and GPT-4.1 families from its API in two waves: older snapshots on 23 October 2026 and the main snapshots on 14 January 2027. Fine-tuned models follow their base model’s date.
| Model ID | Shutdown date | Recommended replacement |
|---|---|---|
| gpt-4o-2024-05-13 | 23 October 2026 | GPT-6 Luna |
| gpt-4.1-nano, gpt-4-turbo, gpt-3.5-turbo, o1, o3-mini, o4-mini | 23 October 2026 | GPT-6 Luna or newer models |
| gpt-4o-2024-08-06 and gpt-4o-2024-11-20 | 14 January 2027 | GPT-6 Luna |
| gpt-4o-mini-2024-07-18 | 14 January 2027 | GPT-6 Luna |
| gpt-4.1-2025-04-14 and gpt-4.1-mini-2025-04-14 | 14 January 2027 | GPT-6 Luna |
| Fine-tunes of the models above | Same date as base model | Prompting, retrieval or another provider |
OpenAI keeps the full schedule on its official deprecations page. The ChatGPT app already removed GPT-4o and GPT-4.1 on 13 February 2026, so this change affects only API-built products. For what replaced them in the app, see ChatGPT’s new features in 2026.
What should you replace GPT-4o with?
OpenAI recommends GPT-6 Luna as the default replacement for GPT-4o, GPT-4o mini, GPT-4.1 and GPT-4.1 mini. GPT-6 Luna is the smallest model in OpenAI’s GPT-6 family, with a context window of 1,050,000 tokens and a knowledge cutoff of 18 May 2026.
| Key fact | GPT-6 Luna |
|---|---|
| Developer | OpenAI |
| Input price | $0.10 per million tokens |
| Cached input | $0.01 per million tokens |
| Output price | $0.50 per million tokens |
| Context window | 1,050,000 tokens |
| Max output | 128,000 tokens |
| Fine-tuning | Not supported |
For harder work such as complex reasoning or long agent tasks, consider GPT-6.1 Sol ($2.00 input, $10.00 output) instead. Our guide to GPT-6 models compares Astra, Sol and Luna, and model routing shows how to send easy requests to Luna and hard ones to Sol.
How much cheaper is GPT-6 Luna than GPT-4o?
GPT-6 Luna is about 25 times cheaper than GPT-4o on input and 20 times cheaper on output at list prices. It is also cheaper than GPT-4o mini, which many teams used to save money.
| Model | Input per 1M tokens | Output per 1M tokens | Context |
|---|---|---|---|
| GPT-4o | $2.50 | $10.00 | 128K |
| GPT-4.1 | $2.00 | $8.00 | About 1M |
| GPT-4.1 mini | $0.40 | $1.60 | About 1M |
| GPT-4o mini | $0.15 | $0.60 | 128K |
| GPT-6 Luna | $0.10 | $0.50 | 1.05M |
Worked example: a support chatbot
Take a chatbot handling 20,000 conversations a month, each using about 1,500 input tokens and 500 output tokens. That is 30 million input and 10 million output tokens a month.
- GPT-4o: 30 x $2.50 = $75 input plus 10 x $10 = $100 output, so $175 a month.
- GPT-4.1: 30 x $2.00 = $60 plus 10 x $8 = $80, so $140 a month.
- GPT-4o mini: 30 x $0.15 = $4.50 plus 10 x $0.60 = $6, so $10.50 a month.
- GPT-6 Luna (reasoning off): 30 x $0.10 = $3 plus 10 x $0.50 = $5, so $8 a month.
Watch out: reasoning tokens are billed as output. If you leave Luna at its default medium reasoning, output tokens can rise sharply and erase the savings. Also, requests above 272,000 input tokens are billed at 2x input and 1.5x output for the whole request. Learn to forecast this in how to estimate AI API costs.
What breaks when you switch to GPT-6 Luna?
Changing the model name is the easy part; the real breaking changes are reasoning defaults, function calling rules and unsupported APIs. Test these four areas before you switch production traffic.
- Reasoning is on by default. GPT-6 Luna reasons at medium effort unless you change it. OpenAI’s migration guide suggests starting with reasoning set to none, then raising it only where quality needs it.
- Function calling in Chat Completions needs reasoning off. In the Chat Completions API, Luna supports function calling only with reasoning_effort set to none. To combine reasoning with tools, move to the Responses API.
- Sampling settings disappear with reasoning. When reasoning is enabled, temperature, top_p, logprobs and top_logprobs are not available, which GPT-4.1 supported. Code that passes them may error.
- Assistants and Realtime. Reports on the migration say Luna does not run on the Assistants and Realtime APIs, so systems built on them need rebuilding on the Responses API or a current realtime model.
Also re-check prompts that relied on GPT-4o’s tone or formatting, and supply facts in the prompt rather than relying on the model’s memory. Pairing Luna with retrieval-augmented generation is the safest way to keep answers accurate.
What happens to fine-tuned GPT-4o models?
Fine-tuned GPT-4o and GPT-4.1 models stop working on the same day as their base model, 14 January 2027, and GPT-6 Luna cannot be fine-tuned. OpenAI is also winding down self-serve fine-tuning: active customers can start new training jobs only until 6 January 2027.
You have three realistic options:
- Prompting with examples: move the behavior into a system prompt with 5 to 20 high-quality examples. With prompt caching, long instructions cost little ($0.01 per million cached tokens on Luna).
- Retrieval: if the fine-tune taught product knowledge, store that knowledge in a search index and pass the relevant pieces into each request.
- Another provider: some providers still offer fine-tuning or open-weight models you can tune yourself; compare options in our LLM API pricing comparison and open-source AI models guide.
How to migrate from GPT-4o step by step
The safest migration takes four to six weeks: inventory, baseline, test, stage and switch. Aim to finish by mid-December 2026 so you have buffer before the 14 January 2027 shutdown.
- Inventory every model ID. Search code, environment variables, no-code tools (Zapier, Make, n8n) and vendor products for gpt-4o, gpt-4o-mini, gpt-4.1 and fine-tune IDs. Check the Usage page in the OpenAI dashboard to see which models still get traffic.
- Ask your vendors. If a SaaS tool you use is built on GPT-4o, ask which model it will move to and when.
- Record a baseline. Save 100 to 200 real requests with current outputs, latency and cost.
- Test GPT-6 Luna with reasoning off. Compare quality on your baseline set, then try low reasoning only for the cases that fail.
- Fix breaking changes. Remove unsupported sampling parameters, move tool-plus-reasoning flows to the Responses API, and rebuild Assistants or Realtime flows.
- Stage the rollout. Send 10 percent of traffic to Luna, watch errors and complaints, then increase. Store the model name in configuration so the next migration is a one-line change.
Save money: combine the switch with the Batch API for jobs that can wait, which costs about half of standard pricing. Many teams cut their OpenAI bill by more than 90 percent in this migration.
Azure OpenAI and other platforms
Azure OpenAI customers get more time: Microsoft lists 14 April 2027 as the retirement date for the same GPT-4o and GPT-4.1 models, and names GPT-5.1 as its suggested replacement for GPT-4o while GPT-6 Luna is not yet listed on Azure. If you use OpenAI models through another platform, check that platform’s own deprecation notices, since dates can differ from OpenAI’s.
Teams with EU customers should note that GPT-6 Luna supports EU data residency, but OpenAI adds a 10 percent surcharge for regional processing on models released on or after 5 March 2026. If you are reconsidering providers entirely, compare Claude API pricing and Gemini API pricing.
Frequently asked questions
When is GPT-4o being shut down in the API?
On 14 January 2027. OpenAI announced on 14 October 2026 that GPT-4o, GPT-4o mini, GPT-4.1 and GPT-4.1 mini, plus fine-tuned versions, will stop serving on that date. The original gpt-4o-2024-05-13 snapshot and GPT-4.1 nano stop earlier, on 23 October 2026.
Does the GPT-4o retirement affect ChatGPT?
No. The 14 January 2027 retirement applies only to the OpenAI API. GPT-4o and GPT-4.1 were already removed from the ChatGPT app on 13 February 2026, and ChatGPT now runs on GPT-6 Sol for paid plans and GPT-6 Luna for Free and Go.
What is the best replacement for GPT-4o mini?
GPT-6 Luna. It costs $0.10 per million input tokens and $0.50 per million output tokens, cheaper than GPT-4o mini’s $0.15 and $0.60, with a far larger 1.05 million token context window. Turn reasoning off for simple, high-volume tasks to keep costs and latency low.
Can I fine-tune GPT-6 Luna?
No. GPT-6 Luna does not support fine-tuning, and OpenAI is winding down self-serve fine-tuning, with new jobs allowed only until 6 January 2027. Replace fine-tunes with detailed prompts and examples, retrieval from your own documents, or a provider that still supports tuning.
Why does my code break after switching to GPT-6 Luna?
Usually because Luna reasons by default. With reasoning on, function calling in Chat Completions and parameters like temperature and logprobs are not supported. Set reasoning_effort to none, or move tool-using flows to the Responses API.
Your next step
Run a search for “gpt-4o” and “gpt-4.1” across your code and tools today, then test GPT-6 Luna with reasoning off on a small set of real requests this week. The earlier you start, the more time you have to fix edge cases and enjoy the lower bill. Dates and prices can change, so confirm everything on OpenAI’s deprecations and pricing pages before you plan your rollout.
Sources
- Deprecations, OpenAI API docs, checked 22 October 2026
- Using the latest model (migration guide), OpenAI API docs, checked 22 October 2026
- GPT-6 Luna model page, OpenAI API docs, checked 22 October 2026
- OpenAI GPT-4o API shutdown, The New Stack, 15 October 2026, checked 22 October 2026
- GPT-4o and GPT-4.1 leave OpenAI’s API on 14 January 2027, DataNorth AI, checked 22 October 2026
Pricing and features are checked at the time of writing and can change. Some links may be affiliate links, which never affect our verdicts.