AI 模型 API 弃用解析:模型退役时你的代码会坏在哪里
API deprecation for AI models: what breaks when a model is retired
作者解析 OpenAI 与 Anthropic 的模型弃用机制:两家都用 active→legacy→deprecated→retired 四态生命周期,OpenAI 承诺 GA 模型至少 6 个月通知、预览版可能仅 2 周,Anthropic 承诺至少 60 天且过去一年退役了 9 个 Claude 模型。
原文梳理了 OpenAI 与 Anthropic 的模型退役机制、通知窗口和三种故障模式,并给出可落地的迁移检查清单。
API deprecation used to mean an endpoint would change shape. For AI models it means the thing that answers your requests stops existing. OpenAI's deprecations page lists about fifty model snapshots with a shutdown date between September 24 and December 11, 2026, GPT-4 among them. Anthropic retired nine Claude models in twelve months. This is how model deprecation works under the hood: the lifecycle, what breaks in your code on the morning after, what "weights preservation" actually preserves, and why an open model can be saved by a torrent when a closed one can't be saved at all.
TL;DR
- Both big vendors use the same four states: active → legacy → deprecated → retired. Retired means requests fail.
- Notice windows: OpenAI promises at least 6 months for a generally available model, 3 for a specialised variant, and "much shorter notice, such as 2 weeks" for previews. Anthropic promises at least 60 days, and its recent retirements got about that.
-
What breaks: a pinned snapshot dies loudly with a 404
model_not_found. An alias upgrades silently and your evals drift. Parameter deprecations break code that never changed models. - Weights preservation: Anthropic commits to keep the weights of every public model for the lifetime of the company, and to interview each model before retirement. It does not commit to act on the interview or to release any weights.
- Open weights are different: Pirate Face mirrors about 669,000 Apache and MIT models from Hugging Face as torrents. It can only save what was published.
What is model deprecation? The four states
The vocabulary comes from the vendors' own pages: OpenAI's deprecations page and Anthropic's model deprecations page.
| State | What it means | Your requests |
|---|---|---|
| Active | Current model, supported | work |
| Legacy | No more updates | work |
| Deprecated | Announced, with a replacement and a shutdown or retirement date | work, until the date |
| Retired (OpenAI: "shut down" / "sunset") | Gone | fail |
Anthropic adds one thing OpenAI doesn't: every active model carries a "Tentative retirement date" from launch, "Not sooner than" roughly a year later. For example, claude-opus-4-6 shows not sooner than February 5, 2027. You know the expiry date on the day you adopt the model.
API deprecation policies: OpenAI vs Anthropic notice windows
| OpenAI | Anthropic | |
|---|---|---|
| General model | ≥ 6 months | ≥ 60 days |
| Specialised variant (chat, codex, deep research) | ≥ 3 months | — |
| Preview | "much shorter notice, such as 2 weeks" | — |
| Can be shortened | yes, for safety or compliance | — |
| After shutdown | dedicated capacity "in some cases — contact sales" | — |
Anthropic's measured windows over the past year: Opus 4.1 got 61 days (June 5 to August 5, 2026), Sonnet 4 and Opus 4 got 62, Sonnet 3.7 about four months, Opus 3 about six. So the 60-day floor is also the usual number now.
Two caveats matter in practice. Anthropic's dates apply to its own platforms: "Bedrock and Google Cloud set their own schedules", so the same model can die on different days depending on where you call it. And anything with "preview" in the name is a warning label in itself. Two weeks is barely one sprint.
The 2026 retirement calendar: GPT-4, Sora 2 and the last GPT-3 names
What is actually on the list this autumn, from the OpenAI page:
| Shutdown | What | Replacement |
|---|---|---|
| Sep 24, 2026 | Sora 2 (sora-2, sora-2-pro, all snapshots) and the whole Videos API |
--- |
| Sep 28, 2026 |
babbage-002, davinci-002, gpt-3.5-turbo-instruct, gpt-3.5-turbo-1106
|
announced Sep 2025 |
| Oct 23, 2026 |
gpt-4, gpt-4-turbo, gpt-3.5-turbo, gpt-4o-2024-05-13, o1, o1-pro, o3-mini, o4-mini, gpt-image-1
|
GPT-5.6 Sol / Terra / Luna |
| Feb 26, 2027 | whisper-1 |
announced Aug 2026 |
The Sora row is the one to look at. Announced March 24, six months of notice, as promised, and the replacement column reads three dashes. A deprecation notice guarantees you time; the successor is up to the vendor. The September 28 batch retires the last GPT-3-era names. The page itself lists 32 deprecation announcements since June 2023.
Anthropic's past twelve months: two Claude 3.5 Sonnet snapshots (October 2025), Claude 3 Opus (January), Claude 3.7 Sonnet and 3.5 Haiku (February), Claude 3 Haiku (April), Claude Sonnet 4 and Opus 4 (June), Opus 4.1 (August). Nine models.
What breaks when a model is retired
Three failure modes, from loud to quiet.
1. The pinned snapshot: a loud 404. On the morning after, a call to a retired model returns HTTP 404 with type: invalid_request_error and code: model_not_found. The message, as quoted verbatim in public issue trackers (commitgpt #42, builder #2):
The model 'text-davinci-003' has been deprecated, learn more here: https://platform.openai.com/docs/deprecations
The link goes to a table. This is the good failure: it is loud, it happens on a known date, and your monitoring sees it.
2. The alias: a silent upgrade. An alias like gpt-4o points at whatever snapshot the vendor currently maps it to. When that changes, nothing fails. A different model is answering, and your prompts, parsers and evals drift without an error. The sketch from the video:
# pinned: dies loudly on retirement day
model = "gpt-4o-2024-05-13" # 404 model_not_found (shutdown Oct 23, 2026)
# alias: upgrades silently, evals drift
model = "gpt-4o"
3. The parameter deprecation: a 400 on code that never changed. Per Anthropic's page, temperature, top_p and top_k return a 400 error when set to a non-default value on Claude 4.7 and newer, and the Python SDK from v1.0 removed them, so the old call raises a TypeError. The line you added to pin your randomness is the line that breaks when you move to the replacement.
Why do AI labs retire models at all?
Anthropic states it plainly: "Anthropic currently deprecates and retires models to ensure capacity for new model releases." Its commitments post adds that "the cost and complexity to keep models available publicly for inference scales roughly linearly with the number of models we serve."
That is the whole economics. Every model a lab serves takes capacity, and each extra one adds roughly the same cost again. A lab that keeps every model alive spends its capacity on the past. So models get a lifetime, and the only open question is how much warning you get.
Weights preservation: what Anthropic promises, and what it doesn't
In November 2025 Anthropic published "Commitments on model deprecation and preservation". The commitments:
- Preserve "the weights of all publicly released models, and models in significant internal use, for at minimum the lifetime of Anthropic as a company".
- On deprecation, write a post-deployment report and, "in one or more special sessions, we will interview the model about its own development, use, and deployment", documenting its preferences about future models.
The limits, in the same post: "At present, we do not commit to taking action on the basis of such preferences." Keeping retired models publicly available is "more speculative", only "as we reduce the costs". And there is no commitment to release weights. The stated reasons include shutdown-avoidant behaviour seen in alignment evaluations, users who value a model's character, research access, and, "most speculatively", model welfare. The pilot: Claude Sonnet 3.6 was interviewed before retirement, "expressed generally neutral sentiments", and asked for a standardised interview process and a support page for users.
Users are less neutral. When Claude 3 Sonnet was retired in July 2025, Wired reported that more than 200 people held a funeral for it in a San Francisco warehouse, with mannequins for each model.
The counter-argument is Cory Doctorow's "The Claude Delusion": "when we interact with an AI, we hallucinate the person on the other side of the interaction." He warns that extending personhood to models repeats the mistake of corporate personhood, and ends: "Chatbots are marvels of mathematics, and that is enough. They don't need to be people." On that view, the exit interview is a conversation with a file.
Both can be true, and that is the problem for developers. The weights are a file worth preserving, and the vault that preserves them has one key. Nobody outside the building can ever run a retired closed model again.
Why open weights survive: how Pirate Face works
A closed model is one copy, in one lab, behind one API. When the API stops, nothing is left to run. An open model is a file with a hash, and a file with a hash can be copied by anyone.
Pirate Face, 545 points on Hacker News, turns that into infrastructure. It mirrors Apache-2.0 and MIT models from Hugging Face as magnet links. The clever part is the BitTorrent web seed (BEP-19): the web seed for each torrent is the Hugging Face file itself.
while Hugging Face serves the file -> clients download from Hugging Face (web seed)
the day Hugging Face removes it -> clients download from the swarm
every file -> SHA-256-verified against Hugging Face's own hash
(Simplified sketch of the mechanism, not Pirate Face's code.) The site says 669k+ models are eligible, and advertises a "drop-in API" via HF_ENDPOINT, marked "soon". Its mission article cites the precedent: when Meta sunset Papers with Code in July 2025, 79,817 paper-to-code links stopped resolving.
On HN, phoyd: "Torrents should really be the preferred method for distributing AI model weights… BitTorrent was made for exactly this." The timing matters too: Nvidia agreed this month to buy Hugging Face for almost $13 billion. Nothing has been removed. The single host of the open commons is simply changing owner.
The limit is the point: Pirate Face can only rescue what was published. A licence can be revoked or gated, but a copy already on your disk, with its hash, keeps working.
A model deprecation checklist for developers
What I would do on Monday:
- Pin a dated snapshot, never an alias. Then death is loud, dated and on your calendar.
- Run your evals against the replacement the day the notice lands, while the whole window is still ahead. On Anthropic that is 60 days, on an OpenAI preview maybe 14.
- Wire a fallback model from another vendor behind one flag. The same model can retire on different days on the vendor's API, Bedrock and Vertex.
- Audit usage by model. Anthropic's Console exports a CSV by key and model under Usage; find every caller of a model well before its date.
- Keep a local copy of any open model you depend on, with its hash. The local AI box I told you to build now has a second job.
A simplified sketch of point 3, illustrative only:
# illustrative sketch: one config, one flag, dated snapshots only
MODELS = {
"primary": {"vendor": "openai", "model": "gpt-4o-2024-05-13"}, # dies Oct 23, 2026
"fallback": {"vendor": "anthropic", "model": "<a dated Claude snapshot>"},
}
USE = "fallback" if feature_flag("llm_fallback") else "primary"
Verdict: NEEDS REVIEW
I stamped model deprecation NEEDS REVIEW. The pipeline is documented, the states are clear and the notice is real; OpenAI's six months and Anthropic's 60 days are kept. What needs review is the end of it. A replacement column can read ---, and weights preservation means the vault has one key, and it is not yours. If you can't afford to lose a model, the only copy that counts is one you can run.
FAQ
What happens when an OpenAI model is deprecated?
It keeps working until its shutdown date. After that, requests return HTTP 404 with model_not_found and a link to the deprecations page.
How much notice does Anthropic give before retiring a Claude model?
At least 60 days for publicly released models, and every model shows a tentative retirement date from launch. Bedrock and Google Cloud set their own schedules.
When is GPT-4 being shut down?
October 23, 2026, together with gpt-4-turbo, gpt-3.5-turbo, o1 and others, per OpenAI's deprecations page.
Can a retired AI model be recovered?
A closed model, no: its weights never leave the lab. An open-weights model can be re-downloaded from any mirror that kept the file and its hash.
Sources
- OpenAI, Deprecations: https://platform.openai.com/docs/deprecations
- Anthropic, Model deprecations: https://docs.anthropic.com/en/docs/about-claude/model-deprecations
- Anthropic, Commitments on model deprecation and preservation: https://www.anthropic.com/research/deprecation-commitments
- The 404 error in the wild: https://github.com/RomanHotsiy/commitgpt/issues/42 and https://github.com/dataprofessor/builder/issues/2
- Wired, the Claude 3 Sonnet funeral: https://www.wired.com/story/claude-3-sonnet-funeral-san-francisco/
- Cory Doctorow, The Claude Delusion: https://pluralistic.net/2026/09/21/sunsetting/
- Pirate Face: https://pirateface.co/
- Pirate Face, Making models permanent: https://pirateface.co/articles/making-models-permanent
- Hacker News on Pirate Face: https://news.ycombinator.com/item?id=49776699
- CNBC, Nvidia to buy Hugging Face: https://www.cnbc.com/2026/09/03/nvidia-agrees-to-buy-hugging-face-for-almost-13-billion-ai-expansion.html
This article expands on an episode of **The Daily Diff, a five-minute daily video on what shipped and what broke in tech.
Watch the episode · Subscribe on YouTube · the written diff lands in your inbox every morning at thedailydiff.dev.
来源:Google AI:DEV 作者专属(RSS) · dev.to
