chatgpt-imagegen: Generate Images From the ChatGPT Subscription You Already Pay For
Use your ChatGPT subscription to generate images from the command line — no OPENAI_API_KEY, no gateway, no daemon. Zero-dep Python CLI + AI-agent skill.
At a glance
- What is it?
- A zero-dependency Python CLI that drives a logged-in ChatGPT session instead of an API key, plus two Gemini-backed fallbacks. The design is unusual and the trade-offs are real: no daemon, no key, but also no headless guarantee.
- Who is it for?
- Adopt chatgpt-imagegen if you already hold a ChatGPT subscription and want image generation inside a shell script, a Makefile, or an AI agent skill without provisioning an API key or standing up a gateway. Skip it if you need a headless server process with a contractual SLA, or if your pipeline must run on a machine that never has a signed-in browser session, because the default web backend depends on one.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 1 day ago.
- What is it written in?
- Mainly Python, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.
DEEP OPEN-SOURCE ANALYSIS
The problem chatgpt-imagegen solves, and who actually feels it
Most image generation tooling assumes you hold an API key and pay per call. That is a fine assumption for a product, and a bad one for a person who already pays for ChatGPT and wants a PNG in a build directory. chatgpt-imagegen exists for that second case. The README states the goal plainly: generate images with your ChatGPT subscription, with no OPENAI_API_KEY and no gateway and no daemon. The default backend drives the normal ChatGPT web chat, and the README notes that even free-tier users get image generation there, so a paid plan is not strictly required for the default path.
The audience is narrower than the tagline suggests. This is for developers who script things. Someone writing a README and wanting a hero banner, someone generating placeholder art in a CI-adjacent workflow, someone wiring an image step into Claude Code or Codex as a skill. The README ships a SKILL.md at the repository root precisely for that agent use case. If you want a hosted image endpoint that other services call, this is not that, and the README does not pretend otherwise.
How the backend model works: web chat driving, codex, gemini, agy
The architecture is a single Python file using only the standard library, with the image work delegated to one of four named backends. The default is `web`, which drives your logged-in Chrome and, per the README, spends no Codex usage. The second OpenAI path is `codex`, described as a headless fallback. Two further backends use Google instead: `--backend gemini` drives a logged-in gemini.google.com Chrome session, and `--backend agy` uses the Antigravity CLI headlessly. The README says the Gemini backends bill separate quotas from each other, so either can cover for the other, and that neither is ever chosen automatically. You have to ask for them by name.
The data flow is therefore not a REST call to an image endpoint. It is a prompt handed to a chat surface, and an image read back out. That explains several of the CLI's oddities. Because the web and Gemini surfaces expose no image-generation controls, the GPT Image 2.5 knobs (`--image-model`, `--quality`, `--background`, `--compression`, `--action`, `--partial-images`) are codex-only and are described as requests rather than guarantees. The README is explicit that the codex backend rewrites these server-side, observed as `gpt-image-2-codex` and `auto`, so they rarely survive there. What does matter on codex is `--model`, which selects the driver model that calls the tool, defaulting to `gpt-5.6-luna`.
That distinction between requested and actual parameters is the most useful thing in the documentation. Every run prints a saved line showing the `model=`, `quality=` and `size=` the backend actually used, and codex runs also print the `tokens=` they cost. If you are building anything automated, parse that line rather than trusting your flags.
Installing chatgpt-imagegen and generating a first image
There are two install paths. For AI agents the README recommends the skills manager, which drops the skill into Claude Code, Codex, Cursor and similar tools:
npx skills add leeguooooo/chatgpt-imagegen -gAfter that you ask the agent in natural language rather than calling the binary yourself. For a standalone CLI the README avoids pip entirely and installs the single script onto your PATH. The repository root contains an executable named `chatgpt-imagegen`, and the README's clone-and-install sequence is:
git clone https://github.com/leeguooooo/chatgpt-imagegen
sudo install chatgpt-imagegen/chatgpt-imagegen /usr/local/bin/chatgpt-imagegenPython 3.10 or newer is required. Before generating anything, run the doctor subcommand, which reports which backends and which optional external tools are ready:
chatgpt-imagegen doctorThen the basic invocation, which is a prompt plus an output path:
chatgpt-imagegen "a watercolor cat sitting on a windowsill" -o cat.pngThe README shows the expected result as a saved line reporting the path, the byte count, and the size and quality the backend used. Two options are worth knowing early. `--size` takes values such as `1536x1024`, and `-i` supplies a reference image so the prompt can refer to a subject already in a file:
chatgpt-imagegen "moody mountain sunset" -o web/hero.png --size 1536x1024
chatgpt-imagegen "make it a warm golden-hour photo, cinematic 35mm" -i photo.jpgIf you want the path captured in a variable rather than printed to the terminal, the README's pattern is `OUT=$(chatgpt-imagegen "icon" --quiet)`.
The animate subcommand and its external dependencies
`animate` is the most opinionated part of the tool and the part most likely to fail on a fresh machine. The README describes the mechanism: it asks the image model for a strict 4x2 sprite sheet, crops eight equal frames, rejects obvious subject drift, and writes a smooth ping-pong loop. Output defaults to animated WebP, with `--animation-format gif` or `--also-gif` for GIF compatibility. The source sprite PNG is always kept beside the animation, which is a sensible choice because it lets you re-crop without regenerating.
The constraint is that post-processing is not self-contained. Animation needs ImageMagick, specifically the `magick` command, and WebP output additionally needs libwebp, specifically `img2webp`. Neither ships with Python. The README points at `chatgpt-imagegen doctor` as the way to check whether both are installed, which is the right first move before you build `animate` into anything. A pipeline that works on your laptop can break on a container image that has Python and nothing else.
There is also a quality caveat the README states for the Gemini path that applies to generated art generally: Gemini text-to-image output carries a visible watermark in the bottom-right corner, while image-to-image does not. If the watermark matters for your use case, that backend is the wrong choice for text-to-image work, and the README does not offer a way to remove it.
Where chatgpt-imagegen is the wrong tool
The web backend is the default and it depends on a logged-in Chrome session. That is the central limitation, and it is structural rather than a bug. Anything that needs to run unattended on a server with no browser profile, or in a container that has never been signed in to ChatGPT, cannot use the default path. The `codex` backend is offered as a headless fallback, but it consumes the metered Codex bucket, which is a different cost model from the subscription-flat-rate pitch that makes the project appealing in the first place. The README itself warns that a frontier coding model as the driver just burns that bucket, which is why the default driver is `gpt-5.6-luna`.
Parameter control is the second weak point. The GPT Image 2.5 knobs are codex-only and, per the README, are requests that the codex backend rewrites server-side, observed as `gpt-image-2-codex` and `auto`. If your workflow depends on a specific model or quality setting being honoured, this tool cannot promise it on any backend. It reports what it got, which is honest, but reporting is not the same as controlling.
Finally, the Gemini backends require pinning a Chrome profile with `--gemini-profile`, and the README notes why: most profiles are signed in to some Google account, so the wrong one gets picked unless you say which. And on the Gemini path `--size` steers aspect ratio rather than exact pixel count, so a script that assumes a fixed output dimension will not behave the same way across backends.
chatgpt-imagegen compared with the API-key route
The obvious alternative is the OpenAI Images API with an API key, and the difference is not just billing. An API key gives you a documented endpoint with stable parameters, per-call pricing you can forecast, and no dependency on a browser session. It works from a server, from a container, from a cron job, with no logged-in human anywhere in the loop. If you are shipping a product that generates images for users, that is the route, and chatgpt-imagegen is not competing for it.
What chatgpt-imagegen offers instead is the absence of provisioning. No key to create, rotate, or leak. No per-call invoice for a personal script that runs twice a week. The README's own framing, no gateway and no daemon, is the pitch: one file, stdlib only, installed with `install` rather than pip. For a solo developer or an agent skill, that is a real reduction in moving parts.
The Gemini backends make a second comparison available inside the same tool. The README states that the Gemini paths bill separate quotas from each other, so a Gemini subscriber can use `--backend gemini` or `--backend agy` as cover when the OpenAI side is unavailable. That is a resilience argument, not a quality argument, and the watermark on Gemini text-to-image output is the price of using it.
Maintenance, self-update, and the MIT licence
The repository is not archived, and the last push was on 2026-09-11, three days before this writing. Releases v0.25.0, v0.26.0 and v0.27.0 all landed on that same day, which tells you the version cadence is fast and the project is moving. Fast cadence cuts both ways: fixes arrive quickly, and interfaces can shift between minor versions. Pin a version if you are scripting against the saved output line.
Upgrade handling has a documented sharp edge. `chatgpt-imagegen update` runs the skills manager for you, directly when `skills` is on PATH and through `npx` when it is not, and the README notes it usually is not. Interactive runs check for a newer version at most once a day and upgrade automatically for the next run. Two environment variables control this: `CHATGPT_IMAGEGEN_NO_AUTO_UPDATE=1` disables installation but keeps the check and the notice, while `CHATGPT_IMAGEGEN_NO_UPDATE_CHECK=1` disables both. `--quiet` and `--no-progress` never upgrade in the background, which matters if you are capturing output in a script.
The README also flags a migration trap. On 0.23.1 or earlier the self-update only looked for a global `skills` and gave up when it was missing, so it cannot deliver its own fix. Those users have to bootstrap once with `npx -y skills update chatgpt-imagegen` before `chatgpt-imagegen update` works on its own. The project is MIT licensed, which is permissive and imposes no copyleft obligation on your own code; the usual caveat applies that this is a description of the licence text, not legal advice, and the ChatGPT and Gemini terms you are operating under are a separate question from the repository's licence.
Editorial conclusion
Adopt chatgpt-imagegen if you already hold a ChatGPT subscription and want image generation inside a shell script, a Makefile, or an AI agent skill without provisioning an API key or standing up a gateway. Skip it if you need a headless server process with a contractual SLA, or if your pipeline must run on a machine that never has a signed-in browser session, because the default web backend depends on one. Verify first, on your own machine, that `chatgpt-imagegen doctor` reports a working backend and that ImageMagick plus libwebp are present if you intend to use `animate`.
Frequently asked questions
How do I use chatgpt-imagegen?
Install it either as an agent skill with `npx skills add leeguooooo/chatgpt-imagegen -g`, or as a standalone CLI by cloning the repository and installing the `chatgpt-imagegen` script onto your PATH. Then run `chatgpt-imagegen doctor` to confirm a backend is ready, and generate with a prompt plus `-o` for the output path.
Does chatgpt-imagegen work without an OpenAI API key?
Yes. The README states that no OPENAI_API_KEY is needed, because the default `web` backend drives your logged-in ChatGPT web chat instead. It also notes that the default backend works on a free ChatGPT account.
What is the chatgpt-imagegen model and can I choose it?
The GPT Image 2.5 knobs such as `--image-model` and `--quality` are codex-only and are treated as requests, which the README says the codex backend rewrites server-side, observed as `gpt-image-2-codex` and `auto`. On codex, `--model` selects the driver model that calls the tool and defaults to `gpt-5.6-luna`. Every run prints the model and quality the backend actually used.
What are the chatgpt-imagegen limits?
The default web backend depends on a logged-in Chrome session, so it is unsuitable for unattended servers or containers that have never signed in. The codex headless fallback consumes the metered Codex bucket, and the Gemini backends require pinning a profile with `--gemini-profile` and watermark text-to-image output.
Is chatgpt-imagegen an alternative to the OpenAI image API?
It is an alternative for personal and agent workflows where you already hold a ChatGPT subscription and want to avoid provisioning a key. It is not a replacement for a server-side image API with stable parameters and forecastable per-call pricing, since its parameters are requests and its default backend needs a browser session.
How do I fix chatgpt-imagegen when it is not working?
Run `chatgpt-imagegen doctor` first, since the README presents it as the way to see which backends and optional tools are ready. If `animate` is failing, check that ImageMagick's `magick` is installed and that libwebp's `img2webp` is present for WebP output.
Community notes