lwmxiaobei/xiaobei-skills · Archived

codex-image

Use this skill when the user wants to generate images, edit images, or create images with gpt-image / GPT Image / OpenAI image models.

First seen May 21, 2026

Installation

$ npx skills add lwmxiaobei/xiaobei-skills --skill codex-image

Summary

  • Use this skill when the user wants to generate images, edit images, or create images with gpt-image / GPT Image / OpenAI image models.
  • Triggers on requests like 'generate an image', 'create a picture', 'edit this image', 'modify the photo', 'use gpt-image', or any image generation/editing task that should run via OpenAI's hosted image_generation tool.

Stronger alternatives

This repository is archived — consider an actively maintained alternative.

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from lwmxiaobei/xiaobei-skills.

npx skills add lwmxiaobei/xiaobei-skills

Browse all from lwmxiaobei/xiaobei-skills

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 5
Default branch main
Open issues 0
Status Archived

Skill metadata

Parsed from SKILL.md frontmatter.

Declared agents codex

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 3,138 B
  • docs README.md 5,514 B
  • docs SUMMARY.md 372 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 5 installs

SKILL.md

codex-image

Generate or edit images via OpenAI's Responses API by reusing the user's ChatGPT subscription — no OPENAIAPIKEY needed. The skill speaks to /v1/responses with the image_generation hosted tool while presenting an HTTP fingerprint indistinguishable from the official codex CLI.

When to invoke

Invoke this skill when the user asks to generate or edit an image and:

  • They explicitly mention codex-image / "codex image" / "use my ChatGPT

quota", or

  • They have an active codex login (~/.codex/auth.json exists) and have

not asked for an API-key based generator, or

  • They explicitly want to avoid paying for OPENAIAPIKEY usage.

Do not use this skill when:

  • The user has an OPENAIAPIKEY set and wants to use it directly (use a

generic Images API skill instead).

  • The user wants Google / Gemini / Adobe / other vendor image models.
  • The user wants pure local background removal (imagegen skill covers that).

Commands

codex-image generate "<prompt>" [--output-format png|webp|jpeg] [--out PATH] [--force]
codex-image edit --input REF1.png [--input REF2.png ...] "<prompt>" [--out PATH] [--force]
codex-image login
codex-image logout
codex-image status

Run codex-image --help for full flags. See [references/cli.md](./references/cli.md) for details and examples.

Prompting

See [references/prompting.md](./references/prompting.md). The guidance is compatible with the sibling imagegen skill so prompts can be reused.

Auth

The skill resolves an access token like so:

  1. Read $CODEX_HOME/auth.json (default ~/.codex/auth.json).
  2. If the access token is close to expiry, refresh it.
  3. If the file is missing or refresh fails, launch a PKCE OAuth browser flow

(binds 127.0.0.1:1455, falling back to :1457). On success, write auth.json so subsequent calls — including codex itself — reuse it.

Use codex-image login to force the OAuth flow. Use codex-image logout to clear tokens (keeps the file shape; codex will treat it as logged-out). Use codex-image status to inspect the current credential.

Output

By default images are written to:

$CODEX_HOME/generated_images/codex-image/<UTC>-<slug>.<ext>

with file mode 0o644. Pass --out PATH for an explicit destination.

Exit codes

Code Meaning
0 Success
2 User input error
3 File-system error
4 Auth/plan error (HTTP 403)
5 Network / rate-limit error (retries exhausted)
6 Partial success (stream broken)
7 API business error (response.failed)
130 User interrupt (Ctrl+C)

Legal

Unofficial skill. Read [LEGAL.md](./LEGAL.md) before use.