GPT-4o, GPT-4o mini, GPT-4.1 and GPT-4.1 mini shut down on 14 January 2027: find the calls in your vibe-coded app and move to GPT-6 Luna

If your AI-built app has a chatbot, summariser, classifier or extraction feature, there's a good chance it asks OpenAI for `gpt-4o-mini` or `gpt-4o`. Both were common model names in AI-generated Supabase Edge Functions, Next.js API routes and Vercel AI SDK code. OpenAI shuts down GPT-4o, GPT-4o mini, GPT-4.1 and GPT-4.1 mini on the API on 14 January 2027, and nothing in your app will warn you before it stops. OpenAI recommends GPT-6 Luna for all four, and it's cheaper per token. But a plain find-and-replace changes how the request behaves: Luna is a reasoning model that defaults to medium effort, and on Chat Completions it calls tools only with reasoning effort `none`. Here's how to find the calls, what to change, and what it costs.

Short answer

On the OpenAI API, GPT-4o (gpt-4o-2024-08-06, gpt-4o-2024-11-20), GPT-4o mini (gpt-4o-mini-2024-07-18), GPT-4.1 (gpt-4.1-2025-04-14) and GPT-4.1 mini (gpt-4.1-mini-2025-04-14) shut down on 14 January 2027. The gpt-4o, gpt-4o-mini, gpt-4.1 and gpt-4.1-mini aliases point at those snapshots and are marked Deprecated, and fine-tuned versions stop on the same date. OpenAI gave notice on 14 October 2026 and recommends gpt-6-luna for all four. To switch without surprises: set reasoning_effort: "none" (Luna defaults to medium, and Chat Completions supports tool calling on Luna only with none), use max_completion_tokens instead of the deprecated max_tokens, and test any temperature/top_p settings. GPT-6 Luna lists at $0.10 input / $0.50 output per million tokens, below GPT-4o mini's $0.15 / $0.60. Fine-tuned GPT-4o/4.1 models have no fine-tunable replacement: Luna doesn't support fine-tuning, and OpenAI stops new self-serve fine-tuning jobs on 15 December 2026.

What shuts down, when, and what replaces it

OpenAI added these four models to its deprecations page with a notice date of 14 October 2026 and a shutdown date of 14 January 2027. It defines a shut-down model as one that "no longer accepts requests through the standard API", and says fine-tuned versions follow the same schedule as their base model. That's three months' notice. OpenAI's stated policy is at least six months for generally available models "unless safety or compliance concerns require a faster timeline"; the deprecations page doesn't give a reason for the shorter notice here.

OpenAI API chat models shutting down on 14 Jan 2027, per OpenAI's deprecations page and model pages (checked 3 Dec 2026)
ModelIDs your code may useShutdownOpenAI's recommended replacement
GPT-4o gpt-4o (alias, points to gpt-4o-2024-08-06), gpt-4o-2024-08-06, gpt-4o-2024-11-20 14 Jan 2027 gpt-6-luna
GPT-4o mini gpt-4o-mini (alias), gpt-4o-mini-2024-07-18 14 Jan 2027 gpt-6-luna
GPT-4.1 gpt-4.1 (alias), gpt-4.1-2025-04-14 14 Jan 2027 gpt-6-luna
GPT-4.1 mini gpt-4.1-mini (alias), gpt-4.1-mini-2025-04-14 14 Jan 2027 gpt-6-luna

Already gone: gpt-4.1-nano and gpt-4o-2024-05-13 shut down on 23 October 2026 (OpenAI listed gpt-5.6-luna and gpt-5.6-sol as their replacements), and chatgpt-4o-latest on 17 February 2026. If your search below finds one of those, that feature is already failing.

Not covered by the 14 January date: the GPT-4o audio, speech and transcription models have their own dates on the same page. gpt-4o-mini-tts (and tts-1) shut down on 6 January 2027, gpt-4o-realtime, gpt-4o-audio and their mini versions on 20 January 2027, and gpt-4o-transcribe and gpt-4o-mini-transcribe on 26 February 2027. OpenAI doesn't publish a time of day for the 14 January shutdown or the exact error a request gets afterwards, so treat 13 January as your last safe day.

