Agent skill

Codex Image

by OpenMinis in OpenMinis/MinisSkills

Generate images using OpenAI's Codex backend API with gpt-image-2 tool.

MITAuto-check passedMedia & Creative

Install Codex Image

skills CLI
$ npx skills add OpenMinis/MinisSkills --skill codex-image -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install OpenMinis/MinisSkills codex-image --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/OpenMinis/MinisSkills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/codex-image .claude/skills/codex-image && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
codex-image
GitHub stars
444
Token cost
~1.1k tokens
SKILL.md length
440 words
Files
4 (incl. scripts)
Skills in repo
49
Repo updated
First seen
Licence
MIT

At a glance

Generate images using OpenAI's Codex backend API with gpt-image-2 tool.

  • Works in 5 steps: token argument (CLI only) → CODEX_IMAGE_TOKEN environment variable → token-file argument (CLI only) → …
  • The user asks to generate images via Codex
  • SKILL.md covers Requirements, Auth Token Resolution (in order), Usage and Auth Script (standalone), plus 2 more sections
  • Runs Python scripts from its folder; calls python3; reaches chatgpt.com; needs CODEX_IMAGE_TOKEN

What it does

Codex Image is an agent skill from OpenMinis/MinisSkills. 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.

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including scripts (for example `scripts/codex_image.py`, `scripts/codex_image_edit.py` and `scripts/get_auth.py`).

It sits in Media & Creative, covering Image generation. It works with OpenAI. The repository describes itself as: Skills collection for Minis. The licence is MIT.

When your agent uses it

  • The user asks to generate images via Codex
  • ChatGPT image generation
  • Chatgpt generate image

Example prompts

  • “codex image”
  • “codex generate”
  • “gpt-image”
  • “/codex-image”

Requirements

  • Python 3
  • A credential in CODEX_IMAGE_TOKEN

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. token argument (CLI only)
  2. CODEX_IMAGE_TOKEN environment variable
  3. token-file argument (CLI only)
  4. ~/.chatgpt_auth.json cache (valid for 8 hours)
  5. Auto login flow — fetches from https://chatgpt.com/api/auth/session via minis-browser-use

What it can do on your machine

Read from SKILL.md and the folder at commit ae8c5db. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 3 files in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python3

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • chatgpt.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • CODEX_IMAGE_TOKEN

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Codex Image loads about 1.1k tokens when it runs. Until then it costs about 85 tokens; SKILL.md has 440 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~85
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from OpenMinis/MinisSkills at commit ae8c5db, republished under its MIT licence (© OpenMinis). 440 words, ~1,057 tokens.

Download SKILL.mdSave it as .claude/skills/codex-image/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
codex-image
description
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.

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)

  1. --token argument (CLI only)
  2. CODEX_IMAGE_TOKEN environment variable
  3. --token-file argument (CLI only)
  4. ~/.chatgpt_auth.json cache (valid for 8 hours)
  5. Auto login flow — fetches from https://chatgpt.com/api/auth/session via minis-browser-use:
    • If already logged in → token extracted and saved to cache immediately
    • 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
    • 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
bash
python3 scripts/codex_image.py "a cute rabbit on a light background" \
  --output rabbit.png \
  --model gpt-5.4 \
  --effort low
Image-to-image / reference image
bash
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 low

codex_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
ParameterDefaultDescription
prompt(required)Image description or edit instruction
--image(edit only, required)Local reference image path for image-to-image generation
--outputcodex_image.png / codex_image_edit.pngOutput file path
--modelgpt-5.4Codex model
--effortlowReasoning 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)

bash
python3 scripts/get_auth.py

Returns 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.

Show full SKILL.md (161 more words)Show less

Workflow

  1. Token: auto-resolved via get_auth.py:
    • Already cached → use directly
    • Already logged in (browser session) → extract immediately
    • 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
  2. Construct the prompt from the user's request.
  3. Run scripts/codex_image.py with appropriate arguments.
  4. Send the generated image to the user.

Notes

  • Token is cached in ~/.chatgpt_auth.json for 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-2 under the hood with auto quality/size.
  • Token usage is split: main usage tracks text tokens, tool_usage.image_gen tracks image tokens separately.
  • This uses an internal/unofficial API endpoint. Availability may change.

© OpenMinis, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (scripts) in codex-image of OpenMinis/MinisSkills.

  • SKILL.md
  • scripts/codex_image.py
  • scripts/codex_image_edit.py
  • scripts/get_auth.py

Open the folder on GitHubat commit ae8c5db

Compare with similar skills

Codex Image next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Codex Image compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Codex Image this skillOpenMinis/MinisSkills444—~1.1kAutomated safety check: PassMIT
AI Image Generation and Editingzhayujie/CowAgent47k—~1.3kAutomated safety check: PassMIT
GPT Image Generation CLIwuyoscar/GPT-Image2-Skill5.7k—~2.5kAutomated safety check: NotesMIT
Openai Image Gentrpc-group/trpc-agent-go1.8k13 repos~843Automated safety check: PassApache-2.0
Imagegentheowenyoung/home1154 repos~4.8kAutomated safety check: PassApache-2.0
Image Generationonyx-dot-app/onyx32k1 repos~1.7kAutomated safety check: PassCustom licence

