🌐 简体中文
Free AI image generation powered by your ChatGPT Plus subscription.
Zero API cost. Zero tokens. Just your Plus sub and Codex CLI.
Codex Image lets any CLI tool or AI agent generate images for free — by routing through your ChatGPT Plus subscription via Codex CLI.
- No API key
- No token billing
- No third-party proxy
- Just Codex CLI + your Plus subscription
| Codex Image | API-based | |
|---|---|---|
| Cost | Free (included in Plus) | Pay per image |
| Model | ChatGPT native image model | Varies by API |
| Text rendering | Accurate | Hit or miss |
| Setup | One git clone |
Register, add card, top up |
| Dependency | Codex.app (already installed if you have Plus) | None |
| Requirement | Notes |
|---|---|
| macOS | Codex.app is macOS-only |
| Codex.app | Desktop client, provides the codex CLI |
| ChatGPT Plus | Image generation uses your Plus quota |
Don't have Plus? Upgrade at chatgpt.com/upgrade
# 1. Clone
git clone https://github.com/Leon-llb/codex-image.git ~/.claude/skills/codex-image
# 2. Generate
python3 ~/.claude/skills/codex-image/generate.py "a cat sleeping on a sofa, warm sunlight"python3 generate.py "<prompt>" [size] [output_dir]
| Argument | Default | Description |
|---|---|---|
prompt |
required | Image generation prompt |
size |
1024x1024 |
Dimensions as WxH |
output_dir |
cwd | Where to save the image |
# Square
python3 generate.py "a shiba inu, japanese illustration style, white background"
# Portrait poster
python3 generate.py "a cinematic portrait, golden hour lighting, 8k" 1024x1536 ~/Downloads
# Landscape wallpaper
python3 generate.py "cyberpunk city skyline at night, neon lights" 1536x1024 ~/DesktopImages are saved with the filename pattern codex-image-20260518-143052.png.
Drop the skill into your skills directory and Claude Code discovers it automatically:
ln -sf ~/.claude/skills/codex-image ~/.claude/skills/codex-imageSay "generate an image of..." in conversation to trigger it.
Let your Telegram or WeChat agent generate images too.
Install the plugin
mkdir -p ~/.hermes/hermes-agent/plugins/image_gen/codex-image
cp hermes-plugin/plugin.yaml ~/.hermes/hermes-agent/plugins/image_gen/codex-image/
cp hermes-plugin/__init__.py ~/.hermes/hermes-agent/plugins/image_gen/codex-image/Configure ~/.hermes/config.yaml
plugins:
enabled:
- image_gen/codex-image
image_gen:
provider: codex-imageRestart
hermes gateway restartNow when someone messages your Hermes agent "generate an image of X", the agent's built-in image_generate tool routes to the codex-image provider, which runs generate.py, and the image lands in ~/Downloads.
User → Hermes/Claude → image_generate tool call
↓
codex-image provider
↓
generate.py script
↓
codex exec (ChatGPT Plus)
↓
Image → ~/Downloads
No OpenAI API calls. No extra billing. Just your Plus subscription doing what it already pays for.
MIT — Leon