GPT Image Generation API
Decode serves the gpt-image family on the OpenAI Images API, so existing OpenAI SDK code only needs a new base URL and key. Every image costs ¥0.25 (about $0.04), whichever model you pick.
Models and pricing
| Model ID | Per image | About (USD) | 10 images |
|---|---|---|---|
gpt-image-2.5-flare | ¥0.25 | $0.04 | ¥2.50 |
gpt-image-2.5-sunburst | ¥0.25 | $0.04 | ¥2.50 |
Prices as of 2026-11-23, billed on the images actually returned (n: 2 is two images). Live prices are on the model square.
Start in three steps
- Sign up and top up.
- In API Keys, create a key in the "GPT 图片" group.
- Call
POST /v1/images/generations:
curl https://decode8.com/v1/images/generations \
-H "Authorization: Bearer $DECODE_IMAGE_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "gpt-image-2.5-flare", "prompt": "a corgi wearing an astronaut helmet, studio lighting", "n": 1, "size": "1024x1024", "response_format": "b64_json"}'
from openai import OpenAI
import base64
client = OpenAI(base_url="https://decode8.com/v1", api_key="sk-...")
result = client.images.generate(
model="gpt-image-2.5-flare",
prompt="a corgi wearing an astronaut helmet, studio lighting",
size="1024x1024",
response_format="b64_json",
)
with open("image.png", "wb") as f:
f.write(base64.b64decode(result.data[0].b64_json))
With response_format: "b64_json" every image comes back as b64_json plus a temporary url; without it some models return only the url. Save images right away. See the image generation reference for every field.
FAQ
How much does the GPT image API cost per image?
¥0.25 (about $0.04) per generated image, the same for every gpt-image model, size and quality. Failed requests are not charged.
Why do I get "no available channel"?
Image models need a key in the "GPT 图片" group. Create one in API Keys; keep your video keys for Seedance — both share one balance.
Can I use the OpenAI SDK?
Yes. Set base_url to https://decode8.com/v1, use your Decode key and a model ID, and call images.generate.
How long does one image take?
The call is synchronous and usually takes 30–60 seconds; set your client timeout to at least 120 seconds.