Skip to main content

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
Which skill should I pick?
  • apiyi-gpt-image-2-gen (official, recommended): controllable size / quality / output-format / compression, supports 4K (3840×2160), custom sizes, and semantic editing; token-based billing — best when you have specific quality or size requirements
  • apiyi-gpt-image-2-all-gen (reverse): needs only a prompt plus optional response-format; size/ratio described in the prompt; per-call billing ($0.03/call); parity with the ChatGPT web experience — best for natural-language direct output, strong text rendering, iterative edits
  • Full side-by-side: official vs reverse comparison

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 scenario

4K + 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-100

Up 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.py

Zero-friction setup

Set APIYI_API_KEY once; use -k for temporary overrides

Supported APIYI Models

Quick Start: 3 Steps

1

Step 1: Get your APIYI key

  1. Visit the APIYI Console and sign in
  2. Under Tokens, generate a new key (starts with sk-)
  3. Recommended: create a dedicated key with a usage cap
New users get a free trial credit — enough to try both GPT image models.
2

Step 2: Install the skill(s) — pick one or install both

Official gpt-image-2 (recommended):
Reverse gpt-image-2-all:
Node.js is required; Python scripts work as a backup runtime. If Node.js isn’t installed, grab it at nodejs.org.
3

Step 3: Configure the API key

Set the env var (we recommend persisting it in ~/.zshrc / ~/.bashrc):
Windows PowerShell:
Done! Any Skills-compatible AI coding tool can now trigger the two skills via natural language.

Command-Line Parameters

apiyi-gpt-image-2-gen (official)

Supported aspect ratios: 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)

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”
The assistant will pick the right skill and assemble the CLI flags for you.

FAQ

  • 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
  1. Confirm Node.js is installed (node -v)
  2. Verify network access to GitHub
  3. If npx skills is unavailable, clone manually:
Then copy either skills/apiyi-gpt-image-2-gen or skills/apiyi-gpt-image-2-all-gen into your local Skills directory.
  1. Check that APIYI_API_KEY is set correctly (starts with sk-)
  2. Balance — see Balance seems enough but calls fail
  3. For a quick test, pass -k "sk-xxx" inline
Custom size must satisfy:
  • each edge ≤ 3840px
  • both dimensions divisible by 16
  • total pixels between 655,360 and 8,294,400 For example, 2048x3072 is valid; 3000x2000 is rejected because 3000 isn’t divisible by 16.
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.
Tested with: Codex CLI, OpenCode, Gemini CLI, GitHub Copilot, Cursor, Amp. Any Skills-compatible tool should work.

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