Does lookup need an API key?
No. The files are public and static. The field list is on API docs.
A retired model can keep a job green if the caller swallows the error or answers HTTP 200 anyway. Look up each configured id on the free SunsetDiff lookup API before startup or CI. Fail when status is retired or an exact or via_snapshots shutdown date is already past. When a live call says the model is missing, stop retrying that id.
Last reviewed . Publisher: SunsetDiff.
OpenAI's deprecations page says access to gpt-4.1-nano was shut down on October 23, 2026. At shutdown, the model is no longer accessible. GitHub issue AlejandroFuentePinero/digital-twin#54 describes a deployed app that kept calling that id after the shutdown. Issue #57 asks the startup check to fail when a configured model is gone.
GitHub issue bobmatnyc/joanies-kitchen#24 describes recipe pages that answered HTTP 200 while the model call had already failed. The visitor saw a normal page. The log had the failure.
GitHub issue ahaqqu/RumaQ#306 describes a Gemini 404 that the retry loop treated as temporary. GitHub issue Ghigog/Juice#421 asks a worker to stop retrying permanent Groq failures. Those issues are examples. The error codes below come from the provider pages, not from the issues.
Sources: OpenAI deprecations , GitHub issue AlejandroFuentePinero/digital-twin#54 , GitHub issue AlejandroFuentePinero/digital-twin#57 , GitHub issue bobmatnyc/joanies-kitchen#24 , GitHub issue ahaqqu/RumaQ#306 , GitHub issue Ghigog/Juice#421 , checked October 29, 2026.
Lookup is one public file per model id: the API docs. No API key. The body is one model record, or an array when several providers share the id. Check every row. The fields used here are status, shutdown_date, and shutdown_date_kind. sources[0].url is the official page. Read it before you migrate.
Percent-encode the id with encodeURIComponent, or urllib.parse.quote(model_id, safe="") in Python. A colon becomes %3A and a slash becomes %2F, so the id stays one path segment. anthropic.claude-3-haiku-20240307-v1:0 is the colon example. A slash id uses %2F the same way. A raw colon also works. A 404 from lookup means the id is not in this dataset. It does not mean the provider retired it.
Fail when status is retired, or when shutdown_date_kind is exact or via_snapshots and shutdown_date is before today. not_before is a floor, not a deadline, so this check does not fail on it. month_only and none are not an exact day either. Check model shutdown dates programmatically lists the other fields. The sample list includes gpt-4.1-nano, which this dataset stores as retired. Running the sample as written exits with a failure. Replace the list with your ids.
import json
import urllib.error
import urllib.parse
import urllib.request
from datetime import datetime, timezone
def lookup(model_id):
safe_id = urllib.parse.quote(model_id, safe="")
url = f"https://sunsetdiff.com/api/v1/lookup/{safe_id}.json"
with urllib.request.urlopen(url) as response:
return json.load(response)
def gone(row, today):
if row.get("status") == "retired":
return True
shutdown = row.get("shutdown_date")
return row.get("shutdown_date_kind") in ("exact", "via_snapshots") and bool(shutdown) and shutdown < today
def main():
today = datetime.now(timezone.utc).date().isoformat()
model_ids = [
"gpt-4.1-nano",
"anthropic.claude-3-haiku-20240307-v1:0",
]
failed = []
for model_id in model_ids:
try:
body = lookup(model_id)
except urllib.error.HTTPError as error:
if error.code == 404:
print(f"{model_id}: not in the SunsetDiff dataset")
continue
raise
rows = body if isinstance(body, list) else [body]
for row in rows:
if gone(row, today):
failed.append(
f"{row['provider']} {row['id']} status={row['status']} shutdown_date={row['shutdown_date']}"
)
if failed:
raise SystemExit("retired or past shutdown:\n" + "\n".join(failed))
if __name__ == "__main__":
main()
const modelIds = [
"gpt-4.1-nano",
"anthropic.claude-3-haiku-20240307-v1:0",
];
function gone(row, today) {
if (row.status === "retired") return true;
return (row.shutdown_date_kind === "exact" || row.shutdown_date_kind === "via_snapshots") && row.shutdown_date && row.shutdown_date < today;
}
async function main() {
const today = new Date().toISOString().slice(0, 10);
const failed = [];
for (const modelId of modelIds) {
const url = "https://sunsetdiff.com/api/v1/lookup/" + encodeURIComponent(modelId) + ".json";
const response = await fetch(url);
if (response.status === 404) {
console.log(modelId + ": not in the SunsetDiff dataset");
continue;
}
if (!response.ok) throw new Error(modelId + " lookup HTTP " + response.status);
const body = await response.json();
const rows = Array.isArray(body) ? body : [body];
for (const row of rows) {
if (gone(row, today)) {
failed.push(row.provider + " " + row.id + " status=" + row.status + " shutdown_date=" + row.shutdown_date);
}
}
}
if (failed.length) {
console.error(failed.join("\n"));
process.exit(1);
}
}
main();
Source: SunsetDiff API docs , checked October 29, 2026.
Retry a rate limit or a 5xx. Do not retry an id the provider says is missing. The sentence in the table is on the linked official page. Where that page does not print a code, the row says so.
| Provider | What the official page says | What to do |
|---|---|---|
| OpenAI | The error codes page lists NotFoundError as requested resource does not exist. It does not name a code model_not_found. The deprecations page says that at shutdown the model will no longer be accessible. | Do not retry a not-found response. Change the id before the shutdown date. |
| Anthropic | The errors page says HTTP 404 is not_found_error, and the example message is The requested resource could not be found. The SDK retries connection errors, rate limits, and 5xx. The deprecations page says a retired model is no longer available and requests to retired models fail. It does not name not_found_error. | Do not retry a 404 not_found_error. Read the body. The deprecations page does not say every retired id uses that type. |
| Gemini | The deprecations page says that once a model is shutdown, it is completely turned off and the endpoint is no longer available. That page does not print one error code for every model. | After shutdown, stop calling that id. Recorded 404 sentences are on the Gemini error pages. |
| Groq | The errors page says 404 Not Found means the requested resource could not be found. It does not print a code named model_decommissioned. The deprecations page says that after the deprecation date the model will no longer be accessible, and requests to deprecated model ids will return errors. | Do not retry a 404 for that id. Do not invent an error code the errors page does not print. |
| OpenRouter | The errors page says error_type not_found is HTTP 404: the requested resource (model, file, etc.) does not exist. It also says to check the body for an error field even on a 200. The models page says a single-model lookup returns 404 if the model does not exist. The variants page says a missing catalog entry returns 404, or HTTP 200 with an empty endpoints array, and to treat either as unavailable rather than a reason to retry the base slug. Those pages do not print the sentence no longer available on OpenRouter. | Do not retry not_found. Read a 200 body before you treat the call as success. |
Sources: OpenAI error codes , OpenAI deprecations , Anthropic errors , Anthropic model deprecations , Gemini API deprecations , Groq API error codes , Groq model deprecation , OpenRouter errors , OpenRouter models , OpenRouter model variants , checked October 29, 2026.
The GitHub Action scans files in the pull request. It reports an id whose status is retired, deprecated, or legacy. It also reports another status when the shutdown date is inside warn-days and the date kind is not not_before. The job fails when the status is retired, or the shutdown date is inside fail-days.
Use the Action when the ids are in the repo. Use the snippets above when the ids live in a host config the Action's file glob does not read. Both read the same status and shutdown_date fields.
Sources: SunsetDiff GitHub Action , SunsetDiff API docs , checked October 29, 2026.
No. The files are public and static. The field list is on API docs.
The id is not in the SunsetDiff dataset. That is not a provider retirement. A colon must be %3A and a slash %2F if you encode the id. A raw colon also resolves.
No. shutdown_date_kind not_before is a floor, not a deadline. The snippets fail on status retired, and on an exact or via_snapshots shutdown_date that is already past.
Groq's error codes page does not print model_decommissioned. It says 404 means the requested resource could not be found. The deprecations page says requests to a deprecated model id return errors after the shutdown date, and it does not name the code.