Is my app affected? Find the model ID

You're affected if your app calls the OpenAI API (directly or through Replit's managed OpenAI integration) and asks for one of the IDs above. In AI-built apps the call usually sits in server-side code: a Supabase Edge Function (common in Lovable and Bolt apps with their own Supabase project and OpenAI key), a Next.js or Express API route, a Vercel AI SDK call such as openai("gpt-4o-mini"), a Cloudflare Worker, or an automation. The model name can also live in an environment variable such as OPENAI_MODEL.

  • Search the code with the command below. It matches gpt-4o, gpt-4o-mini, gpt-4.1, gpt-4.1-mini, gpt-4.1-nano, dated snapshots and gateway-style IDs like openai/gpt-4o-mini, but not gpt-4o-mini-tts, gpt-4o-transcribe or gpt-4o-realtime (those have their own dates).
  • Check environment variables and secrets on your host and in Supabase for a variable that holds the model name. supabase secrets list only shows names and digests, so look at what your code reads.
  • Ask the API: OpenAI's deprecations page says the List models (GET /v1/models) and Retrieve a model endpoints return an optional shutdown_date field (example in the test section below).
  • Check your inbox: OpenAI says it emails customers actively using a model when it announces the deprecation.
Find retiring GPT-4o / GPT-4.1 model IDs in your project (run in the repo root)
# ripgrep (rg)
rg -n "gpt-4(o|\.1)(-mini|-nano)?(-20[0-9]{2}-[0-9]{2}-[0-9]{2})?([\"'\`]|\$)" .
# grep
grep -rnE "gpt-4(o|\.1)(-mini|-nano)?(-20[0-9]{2}-[0-9]{2}-[0-9]{2})?([\"'\`]|$)" --exclude-dir=node_modules .

Switch without new errors: what changes

GPT-4o and GPT-4.1 answer straight away. GPT-6 Luna is a reasoning model: OpenAI's model page lists reasoning efforts none, low, medium (default), high, xhigh and max, and its reasoning guide says reasoning tokens are billed as output tokens. OpenAI's help article on migrating from GPT-4.x says most GPT-4.x use cases are expected to migrate with reasoning effort set to none, so start there and only raise it if your tests show a benefit.

GPT-4o / GPT-4.1 → GPT-6 Luna, per OpenAI's GPT-6 Luna model page, reasoning guide, Chat Completions reference and GPT-4.x migration article (checked 3 Dec 2026)
If your code…On GPT-6 LunaChange it to
Sends no reasoning setting (normal for GPT-4o code) Defaults to medium reasoning: slower replies and extra billed output tokens Add reasoning_effort: "none" (Chat Completions) or reasoning: { effort: "none" } (Responses)
Calls tools (function calling) through Chat Completions OpenAI: "Chat Completions supports function calling only with reasoning_effort set to none" Keep reasoning_effort: "none", or move the call to the Responses API if you want reasoning with tools
Sets max_tokens The Chat Completions reference marks max_tokens deprecated in favour of max_completion_tokens, which also counts reasoning tokens max_completion_tokens (Responses: max_output_tokens) with room for reasoning if effort isn't none
Sets temperature or top_p The Luna model page doesn't say; OpenAI's GPT-6.2 migration guide says to omit them for GPT-6.2 models Test your exact request; if it returns a 400, remove them and steer output with the prompt
Uses Structured Outputs (response_format with a JSON schema) or image input Both listed as supported on Luna No change; re-run your schema tests
Uses Predicted Outputs (prediction) GPT-4o lists predicted_outputs; the Luna model page doesn't Remove it, or test that Luna accepts it
Calls a fine-tuned ft:gpt-4o… / ft:gpt-4.1… model Fine-tunes stop with their base model on 14 Jan; Luna lists fine-tuning as not supported Move the fine-tune's behaviour into the prompt (examples, Structured Outputs) and evaluate on Luna

Plain text calls through Chat Completions keep working: OpenAI lists Chat Completions and Responses as supported endpoints for GPT-6 Luna, and it has a larger context window (1,050,000 tokens, 922,000 input) than GPT-4o's 128,000.

