kejilion/ai-skills/openai-compatible-image-generator
Claude Code and agent skill by kejilion/ai-skills
- community
Checking that the SKILL.md file is still in the repository.
Generate images through OpenAI-compatible /v1/images/generations APIs such as gpt-image-2, custom proxy endpoints, or self-hosted image gateways. Use when the user asks to test an image-generation endpoint, adapt a script to a base URL/API key/model, generate one or many images from prompts, or package a reusable OpenAI-compatible image generation workflow.
Install
npx vskill@latest install kejilion/ai-skills/openai-compatible-image-generatorSKILL.md
OpenAI-Compatible Image Generator
Use this skill for image generation through providers that expose an OpenAI-style endpoint:
Default Workflow
- Prefer the bundled script unless the user explicitly wants a different implementation:
``bash python3 {baseDir}/scripts/generate_image.py "prompt" \ --base-url "$IMAGE_API_BASE_URL" \ --api-key "$IMAGE_API_KEY" \ --model gpt-image-2 \ --size 1024x1024 \ --out ./generated.png ``
- Keep API keys out of source files, chat replies, and git commits. Use environment variables or secret/config files already present on the machine.
- Verify success with both process exit code and output file existence:
``bash test -s ./generated.png && file ./generated.png ``
- If sending the result in chat, attach the generated image rather than pasting base64.
Environment Variables
The script checks these names in order:
- Base URL:
IMAGE_API_BASE_URL,GPT_IMAGE2_BASE_URL,OPENAI_BASE_URL - API key:
IMAGE_API_KEY,GPT_IMAGE2_API_KEY,OPENAI_API_KEY - Model:
IMAGE_MODEL,GPT_IMAGE2_MODEL(default:gpt-image-2) - Size:
IMAGE_SIZE(default:1024x1024)
Script Features
generate_image.py supports:
b64_jsonresponses: decodes and writes PNG bytes to disk.urlresponses: prints URL, or downloads it when--outis a file path forn=1.- Multiple images: set
--n > 1and pass--outas a directory. - Provider-specific fields: pass
--extra-json '{"key":"value"}'to merge additional request payload fields. - Nonstandard auth: pass
--auth-prefix ''for raw key auth, or another prefix if the gateway requires it.
Common Commands
Single image:
Batch variants:
Troubleshooting
Missing API key: pass--api-keyor set one of the supported key environment variables.HTTP 401/403: check key, auth prefix, and whether the provider expectsBearer.HTTP 404: ensure the base URL ends at/v1; the script appends/images/generations.- Empty
data: print the provider response and inspect whether it uses a nonstandard schema. - Long waits/timeouts: increase
--timeout, reduce--n, or test with a shorter prompt.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingpublic/openai-compatible-image-generator/SKILL.md
Popularity
- Repository stars
- 84
- Repository forks
- 27
- 7-day trend score
- 22
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 5 Aug 2026, 3 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/kejilion/ai-skills/openai-compatible-image-generator)