Codex Gpt Image logo

Codex Gpt Image

Community
ningzimu
codex-gpt-image

Generate or edit images with GPT Image 2.5 through Codex/ChatGPT subscription authentication instead of OPENAI_API_KEY. Use for text-to-image, reference-image editing, or visual assets when the user wants local Codex auth, especially when no native image tool is available. Do not use for official OpenAI API-key billing or OpenAI-compatible gateways.

Overview

Publisherningzimu
Repositorycodex-gpt-image
Skill namecodex-gpt-image
Stars
70
Forks
3
Bundled files
2
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.

  • 2 bundled files

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

  • Open source

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

Installation

Install the Codex Gpt 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/ningzimu/codex-gpt-image/tree/main/skills/codex-gpt-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/ningzimu/codex-gpt-image.git /tmp/codex-gpt-image
mkdir -p .claude/skills
cp -r /tmp/codex-gpt-image/skills/codex-gpt-image .claude/skills/codex-gpt-image
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Codex Gpt 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 Gpt 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 Gpt 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 GPT Image

Use this skill to generate or edit images through Codex OAuth instead of the OpenAI API-key path. The bundled CLI reads the local Codex auth file and calls the Codex Images backend endpoints.

When To Use

  • The user asks to use gpt-image-2.5-flare or GPT Image through Codex auth/subscription.
  • The current agent supports SKILL.md but does not have a native image tool.
  • The user explicitly does not want to use OPENAI_API_KEY.
  • The user wants the same local image workflow across Codex, Claude Code, OpenClaw, Hermes Agent, or similar agents.

Do not use this skill when the user wants the official OpenAI Images API, an OpenAI-compatible gateway, or API-key billing. This skill is deliberately Codex-OAuth-only.

Core Workflow

All CLI commands below assume the working directory is this skill folder. Otherwise, resolve the absolute path to scripts/codex_gpt_image.py from this SKILL.md.

  1. Check local Codex auth:

    bash
    python3 scripts/codex_gpt_image.py auth-status
  2. If Codex auth is missing, run the device-code login flow:

    bash
    python3 scripts/codex_gpt_image.py login --open-browser

    The CLI prints a browser URL and a short user code. The user must complete this step; never ask them to paste tokens.

  3. Generate an image with the user's actual prompt. Choose only the CLI flags required by the request, and do not reuse prompt wording from this skill.

  4. Edit or use reference images by passing one or more --image inputs. For edits, build the prompt from the user's requested changes and the invariants that must stay unchanged.

  5. Report the saved path(s), requested model, actual output size when inspected, and whether Codex OAuth was used. Do not claim the requested model was used unless the backend identifies it.

Defaults

  • Auth file: ~/.codex/auth.json
  • Override auth file: CODEX_AUTH_FILE=/path/to/auth.json
  • Login fallback: login uses OpenAI Codex device-code auth and writes the same auth file
  • Login client id: --client-id, CODEX_APP_SERVER_LOGIN_CLIENT_ID, then the public Codex default
  • Images base URL: https://chatgpt.com/backend-api/codex
  • Image model: gpt-image-2.5-flare
  • Size: auto
  • Quality: auto
  • Background: auto
  • Moderation: auto
  • Output format: png
  • Output compression: 100 for jpeg and webp

For detailed parameter values, defaults, model-specific constraints, and CLI mapping, read references/openai-images-api-parameters.md.

Parameter Selection

Prefer the official API defaults unless the user request requires a specific option. Read the reference before choosing explicit model, size, quality, background, moderation, or output_format values.

Prompting

Keep prompts explicit and production-oriented:

  • State the intended asset type.
  • Quote any exact visible text.
  • Specify composition, background, style, and constraints.
  • For edits, repeat invariants: what must stay unchanged.
  • Avoid adding logos, watermarks, or extra text unless requested.

Failure Handling

  • Missing auth file: run codex_gpt_image.py login --open-browser, or ask the user to run codex login, then retry.
  • 401/403: the Codex OAuth token may be expired, the account may not have access, or the endpoint may reject the session. Ask the user to refresh Codex auth.
  • Network failures: retry once if the request is idempotent and the user accepts possible duplicate image generation.
  • Never print or paste tokens from ~/.codex/auth.json.

Implementation Notes

The CLI sends Codex Images requests with:

  • generation endpoint: POST https://chatgpt.com/backend-api/codex/images/generations
  • edit endpoint: POST https://chatgpt.com/backend-api/codex/images/edits
  • auth: Authorization: Bearer <access token from ~/.codex/auth.json>
  • model: gpt-image-2.5-flare

It parses the JSON Images response and writes returned base64 image payloads to local files.

GPT Image 2.5 Compatibility

Use the default Flare model for everyday generation, or select --model gpt-image-2.5-sunburst for precise editing. Both models and their dated snapshots support xhigh and max quality and transparent backgrounds with PNG/WebP. Older models cannot use the new quality levels; this CLI keeps transparency disabled for older models. Codex OAuth access depends on the account and backend rollout.

Codex OAuth probes on 2026-09-11 also accepted an invalid model name, omitted the actual model ID, and returned dimensions different from the requested size. Successful generation does not verify model or quality selection. Treat these flags as requested settings; do not present public API capabilities as guaranteed OAuth backend behavior.

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 Gpt Image AI skill do?

Generate or edit images with GPT Image 2.5 through Codex/ChatGPT subscription authentication instead of OPENAI_API_KEY. Use for text-to-image, reference-image editing, or visual assets when the user wants local Codex auth, especially when no native image tool is available. Do not use for official OpenAI API-key billing or OpenAI-compatible gateways.

Why use Codex Gpt Image on TypingMind?

Because you install it once and use it with any model. Codex Gpt 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 Gpt Image in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/ningzimu/codex-gpt-image/tree/main/skills/codex-gpt-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 Gpt 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 Gpt Image?

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

Is the Codex Gpt Image AI skill free?

Yes. It is published on GitHub by ningzimu 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 👇