Codex Image logo

Codex Image

Organization
OpenMinis
codex-image

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.

Overview

PublisherOpenMinis
RepositoryMinisSkills
Skill namecodex-image
Stars
543
Forks
86
Bundled files
3
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 3 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by OpenMinis on GitHub. Read the source before you install it.

Installation

Install the Codex Image AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/OpenMinis/MinisSkills/tree/main/codex-image
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/OpenMinis/MinisSkills.git /tmp/MinisSkills
mkdir -p .claude/skills
cp -r /tmp/MinisSkills/codex-image .claude/skills/codex-image
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Codex Image in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Codex Image on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Codex Image is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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.

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.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Codex Image AI skill do?

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.

Why use Codex Image on TypingMind?

Because you install it once and use it with any model. Codex Image is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Codex Image in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/OpenMinis/MinisSkills/tree/main/codex-image. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Codex Image?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Codex Image?

As many as you like. As long as a model supports skills, you can use Codex Image with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Codex Image AI skill free?

Yes. It is published on GitHub by OpenMinis under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