Generate Images on Your Subscription Quota: Have Claude Code Drive Codex, Pay Nothing in API Fees
Building decks, shipping demos, illustrating web pages—going through the API means paying per image, and it adds up fast. My last deck ran fifty or sixty pages and image generation alone was heading toward a few hundred yuan.
But if you're already paying for a ChatGPT/Codex subscription, that quota already includes a built-in image tool. I turned that into a Claude Code skill.
Building decks, shipping demos, illustrating web pages—going through the API means paying per image, and it adds up fast. My last deck ran fifty or sixty pages and image generation alone was heading toward a few hundred yuan. For an ordinary user, that isn’t cheap.
But if you’re already paying for a ChatGPT or Codex subscription, that quota already includes a built-in image tool, running on GPT Image 2. Meaning you don’t pay again for every single image the way you do with the API. The membership fee is already spent—you might as well use every bit of that quota.
So I turned it into a Claude Code skill.
Why “have CC drive Codex” instead of generating in Codex directly
A lot of people are like me, running Claude Code and Codex side by side. Codex has GPT Image 2 on subscription quota, which is the cheap part. But when I actually need stable, batch generation, I’d rather take the detour and let Claude Code drive Codex than click around in Codex myself.
Two reasons. One, I’m used to orchestrating inside the Claude Code system—it holds more of my context and memory. Two, the Claude Code model really is a bit smarter: without me hovering over it, it works out what I’m after and writes a complete structured prompt on its own. I’ll even let it run in bypass mode and take the whole flow unattended, then eyeball the results at the end. With Codex I don’t dare let go like that. The judgment calls that matter still have to be mine.
What the skill actually does
It standardizes “CC drives codex to generate images” into a pipeline:
- translates your ask into a structured prompt (purpose → subject → detail → constraints);
- drives
codex execvia script to call the built-in image tool; - checks its own output when it’s done, and regenerates if something’s off.
There’s one trap in the middle you have to plug: codex can be pretty dumb sometimes. You ask for an image and it may just draw you one in SVG, which comes out looking like a stick figure with no aesthetic sense whatsoever. So the skill hard-bans codex from drawing with code or SVG; it has to go through the built-in image tool and produce real pixels. Once that’s shut down, the results hold up: photorealistic lifestyle shots, 3D renders, flat paper-cut, vector illustration, specific cinematic looks—all of it.
The limits: don’t treat it as 4K
A few things to get straight so you don’t get burned:
- Standard definition only. Square means 1024×1024, and the short edge is permanently capped at 1024—not 4K. Real 4K means going through the API (and paying per image again). But honestly, for demos and decks, 1024 is completely fine.
- You’ve probably seen plenty of third-party relays selling dirt-cheap GPT Image 2 generation. Almost all of them are wired in this exact way, and they’re capped at standard definition too. Some upscale with another model and pass it off as 4K to charge you more, which is a bit shameless.
- Quota: Plus ($20/month) gets you roughly 50 images every 5 hours; but don’t forget there’s a weekly cap too, so if you’re maxing it out daily it works out to about 30 images a day.
- It doesn’t parallelize well, so I usually orchestrate one job and let it generate continuously overnight. If you want a full deck generated fast with multi-threaded concurrency, that’s still an API job.
- It can also do transparent backgrounds (cutouts) and edit existing images (pass in a reference)—but in practice the cutouts are mediocre, so don’t set your expectations high.
A quick word on account bans
I opened with a couple of minutes on the recent Claude Code account bans. After the 1.9.1 update on June 22, a lot of accounts started throwing 401s and asking people to log in again. Personal accounts mostly ended up on hold—entitlements suspended, cloud data still exportable, and some people got theirs back on appeal. Harsher cases: entire organizations, or accounts registered in bulk through certain channels, taken out wholesale. It comes down to one line: if you want to run Claude Code reliably over the long haul, put real work into a solid ban-proofing setup. Don’t wait until you get hit to think about it.
Today’s skill is fully open source and free; the repo is at github.com/xntj-ai/codex-image. Hand the URL to Claude Code, say “take a look at how this skill works,” and it installs itself.
Source: EP0053_audio.mp3 · ASR model gemini-2.5-pro (chunked parallel) · full text of the original recording
[00:00] What I’m sharing today is a skill that saves you money on image generation. But before I get into it, I want to say a couple of words about this recent wave of Claude Code account bans. There were already early signs of it back on June 22nd. I put out a video at the time saying everybody needs to back their data up ahead of time, because right before Claude Code’s privacy policy update there was a good chance the company would do a sweep of accounts. And that was the same day, the 22nd, that Claude Code shipped version 1.9.1, which changed the original TLS handshake into a plaintext HTTP connection,
[00:25] which is why a lot of people’s accounts started throwing 401 errors after they updated to 1.9.1, and had to log in again. My guess is that a batch of accounts got flagged during that login. But for those accounts, if it’s a personal account, the prompt the company gives you after you log in is “on hold”—meaning your account privileges are suspended, but you can still export your personal data from the cloud. And supposedly some users have gotten their accounts back by filing an appeal. But there’s another situation, the one everybody’s been talking about lately, which is that after a certain Hangzhou company
[00:50] got caught siphoning traffic, the story goes that Claude Code ran stricter screening and bans targeting Hangzhou as a location. Personally I think that’s pretty unlikely. What I’m actually seeing in the reports coming back is that a lot of these are whole organizations getting banned. Meaning a lot of people’s accounts weren’t personal accounts at all—they were team accounts, company accounts, and the company that registered those accounts for them got banned wholesale by Claude Code. So everybody who went through that channel to
[01:15] use Claude Code, not one of them was spared. They all got completely banned on the same day. So if you want to use Claude Code stably over the long haul, you really do have to go research how to get your configuration properly buttoned up. I shared four big lines of thinking on preventing Claude Code bans quite a while back, and a lot of people said there’s no need to be that rigorous about it. At the time all those ban-proofing measures I’d taken looked unnecessary to them. But now it turns out they’re extremely useful. It’s like jaywalking—just because you didn’t get hit this time doesn’t mean you won’t get hit next time.
[01:40] So, this skill I’m sharing today. There are a lot of users like me who run Claude Code and Codex at the same time. Why use Codex? Because Codex currently includes the GPT Image 2 image model, and it runs off your subscription quota. Meaning you don’t have to pay an extra fee per image the way you do with the API. For a long time now, whenever I’ve made PPTs with Claude Code, I’ve been calling the Image 2 model. But if the deck has a lot of pages—say, one I just did recently that was fifty or sixty pages—then the image generation cost gets up to the
[02:06] several-hundred-yuan range. For a regular user that’s still a fairly high cost. So how do you call Codex’s subscription quota from inside CC to generate images? I built a skill for it. This skill doesn’t need you to hook up a GPT API key at all. On the Plus plan—the $20-a-month subscription—you can generate 50 images every five hours. But there’s one small catch: it can only generate standard-definition images. For a square image, that’s a 1024*1024 pixel image. If we called the API key,
[02:31] we could actually generate 4K. But for the vast majority of what we’re doing—demos, making PPTs—1024 resolution is more than, more than enough. And since we’re already paying the Codex membership fee, we might as well use every bit of that quota, right? So what this skill does is standardize that—it walks CC through the whole flow of calling Codex to generate images. It turns the image request into a structured prompt, uses an exec script to drive Codex, calls Codex’s image generation plugin, and once the image comes out it checks the image itself for problems and whether
[02:56] it needs to be regenerated. Because Codex really can be a bit dim sometimes. When we hand it an image generation request, there’s a chance—a real chance—it’ll draw the thing with SVG instead. And that image is a bit of a joke, stick figures, no aesthetic sense whatsoever. So inside this skill, Codex is strictly forbidden from drawing with SVG. And in testing it works really well. You can see it can generate photorealistic lifestyle photos, and it can do 3D-rendered looks, including flat paper-cut looks,
[03:21] vector illustration looks. It can also generate specific cinematic-feeling styles. That said, images out of Image 2 still feel a little bit dirty. You can probably correct for some of that through the prompt. And this skill isn’t limited to square images either—you can specify the ratio. 9:16, 16:9, 3:4, 4:3, all fine. It’s just that the short edge is always capped at that 1024-pixel limit. If a subscription plan let you generate 4K directly, OpenAI would get fleeced bald.
[03:46] And all those dirt-cheap third-party relay platforms people use for Image 2 image generation are wired up the same slow way, so they can only generate standard-definition images too. And sometimes those platforms will take those standard-definition images and upscale the resolution with another model to pass them off to you as 4K, so they can charge you a higher fee. I think that’s genuinely a bit shameless. In this kind of calling setup you can also have it generate transparent-background images—cutouts—and you can edit existing images
[04:12] by passing in a reference image. But in testing the cutout quality is mediocre. And like I mentioned, our subscription quota is at most 50 images per five hours. But, but—don’t forget there’s also a weekly quota. If you’re running it flat out every single day, you can get out roughly 30 images a day. And there’s one more issue: it doesn’t parallelize well. So when we generate images this way, we usually queue up a task for it and let it churn out images continuously over a night. If you call the API, you can actually multi-thread in parallel,
[04:37] and finish making a deck faster. So finally, I want to talk about why I don’t just generate images in Codex directly. The first reason is that I’m genuinely used to doing my orchestration inside CC, inside the whole Claude Code system, because it’s got way more of my memory in it. The other thing is that Claude Code’s model really is smarter. Without me having to intervene, it understands my starting point and my goal well, and writes me a complete, structured prompt. So for me it’s the lower-hassle way to do it. Which is also what a lot of friends have been asking me lately: can
[05:02] Claude Code actually replace Codex? After the bans, can you use Claude Code to do these things? You can, it’s just going to take more effort—you have to walk it through what we’re doing by hand. The moment one standard isn’t stated explicitly, there’s a good chance you get a big screwup or a big rework. In Codex I have no way of confidently running it in bypass mode with auto-confirm. The key confirmations still have to come back to me to decide. But relatively speaking, with Claude Code I can completely trust it to execute on its own, run through the entire
[05:27] process, and then let me eyeball the result. And today’s skill is also completely open source and free for everyone. Come find me in the comments. See you next episode, bye-bye.