agentleFS
qwwiwiqwwiwi/codex-gpt-image-2-subscription/skills/codex-image/SKILL.md

codex-image

Skill9 starsChanged 6 months agoMITView on GitHub

Use when asked to generate an image, picture, photo, cover, banner art or illustration (сгенерируй картинку, фоточку, обложку, изображение) using the Codex/ChatGPT subscription — no OPENAI_API_KEY, no per-image billing; supports up to 5 reference images (по референсу, в стиле картинки). Also use when tempted to answer that image generation is impossible without an API key, that Codex is text-only, or that references don't work over the subscription.

  • Reads credentials

7 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions7 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 7

    1. OpenMinis/MinisSkills★ 438same name
    2. revfactory/skills★ 159same name
    3. xntj-ai/codex-image★ 9same name
    4. basejb/skills★ 5same name
    5. mishagavura/claude-code-image-generation★ 5same name
    6. lsongdev/skills★ 1same name
    7. 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 repositoryOne other file it gives its agents.

The file

Files
SKILL.md

codex-image — gpt-image-2 via Codex OAuth subscription

Overview

Images are generated by gpt-image-2 through the Codex/ChatGPT OAuth subscription (token from ~/.codex/auth.json, created by codex login). No API key, no per-image cost — quota is shared with the Codex subscription.

Common misconception (documented agent failure): "Codex is text-only, image generation needs OPENAI_API_KEY / DALL-E." Wrong. The Codex backend (chatgpt.com/backend-api/codex) serves the image_generation tool over the Responses API; host model gpt-5.5 invokes it, gpt-image-2 renders.

Note: the Codex Claude Code plugin (openai/codex-plugin-cc) does NOT generate images — its role is review/architecture. This skill's script bypasses the plugin and talks to the Codex backend directly using the same login.

Quick reference

# self-contained launcher — uses the skill's own venv, bootstraps it if missing
~/.claude/skills/codex-image/scripts/run.sh \
  "prompt in English" [quality] [aspect] [ref1.png ... ref5.png]
ParamValuesNotes
qualitylow (~45s) / medium (default, ~1-2min) / high (~2-3min)
aspectlandscape 1536x1024 / square 1024x1024 / portrait 1024x1536
refNup to 5 local image paths (png/jpg/webp)passed as input_image data-URL content blocks; style/character/logo transfer
outputprints path to PNGsaved in ~/.codex/cache/images/img_<ts>.png

Prompt in English works best. Generation is slow — for high use a background call.

Hard constraints (violating any → HTTP 400 or wrong path)

  1. References: max 5 images, as content blocks. {"type":"input_image","image_url":"data:<mime>;base64,...","detail":"auto"} placed NEXT TO input_text in the same user message. There is no seed parameter — for strict reproducibility a paid image API is still the better tool; for character/style/logo transfer this works.
  2. Never client.images.generate() / Images API — that is the API-key path, the OAuth subscription rejects it. Only Responses API + tool image_generation (+ tool_choice={"type":"image_generation"} so the host model draws immediately).
  3. stream=True and store=False are mandatory — otherwise HTTP 400 from the Codex backend.
  4. input must be a LIST of message objects, not a bare string.
  5. Auth: tokens.access_token (+ tokens.account_id → chatgpt-account-id header) from ~/.codex/auth.json. Required headers: OpenAI-Beta: responses=experimental, originator: codex_cli_rs.

Troubleshooting

SymptomFix
ModuleNotFoundError: openairun via scripts/run.sh (skill's own venv), NOT system python3 — it lacks the SDK
Codex auth не найденcodex login (server: codex login --device-auth)
HTTP 400check stream=True, store=False, input as message list
401/403token expired — re-run codex login; check account_id header
No image in streammodel refused (policy) — rephrase prompt
ref rejectedpng/jpg/webp only, ≤15MB per file, ≤40MB total, max 5 files

When NOT to use

  • Deterministic graphics (exact typography, brand colors, diagrams): hand-author SVG → render PNG.
  • Strict reproducibility / seed-based pipelines: needs a paid image API with seed support.

The skill is fully self-contained (script + own .venv, auto-bootstrapped by run.sh). Reference technique from ningzimu/codex-gpt-image (audited).

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.