Fine-tuning catch: OpenAI moved the cutoff for creating new self-serve fine-tuning jobs to 15 December 2026, so you can't train a replacement fine-tune on another model after that through self-serve. OpenAI's deprecations page mentions that some customers may be able to buy dedicated capacity for continued access after a shutdown, through its sales team.

Before and after: a typical AI-builder call

This is a common pattern in AI-generated backends: Chat Completions with gpt-4o-mini, a temperature, a token limit and a tool. The after version follows OpenAI's Luna model page and GPT-4.x migration article. Keep your own prompt, tools and error handling; this only shows the fields that change.

Supabase Edge Function or API route (TypeScript, openai SDK)
// BEFORE (GPT-4o mini): stops working on 14 Jan 2027
const completion = await openai.chat.completions.create({
  model: "gpt-4o-mini",
  temperature: 0.2,
  max_tokens: 500,
  messages: [{ role: "user", content: prompt }],
  tools: [{ type: "function", function: { name: "lookup_order", parameters: schema } }],
});

// AFTER (GPT-6 Luna): same endpoint, tools need reasoning_effort "none"
const completion = await openai.chat.completions.create({
  model: "gpt-6-luna",
  reasoning_effort: "none",
  max_completion_tokens: 500,
  // temperature: 0.2,  <- keep only if your test request accepts it
  messages: [{ role: "user", content: prompt }],
  tools: [{ type: "function", function: { name: "lookup_order", parameters: schema } }],
});

// Vercel AI SDK: change openai("gpt-4o-mini") to openai("gpt-6-luna")
// and pass reasoning effort "none" through your provider options.

The response shape (completion.choices[0].message) doesn't change on Chat Completions. If you later want Luna to reason while calling tools, OpenAI says to use the Responses API; its "Migrate to the Responses API" guide covers the different tool format and tool-call loop. How the Vercel AI SDK exposes the reasoning-effort option depends on your SDK version, so check its OpenAI provider docs rather than copying a field name from here.

What it costs after the switch

OpenAI API Standard list prices per million tokens, short context, per OpenAI's pricing and model pages (checked 3 Dec 2026)
ModelInputCached inputOutput
GPT-4o (retiring) $2.50 $1.25 $10
GPT-4.1 (retiring) $2 $0.50 $8
GPT-4.1 mini (retiring) $0.40 $0.10 $1.60
GPT-4o mini (retiring) $0.15 $0.075 $0.60
GPT-6 Luna (OpenAI's replacement for all four) $0.10 $0.01 $0.50

Our arithmetic on OpenAI's list prices: GPT-4o mini to GPT-6 Luna is about a third cheaper on input and a sixth cheaper on output; from GPT-4o or GPT-4.1 the per-token drop is much larger. OpenAI's help article says the same in general terms ("a lower per-token price") and adds that token usage and reasoning settings affect the cost of each task. With effort above none, the reasoning tokens are billed as output, so compare a day of real usage after switching.

Luna also bills cache writes ($0.125 per million tokens), and prompts over 272K input tokens are priced at 2× input and 1.5× output for the whole request, per its model page. Batch and Flex are half the Standard price.

Replit, Lovable and other builders

Replit: apps that use Replit AI Integrations ("OpenAI (Replit managed)") call OpenAI models with Replit's credentials, billed to your Replit credits at the public API price. On 3 December Replit's model list still included gpt-4o, gpt-4o-mini, gpt-4.1, gpt-4.1-mini and even gpt-4.1-nano, which OpenAI already shut down; Replit says the list is refreshed bi-weekly and availability can change between refreshes. Replit hasn't published what happens to requests for these models after 14 January, so ask Agent to switch them to gpt-6-luna (which is on Replit's list) and test the feature.

Lovable: Lovable's built-in AI follows Lovable's own retirement list, which on 3 December listed no GPT-4o or GPT-4.1 chat models (only GPT-4o mini TTS on 6 Jan 2027 and the GPT-4o transcription models on 26 Feb 2027). The 14 January date matters for Lovable apps that call OpenAI with your own API key, usually in a Supabase Edge Function. Prompt the project chat, for example "Switch every gpt-4o and gpt-4o-mini call to gpt-6-luna with reasoning_effort none", then publish and test.

