Overview
apiyi-gpt-image-2-gen and apiyi-gpt-image-2-all-gen are two open-source AI Agent Skills contributed by community user wuchubuzai2018. They let you call APIYI’s two OpenAI GPT image models — official gpt-image-2 (fine-grained control, token-based billing, 4K) and reverse gpt-image-2-all (conversational, per-call billing, ChatGPT parity) — directly from Codex CLI, OpenCode, Gemini CLI, GitHub Copilot, Cursor, Amp, and any Skills-compatible tool, via a single natural-language prompt.
Project Info
- 🔗 Source:
github.com/wuchubuzai2018/expert-skills-hub - 📦 Skill IDs:
apiyi-gpt-image-2-gen(official),apiyi-gpt-image-2-all-gen(reverse) - 👤 Author: wuchubuzai2018
- ⭐ Community contribution, shares the same repository as the author’s Nano Banana Pro Image-Gen Skill
Core Features
One-sentence image generation
Describe in Chinese or English right inside your AI coding assistant and get an image back
Dual-model coverage
Official
gpt-image-2 and reverse gpt-image-2-all are both available — pick per scenario4K + custom sizes (official)
Official Skill supports 1024², 1536×1024, 2048², 3840×2160 presets and custom dimensions
Quality / format control (official)
quality (low / medium / high / auto) + output format (png / jpeg / webp) + compression 0-100Up to 5 reference images
Both skills support up to 5 stacked reference images for multi-image fusion and style transfer
Multi-tool compatible
Works in Codex CLI, OpenCode, Gemini CLI, GitHub Copilot, Cursor, Amp
Node.js + Python runtimes
Ships both
generate_image.js and generate_image.pyZero-friction setup
Set
APIYI_API_KEY once; use -k for temporary overridesSupported APIYI Models
Quick Start: 3 Steps
Step 1: Get your APIYI key
- Visit the APIYI Console and sign in
- Under Tokens, generate a new key (starts with
sk-) - Recommended: create a dedicated key with a usage cap
New users get a free trial credit — enough to try both GPT image models.
Step 2: Install the skill(s) — pick one or install both
Official Reverse
gpt-image-2 (recommended):gpt-image-2-all:Command-Line Parameters
apiyi-gpt-image-2-gen (official)
| Parameter | Short | Required | Description | Example |
|---|---|---|---|---|
--prompt | -p | Yes | Generation prompt or edit instruction | "An orange cat on grass" |
--filename | -f | No | Output path (auto timestamped if omitted) | "cat.png" |
--size | -s | No | Preset (1024x1024 / 1536x1024 / 1024x1536 / 2048x2048 / 2048x1152 / 3840x2160 / 2160x3840) or custom | "2048x1152" |
--quality | -q | No | low / medium / high / auto | "high" |
--output-format | -o | No | png (default) / jpeg / webp | "webp" |
--output-compression | -c | No | 0-100 (jpeg / webp only) | 80 |
--input-image | -i | No | Reference image(s), up to 5 | "portrait.png" |
--api-key | -k | No | Override env var for one call | "sk-xxx" |
1:1, 3:2, 2:3, 16:9, 9:16, plus any custom ratio within 3:1.
Custom size constraints: each edge ≤ 3840px; both dimensions divisible by 16; total pixels between 655,360 and 8,294,400.
Typical latency: 120–150s per request (longer for complex 4K scenes).
apiyi-gpt-image-2-all-gen (reverse)
| Parameter | Short | Required | Description | Example |
|---|---|---|---|---|
--prompt | -p | Yes | Conversational prompt (size/ratio described inside the prompt) | "widescreen 16:9 cyberpunk city" |
--filename | -f | No | Output path (auto timestamped PNG if omitted) | "city.png" |
--response-format | -r | No | url (default, R2 CDN ~24h valid) or b64_json | "b64_json" |
--input-image | -i | No | Reference image(s), up to 5 | "ref.png" |
--api-key | -k | No | Override env var for one call | "sk-xxx" |
The reverse skill does not accept
size / quality / aspect_ratio CLI flags — describe all of that in the prompt (e.g., "vertical 9:16 mobile poster", "1024x1024 square"). Latency: 60–300s.Usage Examples
Example 1: Official text-to-image with precise control
Example 2: Official image editing (reference image)
Example 3: Official multi-image fusion
Example 4: Reverse conversational (size via prompt)
Example 5: Invoke from AI coding tools
After installing, just ask the assistant in Cursor / Codex CLI, etc.:- “Use apiyi-gpt-image-2-gen to generate a 3840x2160 high-quality cyberpunk city wallpaper”
- “Call apiyi-gpt-image-2-all-gen to turn photo.jpg into Studio Ghibli style”
- “Use the official skill to produce a 1:1 logo, high quality, webp format”
FAQ
Which skill should I pick?
Which skill should I pick?
- Need exact size (e.g., 3840×2160), quality tiers (low/medium/high), or specific output formats (webp / compression) → pick official
apiyi-gpt-image-2-gen - Prefer ChatGPT-parity conversational flow, flat per-call pricing ($0.03), strong text rendering, and are fine expressing size in natural language → pick reverse
apiyi-gpt-image-2-all-gen - Full side-by-side: official vs reverse comparison
`npx skills` install fails
`npx skills` install fails
- Confirm Node.js is installed (
node -v) - Verify network access to GitHub
- If
npx skillsis unavailable, clone manually:
skills/apiyi-gpt-image-2-gen or skills/apiyi-gpt-image-2-all-gen into your local Skills directory.API key invalid error
API key invalid error
- Check that
APIYI_API_KEYis set correctly (starts withsk-) - Balance — see Balance seems enough but calls fail
- For a quick test, pass
-k "sk-xxx"inline
Official skill rejects my custom size
Official skill rejects my custom size
Custom
size must satisfy:- each edge ≤ 3840px
- both dimensions divisible by 16
- total pixels between 655,360 and 8,294,400
For example,
2048x3072is valid;3000x2000is rejected because 3000 isn’t divisible by 16.
How long is the reverse skill's URL valid?
How long is the reverse skill's URL valid?
The reverse skill’s default R2 CDN URL is valid for roughly 24 hours. For production, pass
-r b64_json to receive Base64 and persist locally, or download the asset right away.Which AI coding tools are supported?
Which AI coding tools are supported?
Tested with: Codex CLI, OpenCode, Gemini CLI, GitHub Copilot, Cursor, Amp. Any Skills-compatible tool should work.
Related Resources
gpt-image-2 (official) docs
Native 2K/4K generation, per-token billing
gpt-image-2-all (reverse) docs
ChatGPT parity, $0.03 per call
Official vs Reverse comparison
17-dimension side-by-side
Nano Banana Pro Skill (same author)
Sister Skill from the same repo — Gemini image generation
Luck GPT-Image 2 ComfyUI Nodes
Same models, ComfyUI-node flavor
APIYI Console
Manage keys, usage, and channels