Similar skills

  • Generates or edits images from text prompts through a Python script that picks an image backend based on which API keys are configured.

    47k GitHub stars~1.3k tokensUpdated today
    Media & CreativeAuto-check passed
  • GPT Image Generation CLI

    wuyoscar/GPT-Image2-Skill

    Generates and edits images with GPT Image 2 or 2.5 through a packaged CLI and a prompt gallery, after settling which model fits the request.

    5.7k GitHub stars~2.5k tokensUpdated 7 days ago
    Media & CreativeAuto-check: notes
  • Openai Image Gen

    trpc-group/trpc-agent-go

    Batch-generate images via OpenAI Images API. An agent skill from trpc-group/trpc-agent-go.

    1.8k GitHub starsUsed in 13 repos~843 tokens
    Media & CreativeAuto-check passed
  • Imagegen

    theowenyoung/home

    Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts.

    115 GitHub starsUsed in 4 repos~4.8k tokens
    Media & CreativeAuto-check passed
  • Image Generation

    onyx-dot-app/onyx

    Generate or edit raster images (photos, illustrations, textures, sprites, mockups, logos, infographics) using the workspace's configured image-generation provider via onyx-cli image.

    32k GitHub starsUsed in 1 repo~1.7k tokens
    Media & CreativeAuto-check passed
  • BlockRun Image Generation

    BlockRunAI/ClawRouter

    Generates or edits images through ClawRouter's local image API, with a choice of models and sizes and payment handled automatically through x402.

    6.6k GitHub stars~2.1k tokensUpdated 2 days ago
    Media & CreativeAuto-check passed

More from OpenMinis/MinisSkills

All 49 skills in this repo
  • Android UI Automation

    OpenMinis/MinisSkills

    Automate Android apps that have no public API or web version by driving the UI layer through the Accessibility Service.

    444 GitHub stars~1.6k tokensUpdated today
    Auto-check passed
  • Codex On Ish

    OpenMinis/MinisSkills

    Install and run OpenAI Codex CLI inside the Minis/iSH Alpine sandbox on iOS, where rustls TLS and async sockets are broken.

    444 GitHub stars~1k tokensUpdated today
    Auto-check passed
  • Evidence Chain Builder

    OpenMinis/MinisSkills

    Score a claim against the evidence behind it. An agent skill from OpenMinis/MinisSkills.

    444 GitHub stars~2.4k tokensUpdated today
    Auto-check passed
  • Hyperframes CLI

    OpenMinis/MinisSkills

    HyperFrames CLI and Minis rendering. An agent skill from OpenMinis/MinisSkills.

    444 GitHub stars~3.5k tokensUpdated today
    Auto-check passed
  • Whenpeak

    OpenMinis/MinisSkills

    Predict when a person's brain works best from their sleep, using the WhenPeak performance-intelligence API, and turn it into concrete scheduling advice.

    444 GitHub stars~2.3k tokensUpdated today
    Auto-check passed
  • Openstreetmap Marker

    OpenMinis/MinisSkills

    Generate a mobile-first, immersive, Amap(Gaode)-style custom landmark marker HTML map for travel itinerary planning, place showcasing, location sharing, etc.

    444 GitHub stars~1.9k tokensUpdated today
    Auto-check passed

Works with

Questions about Codex Image

What does Codex Image do?

Generate images using OpenAI's Codex backend API with gpt-image-2 tool. Codex Image is an agent skill from OpenMinis/MinisSkills. Generate images using OpenAI's Codex backend API with gpt-image-2 tool.

When should I use Codex Image?

Codex Image fits situations like: the user asks to generate images via Codex; chatGPT image generation; chatgpt generate image.

How do I install Codex Image in Claude Code?

Run `npx skills add OpenMinis/MinisSkills --skill codex-image -a claude-code`. Or copy the skill folder (codex-image in OpenMinis/MinisSkills) into .claude/skills/codex-image in your project. Claude Code loads it when a task matches its description.

How do I install Codex Image in Codex?

Run `npx skills add OpenMinis/MinisSkills --skill codex-image -a codex`. Or copy the skill folder (codex-image in OpenMinis/MinisSkills) into .agents/skills/codex-image in your project. Codex loads it when a task matches its description.

Can I use Codex Image in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add OpenMinis/MinisSkills --skill codex-image -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/codex-image, .gemini/skills/codex-image, .github/skills/codex-image and .opencode/skills/codex-image in your project.

What does Codex Image need to run?

Going by SKILL.md and its folder, Codex Image needs Python for the scripts in its folder, the command-line tools its instructions call (python3) and credentials named CODEX_IMAGE_TOKEN. Our summary lists: Python 3; A credential in CODEX_IMAGE_TOKEN.

Does Codex Image access the network?

SKILL.md names 1 domain. In commands or code: chatgpt.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Codex Image safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Codex Image use?

Codex Image is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Codex Image use?

About 1.1k tokens (SKILL.md is roughly 4.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Codex Image?

Skills that share tags, products or a category with Codex Image: AI Image Generation and Editing (zhayujie/CowAgent, 47k stars), GPT Image Generation CLI (wuyoscar/GPT-Image2-Skill, 5.7k stars), Openai Image Gen (trpc-group/trpc-agent-go, 1.8k stars) and Imagegen (theowenyoung/home, 115 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Codex Image?

OpenMinis (a GitHub organization) maintains it in OpenMinis/MinisSkills, which has 444 GitHub stars. The repository holds 49 skills in this directory. The repository was last updated on October 7, 2026.

Source: OpenMinis/MinisSkills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.