API & features
Image generation
Generate and edit images through OpenAI-compatible image endpoints. Billed per image, independent of group rates. See Pricing · Image models.
- Groups
- Seedream Image (
seedream-5-5) and ChatGPT Image (gpt-image-2.6-sunburstand other gpt-image models); Grok Imagine images are only in the Grok Enterprise group - Endpoints
https://api.yuzuapi.com/v1/images/generations(generate) and/v1/images/edits(edit uploaded images)- Keys
- Keys from image groups can only generate images, not chat. Create separate keys for chat and images
Seedream 5.5
Doubao Seedream 5.5 via the official Volcengine Ark channel: text-to-image, up to 10 reference images, transparent PNG and layer split. Use model seedream-5-5 (the official ID doubao-seedream-5-5-261028 also works). No watermark by default; pass "watermark": true if you want one.
import os
from openai import OpenAI
# Use a key from the Seedream Image group; allow a 300 s timeout for large images
client = OpenAI(base_url="https://api.yuzuapi.com/v1", api_key=os.environ["YUZU_API_KEY"], timeout=300)
img = client.images.generate(
model="seedream-5-5",
prompt="a minimalist Nordic ceramic pour-over kettle on a light oak table, soft morning backlight, product photo",
size="2K", # 1K / 1.5K / 2K / 3K, or exact pixels such as 2560x1440
response_format="url",
)
print(img.data[0].url) # temporary link, valid for about 24 hourscurl --max-time 300 https://api.yuzuapi.com/v1/images/generations \
-H "Authorization: Bearer $YUZU_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "seedream-5-5", "prompt": "a yuzu on a wooden table, soft morning light", "size": "16:9", "resolution": "2K"}'const res = await fetch("https://api.yuzuapi.com/v1/images/generations", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.YUZU_API_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({ model: "seedream-5-5", prompt: "a yuzu on a wooden table, soft morning light", size: "2K" }),
signal: AbortSignal.timeout(300_000),
});
if (!res.ok) throw new Error(`HTTP ${res.status}: ${await res.text()}`);
const { data, usage } = await res.json();
console.log(data[0].url, usage);| Parameter | Description |
|---|---|
size | Three forms: tier 1K / 1.5K / 2K / 3K; aspect ratio such as 16:9 (with resolution); or exact pixels such as 2560x1440, up to 3840×2160 |
resolution | Used when size is a ratio: 1K / 1.5K / 2K / 3K |
image | Reference images as public URLs or data:image/png;base64,…, up to 10 (image_urls also works) |
output_format | png (default) or jpeg |
background | transparent for a transparent PNG (requires png), or opaque |
response_format | url (default, a temporary link valid for about 24 hours) or b64_json |
Reference imagesUp to 10 references; say clearly what to change and what to keep
curl --max-time 300 https://api.yuzuapi.com/v1/images/generations \
-H "Authorization: Bearer $YUZU_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "seedream-5-5",
"prompt": "Keep the face, hair and outfit of the person in image 1, add the sunglasses from image 2, keep the background",
"image": ["https://example.com/person.png", "https://example.com/sunglasses.png"],
"size": "2K"
}'Upload a local imageUpload a file to /v1/images/edits directly, no image hosting needed
curl --max-time 300 https://api.yuzuapi.com/v1/images/edits \ -H "Authorization: Bearer $YUZU_API_KEY" \ -F "model=seedream-5-5" \ -F "prompt=Keep the product and its label, replace the background with a light grey studio" \ -F "size=2K" \ -F "image[]=@./product.png"
Transparent PNGStickers, icons and product shots; references do not need an alpha channel
curl --max-time 300 https://api.yuzuapi.com/v1/images/generations \
-H "Authorization: Bearer $YUZU_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "seedream-5-5", "prompt": "a translucent ice-blue glass fox badge sticker, isolated subject", "size": "2K", "output_format": "png", "background": "transparent"}'Layer splitSplit one image into a base image plus up to 99 transparent layers, with text recognition
Use the native Volcengine Ark endpoint /api/v3/images/generations with exactly 1 PNG / JPEG reference. Do not send background, and size must be auto / 1K / 1.5K / 2K.
curl --max-time 600 https://api.yuzuapi.com/api/v3/images/generations \
-H "Authorization: Bearer $YUZU_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedream-5-5-261028",
"prompt": "Split the title, decorations and subject of the poster into separate layers and fill in the base image",
"image": "https://example.com/poster.png",
"size": "2K",
"layer_decomposition": true,
"layer_decomposition_options": {"max_images": 10, "text_recognition": true}
}'Every layer is billed as one output image, plus one reference image. max_images (2–100, default 30, including the base) caps the number of outputs, so start small. Layer split usually takes 1–4 minutes; set a 600 s client timeout.
Returned image links are temporary and usually expire after 24 hours, so download what you need. You can view and download your generations in Creations in the console. Failed generations are free.
GPT Image
Use a key from the ChatGPT Image group. Billed per image; higher resolution costs more.
import base64, os
from openai import OpenAI
client = OpenAI(base_url="https://api.yuzuapi.com/v1", api_key=os.environ["YUZU_API_KEY"])
img = client.images.generate(model="gpt-image-2.6-sunburst", prompt="an orange cat napping under a yuzu tree, watercolor", size="1024x1024")
open("out.png", "wb").write(base64.b64decode(img.data[0].b64_json))curl https://api.yuzuapi.com/v1/images/generations \
-H "Authorization: Bearer $YUZU_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "gpt-image-2.6-sunburst", "prompt": "a yuzu on a wooden table, studio light", "size": "1024x1024"}'Models: gpt-image-2.6-sunburst, gpt-image-2.6-flare, gpt-image-2.5-sunburst, gpt-image-2.5-flare and gpt-image-2. size accepts common sizes such as 1024x1024 and 1536x1024; a longest side above 1024 px is billed as 2K, above 2048 px as 4K.
Generate images in Cherry Studio, Chatbox and other clients
Any client that supports the OpenAI image endpoint (/v1/images/generations) works. Add a separate provider for image generation:
| Field | Value |
|---|---|
| Provider type | OpenAI / OpenAI API compatible |
| API host | https://api.yuzuapi.com |
| API key | A key from an image group (Seedream Image or ChatGPT Image) |
| Model | Add seedream-5-5 or gpt-image-2.6-sunburst manually, with the type set to image generation |
Cherry Studio: open Paintings in the sidebar, pick the provider and model above and enter a prompt. Chatbox: use Image Creator and pick the provider and model. Menu names vary between versions; clients that only use the chat endpoint (/v1/chat/completions) cannot generate images.
Image-group keys cannot chat, so do not put them in your chat provider; use a key from another group for chat.