Find gpt-image-1 in your repo before Oct 23: a Python scan

OpenAI shuts gpt-image-1 down on 2026-10-23, five weeks before the other GPT Image ids. A Python scan splits them by date and maps each hit to a Sume model id.

5 min readSume
All posts

To find every gpt-image-1 call in a codebase, grep for the exact id and exclude its siblings: a plain search for gpt-image-1 also matches gpt-image-1-mini and gpt-image-1.5, which retire on a different day. OpenAI's deprecations page (read 2026-10-05) lists gpt-image-1 with a shutdown date of October 23, 2026, announced on April 22, and names gpt-image-2.5-sunburst or gpt-image-2.5-flare as the replacement. That is 18 days from today.

The three other ids on the same page, gpt-image-1-mini, gpt-image-1.5 and chatgpt-image-latest, were announced on June 2 and shut down on December 1, 2026, which is 57 days out. The script below prints one line per hit and tags each with the date it dies, so you can fix the October 23 hits first. Treat hits in tests, fixtures and docs the same way as hits in production code: a fixture that names a retired id keeps passing until the day a live call replays it, and then fails with no code change on your side.

Which id dies when

Use this table to sort scan output. Every row names the same two replacements, so the dates are the only thing that changes your order of work.

OpenAI image id shutdown dates, read 2026-10-05
IdAnnouncedShutdownReplacement
gpt-image-12026-04-222026-10-23gpt-image-2.5-sunburst or gpt-image-2.5-flare
gpt-image-1-mini2026-06-022026-12-01gpt-image-2.5-sunburst or gpt-image-2.5-flare
gpt-image-1.52026-06-022026-12-01gpt-image-2.5-sunburst or gpt-image-2.5-flare
chatgpt-image-latest2026-06-022026-12-01gpt-image-2.5-sunburst or gpt-image-2.5-flare

The scan

The scan reads any text file under 1 MB, so it also finds ids in .env.example, YAML, Terraform, notebooks stored as JSON, and test fixtures. It skips .git, node_modules, .venv and dist; add your own generated-code directories to SKIP if the output is noisy.

The first pattern matches gpt-image-1 only when it is not followed by a word character, a hyphen, or a dot and a digit, and not preceded by one. That keeps openai/gpt-image-1 and quoted strings, and drops gpt-image-1-mini, gpt-image-1.5 and gpt-image-10. Run it from the repo root: python scan.py .

import pathlib
import re
import sys

EARLY = re.compile(r"(?<![\w.-])gpt-image-1(?![\w-]|\.\d)")
LATE = re.compile(
    r"(?<![\w.-])(gpt-image-1-mini|gpt-image-1\.5|chatgpt-image-latest)(?![\w-])"
)
SKIP = {".git", "node_modules", ".venv", "dist"}


def scan(root):
    for path in pathlib.Path(root).rglob("*"):
        if path.is_dir() or SKIP & set(path.parts) or path.stat().st_size > 1_000_000:
            continue
        try:
            lines = path.read_text(encoding="utf-8").splitlines()
        except (UnicodeDecodeError, OSError):
            continue
        for number, line in enumerate(lines, 1):
            if EARLY.search(line):
                print(f"2026-10-23  {path}:{number}: {line.strip()[:90]}")
            elif LATE.search(line):
                print(f"2026-12-01  {path}:{number}: {line.strip()[:90]}")


scan(sys.argv[1] if len(sys.argv) > 1 else ".")

What to put in its place on Sume

Sume's Image API lists ChatGPT Image 2.5 as openai/gpt-image-2.5 (Flare) and openai/gpt-image-2.5-sunburst. The catalog has no gpt-image-1 row, so a string swap is the first step and not the last one. Both ids take text-to-image, up to 16 image references, an optional mask_url, and background: auto|transparent|opaque.

If you only want the replacement to work and have no preference between the two, either id satisfies OpenAI's note. Auto routing on Sume uses Flare, per the Image API page. Sunburst and Flare use the same Fal token rates on Sume, so the choice does not change the price.

Check each hit before you replace it

For every line the scan prints, read the request around it. These are the fields that most often need a change.

  • quality: if you omit it, Sume defaults to high for ChatGPT Image 2.5. low, medium and high are still valid, and auto, xhigh and max are new. auto reserves the max price.
  • Size: custom sizes need both edges as multiples of 16, a longest edge of 3840 at most, an aspect ratio up to 3:1, and between 655,360 and 8,294,400 pixels. OpenAI's image generation guide (read 2026-10-05) lists the same rules and recommends 1024x1024, 1536x1024 and 1024x1536.
  • Parameters the catalog does not list: Sume answers 400 unsupported_parameter and does not drop the field silently, so a leftover option fails loudly in your first test.
  • Output: Sume returns hosted URLs in data[].url, not inline base64, so code that decodes b64_json needs a download step instead.

Next step

Commit the scan output as a checklist, replace the October 23 hits first, and run one low-quality call per code path against openai/gpt-image-2.5 to confirm the request is accepted. If a call is slow, Sume returns 202 with a job envelope instead of an image; poll it as described in Jobs and results. Then move the December 1 ids in the same pass, since the replacements are identical.

To keep the check honest after the fact, count the October 23 hits and exit with a non-zero status when the count is above zero. Run that in CI from now on, and a stray gpt-image-1 added by a branch that predates this work fails the build instead of failing in production.

Sources

Related posts

More in Developers

All Developers posts

Written by Sume