Documentation Index
Fetch the complete documentation index at: https://docs.apiyi.com/llms.txt
Use this file to discover all available pages before exploring further.
TL;DR
| If you need | Pick |
|---|---|
quality knob / mask inpainting / strict OpenAI-API field parity | gpt-image-2 (Official) |
| Predictable flat $0.03/image + faster output | gpt-image-2-all (Reverse, ChatGPT-web line, 30–60s) |
| Predictable flat $0.03/image + locked output sizes (incl. 4K) | gpt-image-2-vip (Reverse, Codex line, ~90–150s) |
gpt-image-2-all and gpt-image-2-vip — they share identical call format and the same $0.03/image flat price. The differences are confined to the size field and generation time:gpt-image-2-all: nosize(describe in prompt), ChatGPT web line, ~30–60s generationgpt-image-2-vip: 30 explicit sizes (10 ratios × 1K/2K/4K, including 4K), Codex line, ~90–150s generation (on par with the official version)- Both: no
quality, non, no mask inpainting
-all / -vip sub-rows. For quality tiers or mask inpainting, you still need the official gpt-image-2.Full Comparison Table
| Dimension | gpt-image-2-all / -vip (Reverse, cost-effective) | gpt-image-2 (Official) |
|---|---|---|
| Model name | gpt-image-2-all (no size, fastest) / gpt-image-2-vip (explicit size or 4K) | gpt-image-2 |
| Channel nature | -all: reverse-engineered ChatGPT web line-vip: reverse-engineered Codex line | Official direct (OpenAI Images API) |
| Pricing | Per-call: flat $0.03/call (both models, all sizes — no 4K surcharge) | Token-metered: matches official; ~85% of list price after APIYI deposit bonuses |
| Typical cost/image | $0.03 (regardless of size / quality / model) | Measured $0.03 – $0.2 (correlates with prompt length, size, quality) |
| Token group | Default | Default |
| Token type | Per-call or Token-priority both work | Token-priority only (this model is token-billed; per-call tokens will be rejected) |
| Recommended endpoint | /v1/chat/completions (online URLs) + /v1/images/generations + /v1/images/edits (same code as official) | /v1/images/generations + /v1/images/edits |
| Alt endpoints | All three available, pick by use case | (only the two official ones) |
| Upload format | base64 or https URL (chat endpoint) / multipart file (edits endpoint) | multipart file (edit endpoint) |
| Output format | b64_json (includes prefix) or url (R2 CDN) | b64_json (raw base64, no prefix) |
| Reference image count | Multiple (chat-mode upper bound is high) | Max 16 (image[]) |
| Mask inpainting | ❌ Not supported | ✅ Supported (alpha channel required) |
| Prompt adherence | Good | Excellent |
| Generation speed | -all: ~30–60 seconds (faster)-vip: ~90–150 seconds (on par with official) | ~100-120 seconds, complex + 4K can reach 3-5 minutes |
size parameter | -all: ❌ Not accepted (describe in prompt)-vip: ✅ 30 explicit sizes (10 ratios × 1K/2K/4K) | ✅ Any valid custom size |
| 4K support | -all: ❌-vip: ✅ 4K Detail tier (e.g., 3840x2160 / 2880x2880) | ✅ Including 3840×2160 |
| Common output sizes | -all: 16:9 → 1672×941, 9:16 → 941×1672, 1:1 → 1254×1254 (adaptive)-vip: see full 30-size table | 8 presets + any valid custom size |
quality parameter | ❌ Both reverse models reject it (do not pass) | ✅ low / medium / high / auto |
n parameter | ❌ Both reverse models reject it (1 image per call) | ✅ Supported |
| Transparent background | — | ❌ Not supported (background: transparent errors) |
| Chinese prompts | ✅ Native | ✅ Native |
| Text rendering | High fidelity | High fidelity (strongest at high tier) |
| Content restrictions | Looser | Stricter (OpenAI official policy) |
| API docs | GPT-Image-2-All Overview / GPT-Image-2-VIP Overview | GPT-Image-2 Overview |
When creating a token in the console, choose a group (
Default is fine) and a token type (Per-call / Token-priority). Calling gpt-image-2 (official) requires a “Token-priority” token — per-call tokens will be rejected due to billing-mode mismatch.When to Pick Each
Pick gpt-image-2-all (Reverse) when
💰 Predictable cost
⚡ Faster output
-vip and the official version. Better real-time UX.🗨️ Chat-style workflows
/v1/chat/completions handles multi-turn iterative editing, text-to-image, and reference editing — all from one endpoint. Simplest integration.🌏 Chinese + marketing text
Pick gpt-image-2-vip (Reverse, when you need locked size or 4K) when
📐 Strictly locked output sizes
🖼️ 4K at the same flat price
🔁 Code shared with -all
-all — just one extra size field. One codebase can switch between both models as needed.💰 Cost still predictable
Pick gpt-image-2 (Official) when
🎚️ Quality tiers
quality supports low/medium/high/auto. Use low for drafts to save cost; high for print-grade finals — official-only; both reverse models reject it.🎯 Mask inpainting
🖼️ Any custom size
size accepts any valid resolution. Pick official when the size you need isn’t in -vip’s 30-size set, or you need finer-grained dimension control.🔌 Same as OpenAI Official
Key Differences in Detail
1. b64_json format gotcha (migration trap!)
2. Resolution control
gpt-image-2-all (in the prompt):size directly, 30 sizes including 4K):
size parameter strict + quality tiers):
3. Upload / output format differences
| Operation | gpt-image-2-all | gpt-image-2 |
|---|---|---|
| Upload reference | base64 data URL or https URL (in chat messages’ image_url) | multipart image[] file field |
| Download output | Default url (R2 CDN, 24h validity), can switch to b64_json (with prefix) | b64_json (raw base64, requires decode) |
| Multi-image fusion | Multiple image_url blocks in chat | image[] array, max 16 |
4. Cost ballpark
| Scenario | gpt-image-2-all / -vip | gpt-image-2 |
|---|---|---|
| 1024×1024 draft | $0.03 | ~$0.006 (low) |
| 1024×1024 medium quality | $0.03 | ~$0.053 (medium) |
| 1024×1024 high quality | $0.03 | ~$0.211 (high) |
| 2048×1152 high quality | $0.03 | ~$0.20+ (token-metered) |
| 3840×2160 4K high quality | $0.03 (only -vip supports 4K) | Token-metered, significantly higher than 1K |
| Edit / multi-image fusion | $0.03 | Input tokens rise sharply, single call can hit $0.1+ |
-vip’s 4K matches 1K/2K pricing and beats the official 4K high-quality tier by an order of magnitude. Pick official only when you need quality tiers / mask inpainting / strict OpenAI-API field parity.Client Settings
| Setting | gpt-image-2-all / -vip | gpt-image-2 |
|---|---|---|
| Timeout (conservative) | -all: 300s (typical 30–60s)-vip: 300s (typical 90–150s, 4K long-tail goes higher) | 360s (4K high quality realistically reaches 3-5 minutes) |
| Retry strategy | Exponential backoff on 5xx / timeout, max 2 retries | Same |
| Concurrency | chat endpoint is naturally concurrency-friendly; 1 image per call — parallel for multiple | 1 image per call — issue parallel requests for multiple |
| Request ID | request-id response header | x-request-id response header |
FAQ
Should I compress input images? Does writing 4K / 8K in the prompt help?
Should I compress input images? Does writing 4K / 8K in the prompt help?
shell_api_error / Unknown error responses are most often triggered by oversized inputs, and compressing measurably improves success rate and latency.Don’t worry about compression hurting quality — output resolution is independent of input size. The “output-side” controls differ across the three:gpt-image-2-all: controlled by prompt composition phrasing (see the verified phrasing table on the -all overview page) —4K/8Kin the prompt does not countgpt-image-2-vip: controlled by thesizefield (30 sizes incl. 4K, flat $0.03/image)gpt-image-2: controlled bysize+quality(any valid size)
Can the same API Key call all three models?
Can the same API Key call all three models?
gpt-image-2 (official) requires a “Token-priority” token; -all / -vip accept either token type.Can the chat endpoint return text instead of an image?
Can the chat endpoint return text instead of an image?
Within the reverse channel, -all vs -vip — which to pick?
Within the reverse channel, -all vs -vip — which to pick?
sizefield:-allrejects it (describe in prompt);-vipaccepts 30 explicit sizes (incl. 4K)- Generation time:
-all~30–60s;-vip~90–150s (on par with the official version)
-all; need locked size or 4K → -vip. See the GPT-Image-2-VIP Overview for details.If `-vip` already supports 4K, do I still need the official one?
If `-vip` already supports 4K, do I still need the official one?
quality tiers (low/medium/high/auto), mask inpainting (alpha-channel mask), strict OpenAI-API field parity (zero-change migration for existing OpenAI-SDK code), arbitrary sizes outside -vip’s 30-size set.On cost: -vip’s 4K matches 1K/2K at $0.03/image — for the locked-4K use case, -vip is an order of magnitude cheaper than the official 4K high-quality tier.Migrating from 1.5 — which one should I pick?
Migrating from 1.5 — which one should I pick?
- Stick with the OpenAI SDK / must match OpenAI official: pick
gpt-image-2(official). Dropinput_fidelity, avoidbackground: transparent, leave the rest unchanged. - Cut cost, size-insensitive: pick
gpt-image-2-all(reverse, 30–60s). - Cut cost, need locked size or 4K: pick
gpt-image-2-vip(reverse, ~90–150s).
Can I deploy multiple models for failover?
Can I deploy multiple models for failover?
-all or -vip (predictable cost — pick by whether you need locked sizes), fallback gpt-image-2 (switch when you need quality tiers or mask). The reverse and official response shapes differ — normalize at the business layer.The R2 CDN image link is slow — what can I do?
The R2 CDN image link is slow — what can I do?
Related Docs
- GPT-Image-2 Overview - Full official integration docs
- GPT-Image-2-All Overview - Reverse ChatGPT-web line (fastest output) full integration docs
- GPT-Image-2-VIP Overview - Reverse Codex line (30 sizes, 4K) full integration docs
- Deep dive: gpt-image-2 launch - Official version launch
- Deep dive: gpt-image-2-all launch - Reverse-engineered version launch
- Community: Luck GPT-Image 2 ComfyUI Nodes - Multi-model ComfyUI node pack
- Community: APIYI GPT-Image 2 Skills - Multi-model AI Agent Skill pack
- Deposit promotions - Recharge bonus policy