Bolt, v0, Grok Build (formerly Cursor), Claude Code: if the app calls OpenAI with your own key, the code change above is the whole fix. Redeploy the function or site after changing it (for Supabase: supabase functions deploy <name>).

Azure OpenAI, Vercel AI Gateway, OpenRouter and other gateways set their own schedules; we didn't check them. Look at your provider's model list.

Test the new model before you deploy

Send one request with the new model ID and your real settings before you change production. Set OPENAI_API_KEY in your terminal first. A 200 response means the ID and settings are accepted; add your temperature or tools to the test body to check those too. The second command reads a model's shutdown_date, which OpenAI documents as an optional field. Then deploy and run the feature once in the live app.

Terminal
# 1. Does GPT-6 Luna accept your settings?
curl https://api.openai.com/v1/chat/completions \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-6-luna",
    "reasoning_effort": "none",
    "max_completion_tokens": 200,
    "messages": [{"role": "user", "content": "Say hello"}]
  }'

# 2. When does a model shut down? (look for shutdown_date)
curl https://api.openai.com/v1/models/gpt-4o-mini \
  -H "Authorization: Bearer $OPENAI_API_KEY"

Confirmed vs not published

What the vendors have and haven't documented (checked 3 Dec 2026)
QuestionStatus
GPT-4o, GPT-4o mini, GPT-4.1 and GPT-4.1 mini snapshots shut down on the OpenAI API on 14 Jan 2027; fine-tunes follow Confirmed (OpenAI deprecations page, notice date 14 Oct 2026)
gpt-4o, gpt-4o-mini, gpt-4.1, gpt-4.1-mini aliases are Deprecated and point to those snapshots Confirmed (OpenAI model pages)
Recommended replacement gpt-6-luna; start with reasoning effort none Confirmed (OpenAI deprecations page and help article "Migrating from GPT-4.x to GPT-6 Luna")
Luna defaults to medium; Chat Completions tools only with none; no fine-tuning Confirmed (OpenAI GPT-6 Luna model page and reasoning guide)
Whether Luna accepts temperature, top_p, max_tokens or Predicted Outputs Not stated on the Luna model page; test your request
Reason for three months' notice instead of the six-month policy minimum Not published
Time of day of the shutdown and the exact error returned Not published
List prices in the cost table Confirmed (OpenAI pricing and model pages, 3 Dec 2026)
What Replit AI Integrations does with these models after 14 Jan Not published; the models were still listed on 3 Dec
Lovable built-in AI affected No GPT-4o/4.1 chat models on Lovable's deprecated list (3 Dec)
Azure OpenAI, Vercel AI Gateway, OpenRouter schedules Not checked

Common questions

When does GPT-4o stop working in the OpenAI API?

On 14 January 2027, together with GPT-4o mini, GPT-4.1 and GPT-4.1 mini, their dated snapshots and fine-tunes. OpenAI doesn't publish a time of day, so switch by 13 January.

What should I replace gpt-4o-mini with?

OpenAI recommends gpt-6-luna for all four models. Set reasoning_effort to none, use max_completion_tokens instead of max_tokens, and test any temperature setting. It lists at $0.10 input and $0.50 output per million tokens versus $0.15 and $0.60 for GPT-4o mini.

Can I just change gpt-4o to gpt-6-luna?

Not safely. Without a reasoning setting Luna uses medium reasoning, which is slower and bills extra output tokens, and Chat Completions only supports tool calling on Luna with reasoning_effort none. Add reasoning_effort none in the same change.

Is gpt-4.1-nano also shutting down on 14 January?

No, it already shut down on 23 October 2026. If your app still calls gpt-4.1-nano, that feature is failing now.

What happens to my fine-tuned GPT-4o or GPT-4.1 model?

It stops on 14 January 2027 with its base model. GPT-6 Luna doesn't support fine-tuning and OpenAI stops new self-serve fine-tuning jobs on 15 December 2026, so plan to replace it with prompting and test on Luna.

Does this affect my Replit app?

If it uses OpenAI through Replit AI Integrations or your own key with one of these models, yes. Replit hasn't said what happens after 14 January, so ask Agent to switch to gpt-6-luna and test.

Related on VibeLiftoff