gpt-image
Skill2 starsChanged 31 days agoMITView on GitHub
Use when asked to generate, create, make, render, draw, or mock up an image, photo, picture, hero image, illustration, icon, texture, sprite, or visual asset from Claude Code, and no usable OPENAI_API_KEY is set but Codex CLI is installed and signed in to ChatGPT (OAuth). Also triggered by /gpt-image. Routes image generation through Codex's built-in tool, never the OpenAI API.
- Reads credentials
19 other projects use a version of this.
Adopted by
Most recently taken up by
- potofo/gpt-imagetheir own version, first seen Nov 8, 2026
- jujijigo/agent-skillstheir own version, first seen Nov 8, 2026
- konglingbukong/gpt-image-studiotheir own version, first seen Oct 20, 2026
- Suge8/friedbuntheir own version, first seen Oct 11, 2026
- wuyoscar/gpt_image_2_skilltheir own version, first seen Oct 8, 2026
- xingfanxia/AX-skillstheir own version, first seen Sep 19, 2026
Other versions19 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 19
- wuyoscar/gpt_image_2_skill★ 6ksame name
- wuyoscar/GPT-Image2-Skill★ 5.6ksame name
- GENEXIS-AI/gpt-image-skill★ 157same name
- nikships/droidproxy★ 128same name
- Yuki001/game-dev-skills★ 110same name
- dshark3y/gpt-image-2-skill★ 19same name
- Suge8/friedbun★ 12same name
- ZeyuLing/research_autocode_skills★ 9same name
- egoist/gpt-image★ 7same name
- tuoxie2046/claude-code-research-skills★ 5same name
9 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository10 other files it gives its agents.
- maya-starter/CLAUDE.mdCLAUDE.md
- email-sortingSkill
- facebook-personal-browserSkill
- gam-campaign-checkupSkill
- generate-meSkill
- grok-browserSkill
- last30days-plusSkill
- muse-browserSkill
- perplexity-browserSkill
- wiki-llmSkill
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 1 is distinctive, and 2 are very specific to this project.
0
Common
Most of the 15 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 12
Core rule: a ChatGPT OAuth login is NOT an API key: Do not call the OpenAI Images API — the OAuth token lacks image scope and returns 401 …
- Very specific: line 25
Do not read the key out of ~/.codex/auth.json — Claude Code's credential safety layer blocks it, and there is no usable image key there …
- Distinctive: line 36
Run it in the background for batches.
“Common” is measured: kept by at least 6 in 10 of the 15 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
gpt-image
Overview
Generate images from Claude Code using a ChatGPT subscription (no paid API key) by delegating to Codex CLI's built-in image_gen tool, which runs through the user's ChatGPT OAuth session.
Core rule: a ChatGPT OAuth login is NOT an API key. Do not call the OpenAI Images API — the OAuth token lacks image scope and returns 401 missing scopes: api.model.images.request. Codex's built-in image_gen tool needs no key. Always route through Codex.
When to use
- Any request to generate / create / make / render / draw an image, photo, mockup, hero, banner, illustration, icon, sprite, or texture from Claude Code.
- The machine has Codex CLI plus a ChatGPT login, and there is no usable
OPENAI_API_KEY.
Do NOT use when: a real OPENAI_API_KEY is available and direct API control is wanted, or the asset is better authored as code/SVG.
Prerequisites
codex --versionsucceeds (Codex CLI installed).- Codex is signed in to ChatGPT (authenticated via OAuth).
- Do not read the key out of
~/.codex/auth.json— Claude Code's credential safety layer blocks it, and there is no usable image key there anyway. If image generation fails, report the error; do not hunt for a key.
Workflow
- Write a brief (plain text): shared style + per-image subject/composition + aspect ratio + ABSOLUTE destination path + constraints ("only write these files, no git, don't edit the repo").
- Run Codex headless:
Run it in the background for batches; then read the output file.codex exec --sandbox workspace-write \ -c sandbox_workspace_write.network_access=true \ --skip-git-repo-check "$(< /abs/path/to/brief.txt)" - Force the built-in tool in the brief: tell Codex to use its built-in
image_gentool (one call per image). Explicitly forbid the OpenAI Images API and one-off SDK scripts — that path 401s on OAuth. - Single location — MOVE, don't copy. The built-in tool always writes to
~/.codex/generated_images/<session>/first. Instruct Codex tomv(nevercp) each file to the absolute destination, thenrmdirthe emptied session folder. Never touch other session folders (the user's prior work). - Verify: open the saved images, confirm subject/quality/brand, confirm the destination holds the files and the cache session is gone.
Brief template (copy, fill the brackets)
GENERATE <N> images using your BUILT-IN image_gen tool (one call each).
Do NOT call the OpenAI Images API and do NOT write an SDK script.
After each image, MOVE it (mv, not cp) to the ABSOLUTE path given, then
rmdir the now-empty ~/.codex/generated_images/<session> folder.
Do not run git or modify any other file.
SHARED STYLE: <style / palette / mood — optional>
AVOID: <negatives, e.g. text, logos, extra fingers>
1) <landscape|square|portrait> -> <subject + composition> -> /abs/path/name1.png
2) ...
When done, print each saved ABSOLUTE path.Aspect ratios
Built-in output comes in buckets: landscape ~1672×941, square ~1254×1254, portrait 1024×1536. Exact pixel dimensions need a post-crop/resize step (e.g. sips).
Common mistakes
| Mistake | Fix |
| Calling the OpenAI Images API with the OAuth token | 401 missing scope. Use the built-in image_gen tool. |
cp instead of mv | Leaves a 1:1 duplicate in ~/.codex/generated_images (wasted disk). Always mv, then rmdir the empty session dir. |
| Relative output path | Resolves to Codex's cwd (often repo root), not your folder. Use ABSOLUTE paths. |
n>1 for different scenes | n = variants of ONE prompt. Distinct images need distinct image_gen calls. |
| Sandbox blocks the network call | Add -c sandbox_workspace_write.network_access=true. |
| Trusting "done" | The tool reports success even when composition drifts. Open the files and check. |
Reading ~/.codex/auth.json for a key | Blocked and pointless. Let Codex use its own session. |
Portability
This skill is machine-local. To use it on another computer, that machine needs: Claude Code, Codex CLI installed, and Codex signed in to ChatGPT. Copy this gpt-image/ folder into that machine's ~/.claude/skills/.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

