codex-image
Skill438 starsChanged 3 months agoMITView on GitHub
Generate images using OpenAI's Codex backend API with gpt-image-2 tool. Use when the user asks to generate images via Codex, ChatGPT image generation, or gpt-image-2. Triggers on "codex image", "codex generate", "gpt-image", "chatgpt generate image". Token is auto-fetched from chatgpt.com session — no manual token setup needed.
7 other projects use a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- mishagavura/claude-code-image-generationtheir own version, first seen Sep 30, 2026
- almeidasrenato/codex-image-skillstheir own version, first seen Sep 30, 2026
- lsongdev/skillsedited, first seen Sep 10, 2026
- basejb/skillstheir own version, first seen Jul 10, 2026
- xntj-ai/codex-imagetheir own version, first seen Jun 30, 2026
- qwwiwi/codex-gpt-image-2-subscriptiontheir own version, first seen Jun 7, 2026
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 1
- lsongdev/skills★ 199% same
Wrote their own version · 6
- revfactory/skills★ 159same name
- qwwiwi/codex-gpt-image-2-subscription★ 9same name
- xntj-ai/codex-image★ 9same name
- basejb/skills★ 5same name
- mishagavura/claude-code-image-generation★ 5same name
- almeidasrenato/codex-image-skills★ 0same name
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 repository51 other files it gives its agents.
- android-devSkill
- android-ui-automationSkill
- apple-remindersSkill
- appstoreprice-hubSkill
- asc-cliSkill
- bilibili-hubSkill
- Clash 控制器Skill
- cloudflare-dnsSkill
- codex-on-ishSkill
- contact-vcard-extractorSkill
- deepseek-usageSkill
- doubao-ttsSkill
- douyin-downloaderSkill
- exa-searchSkill
- free-ttsSkill
- fucai3d-latestSkill
- generative-ui-minisSkill
- github-sync-helperSkill
- health-sleep-analysisSkill
- hyperframes-cliSkill
- hyperframesSkill
- korea-stockSkill
- maimai-hubSkill
- memos-apiSkill
- nano-bananaSkill
- notion-hubSkill
- openstreetmap-markerSkill
- pdf-converterSkill
- production-agent-publicSkill
- qbt-hubSkill
- quark-hubSkill
- reverse-dcfSkill
- self-improving-agentSkill
- shortcut-share-fileSkill
- spotify-hubSkill
- stock-fund-flowSkill
- stock-priceSkill
- tavily-searchSkill
- tg-hubSkill
- todoocardSkill
- twitter-downloaderSkill
- twitter-x-hubSkill
- us-stockSkill
- web-content-extractorSkill
- web-searchSkill
- weibo-hubSkill
- whenpeakSkill
- xianyu-hubSkill
- xiaohongshu-hubSkill
- youtube-downloaderSkill
- ytmusic-hubSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
No manual token setup needed — the skill handles auth automatically
- Distinctive: line 22
If already logged in → token extracted and saved to cache immediately
- Very specific: line 23
If not logged in → opens chatgpt.com/auth/login in the browser, then polls every 10s in a new tab for up to 5 minutes
- Very specific: line 79
Not logged in → minis-open pops the ChatGPT login page to the user in foreground, then polls every 10s (up to 5 min) until login is detected
- Very specific: line 81
Run scripts/codex_image.py with appropriate arguments.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Codex Image Generation
Generate images via chatgpt.com/backend-api/codex/responses using the image_generation tool (gpt-image-2).
Requirements
- A ChatGPT account (token is fetched automatically via browser session)
- No manual token setup needed — the skill handles auth automatically
Auth Token Resolution (in order)
--tokenargument (CLI only)CODEX_IMAGE_TOKENenvironment variable--token-fileargument (CLI only)~/.chatgpt_auth.jsoncache (valid for 8 hours)- Auto login flow — fetches from
https://chatgpt.com/api/auth/sessionviaminis-browser-use:- If already logged in → token extracted and saved to cache immediately
- If not logged in → opens
chatgpt.com/auth/loginin the browser, then polls every 10s in a new tab for up to 5 minutes - On success → saves token to
~/.chatgpt_auth.json(chmod 600, token + timestamp only) - Token is never printed to stdout or logs — it stays in the cache file only
Usage
Text-to-image
python3 scripts/codex_image.py "a cute rabbit on a light background" \
--output rabbit.png \
--model gpt-5.4 \
--effort lowImage-to-image / reference image
python3 scripts/codex_image_edit.py "turn this person into a cinematic iOS AI assistant portrait" \
--image reference.jpg \
--output portrait.png \
--model gpt-5.4 \
--effort lowcodex_image_edit.py encodes the local reference image as a base64 data URL and sends it as multimodal input (input_text + input_image) to the same Codex responses endpoint, then asks the image_generation tool to create a new image from the reference.
Parameters
| Parameter | Default | Description |
prompt | (required) | Image description or edit instruction |
--image | (edit only, required) | Local reference image path for image-to-image generation |
--output | codex_image.png / codex_image_edit.png | Output file path |
--model | gpt-5.4 | Codex model |
--effort | low | Reasoning effort: low/medium/high |
--token | - | Access token directly (skips auto auth; text-to-image script only) |
--token-file | - | File containing token (skips auto auth; text-to-image script only) |
Output
JSON with success, path, size, revised_prompt on success.
Auth Script (standalone)
python3 scripts/get_auth.pyReturns JSON {"success": true, "source": "cache|session|login"} — the token itself is never printed to stdout. It is written only to ~/.chatgpt_auth.json (chmod 600, token + timestamp only, no PII). This prevents the token from appearing in shell logs, conversation context, or screenshots.
Workflow
- Token: auto-resolved via
get_auth.py:- Already cached → use directly
- Already logged in (browser session) → extract immediately
- Not logged in →
minis-openpops the ChatGPT login page to the user in foreground, then polls every 10s (up to 5 min) until login is detected
- Construct the prompt from the user's request.
- Run
scripts/codex_image.pywith appropriate arguments. - Send the generated image to the user.
Notes
- Token is cached in
~/.chatgpt_auth.jsonfor 8 hours (chmod 600, token + timestamp only — no PII stored). - Token is never printed to stdout or conversation context — always read from cache file internally.
- The endpoint requires
stream: true; the script handles SSE parsing internally. - Token is a ChatGPT session token, not an OpenAI API key. It expires and is refreshed automatically on next use.
- Image generation uses
gpt-image-2under the hood with auto quality/size. - Token usage is split: main
usagetracks text tokens,tool_usage.image_gentracks image tokens separately. - This uses an internal/unofficial API endpoint. Availability may change.
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.

