openai-image-generationlisted
Install: claude install-skill chirag2653/openai-image-generation
# OpenAI Image Generation Skill
## Tool Overview
This skill is a thin, reliable wrapper that lets an AI agent generate an image with OpenAI's gpt-image-2 in a single CLI call. The agent supplies the prompt and any parameters that matter for the task (size, quality, format, count, output path); the script handles API key discovery (4-tier loader: process env → Windows User env → `.env.local` → `.env`), validates and forwards the request to `POST /v1/images/generations`, decodes the returned base64 payload, writes the file(s) to disk, and — in `--json` mode — emits a single JSON line on stdout with the saved path(s), key source, and cost estimate. Distinct exit codes (`0` ok, `1` missing key/SDK, `2` API failure, `3` empty response) let the caller branch deterministically.
Practical recipe for an agent with task context (e.g. "I need a hero banner for the landing page"):
1. Pick parameters from the use case — see the smart-defaults table in Step 2.
2. Pick an output path — relative or absolute; parent dirs are auto-created.
3. Run the script with `--json`, parse the JSON, use `saved[0]` (or `saved[]` for n>1) downstream.
The skill is global (installed under `~/.agents/skills/openai-image-generation/` via `npx skills`, or under the plugin cache when installed as a Claude Code plugin — see [Script Location](#script-location--resolve-once-into-script-then-reuse-it)), so it's available across sessions and projects without per-project setup — the only requirement is an `OPENAI_A