APIs and capabilities

Seedream 5.5 Image & Layer API Guide

Integrate ByteDance Seedream 5.5 on ZhenAPI (/api/v3 Ark & /v1/images): watermark-free by default, native RGBA transparency, up to 10 ref images, 100-layer split & OCR.

ZhenAPI provides direct high-concurrency access to ByteDance Volcengine Ark’s flagship visual generation model Doubao Seedream 5.5 (canonical ID doubao-seedream-5-5-261028, shorthand alias seedream-5-5). The media gateway exposes 100% pass-through Volcengine Ark /api/v3, OpenAI-compatible /v1/images, and an async task queue — billed strictly by actual output pixel tier in RMB (¥0 charge on failed or zero-output requests).

No Watermark by Defaultwatermark: false is injected automatically unless you explicitly send "watermark": true.
Native RGBA Alphabackground: "transparent" outputs smooth semi-transparent PNG edges directly; reference images do not need an alpha channel.
10-Image Fusion & EditsPass up to 10 reference URLs / Data URIs or upload local files via /v1/images/edits with strong multi-turn subject consistency.
1 Base + 99 Layers & OCRDecomposes composites into an inpainted base canvas plus up to 99 transparent PNG layers with bounding_box coordinates and rich-text OCR.
Key Setup: Create an API key on API Keys bound to Seedream (Official Direct) (or a composite group routed to Seedream). Base URL: https://api.zhenapi.ai with header Authorization: Bearer <API_KEY>.

1. Dual-Protocol Endpoints, Sync vs. Async & Model IDs

Choose either protocol depending on your SDK or client — both share the same account pool and real-time per-image RMB billing:

EndpointProtocolCapabilities & Best Use Case
POST /api/v3/images/generations
(also /v3/images/generations)
Volcengine Ark Native100% lossless pass-through of official Ark fields (layer_decomposition, sequential_image_generation, optimize_prompt_options, tools). Works directly with volcengine-python-sdk[ark].
POST /v1/images/generations
(also /images/generations)
OpenAI-CompatibleSupports short alias seedream-5-5, aspect-ratio + tier mapping (size: "16:9" + resolution: "2K"), lossless webp/jpg → png/jpeg conversion, proportional upscaling for sub-1K sizes (512x512 → 1024x1024), and extra field stripping.
POST /v1/images/edits
(also /images/edits)
Multipart Local UploadUpload up to 10 local image files via multipart/form-data without staging files to public object storage first.
POST /v1/images/generations/async
POST /v1/images/edits/async
Async Job QueueReturns HTTP 202 Accepted with task_id immediately and archives finished outputs to Creations. Strongly recommended for layer decomposition (1–4 min) and multi-image batches.
GET /v1/images/tasks/{task_id}
(also /images/tasks/{task_id})
Async Status PollingMust query with the same API key; terminal states are completed / failed / indeterminate. Read URLs, layer coordinates, and OCR fields from result.data[].
Sync vs. Async Selection: Use sync endpoints (with HTTP client timeout set to 180–300s) for single text-to-image, transparent stickers, or standard edits. Always use /async for layer_decomposition: true or batch jobs — poll every 3s during the first 30s and every 5–8s afterward, and never resubmit while status is processing.

Supported Seedream model IDs (live discounted rates on Model Pricing):

  • doubao-seedream-5-5-261028 Flagship · No Watermark (aliases seedream-5-5 / seedream-5.5 / doubao-seedream-5-5 / seedream): Native RGBA alpha PNGs, up to 10 reference images, 2–100 layer decomposition, rich-text OCR, and exact resolutions up to 8,294,400 pixels (4K UHD 3840x2160). Selected automatically when model is omitted on Seedream-only groups via /v1/images/*.
  • doubao-seedream-5-0-pro-260628 (alias seedream-5-0-pro) & doubao-seedream-5-0-flash-260915 (alias seedream-5-0-flash): High-throughput options for standard batch text-to-image workloads.

2. Zero-Code Setup in Codex, Desktop & Workflow Clients

  • Codex / Claude Code Image Skill: Ask your agent to install or update https://zhenapi.ai/install/skill/image-gen/INSTALL.md, set IMAGE_GEN_API_KEY (and optionally IMAGE_GEN_MODEL=seedream-5-5), then prompt naturally — e.g. “Use the image-gen skill with seedream-5-5 to generate a cinematic 16:9 banner.”
  • Cherry Studio: On API Keys, click “Import to CCS” and choose Cherry Studio, or set API Host to https://api.zhenapi.ai and add model seedream-5-5.
  • Dify / LobeChat / Open WebUI / NextChat / ComfyUI: Point any OpenAI Images integration to https://api.zhenapi.ai/v1 with model seedream-5-5. The gateway automatically disables watermarks, upscales legacy 512x512 sizes to 1K, repairs raw Base64 data headers, and strips unsupported fields (quality, style, negative_prompt).

3. Production Code Examples

3.1 Text-to-Image by Aspect Ratio & Tier (Python & cURL)

Python (OpenAI SDK · 16:9 at 2K Resolution, Watermark-Free)
1import os
2from openai import OpenAI
3
4client = OpenAI(
5 base_url="https://api.zhenapi.ai/v1",
6 api_key=os.environ["ZHENAPI_SEEDREAM_KEY"],
7 timeout=240.0,
8)
9
10resp = client.images.generate(
11 model="seedream-5-5",
12 prompt="Minimalist anodized aluminum desk speaker on walnut wood, soft morning studio rim lighting, clean neutral backdrop",
13 size="16:9", # Combined with resolution="2K" -> 2560x1440
14 extra_body={
15 "resolution": "2K",
16 "output_format": "png",
17 },
18)
19print("Generated URL:", resp.data[0].url)
cURL (Volcengine Ark Native /api/v3)
1curl --max-time 240 https://api.zhenapi.ai/api/v3/images/generations \
2 -H "Authorization: Bearer $ZHENAPI_SEEDREAM_KEY" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "model": "doubao-seedream-5-5-261028",
6 "prompt": "Cyberpunk rainy alley ramen shopfront illustration, warm neon reflections on wet cobblestones",
7 "size": "2560x1440",
8 "output_format": "png"
9 }'

3.2 Native RGBA Transparent Assets

Pass "background": "transparent" with "output_format": "png" to output smooth alpha-channel stickers, UI icons, or product cutouts (input reference images do not need transparency; combining transparent with jpeg returns HTTP 400 with ¥0 charge):

cURL (Native RGBA Sticker / UI Icon)
1curl --max-time 240 https://api.zhenapi.ai/v1/images/generations \
2 -H "Authorization: Bearer $ZHENAPI_SEEDREAM_KEY" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "model": "seedream-5-5",
6 "prompt": "3D frosted glass lightning badge icon with lime-green specular highlights, crisp isolated edges",
7 "size": "1:1",
8 "resolution": "1K",
9 "background": "transparent",
10 "output_format": "png"
11 }'

3.3 Local Multi-Image Fusion & Multi-Turn Editing (/v1/images/edits)

Upload up to 10 local files via multipart/form-data (fields image, image[], or images). For high-consistency multi-turn edits, keep "background": "opaque", feed the previous round’s output URL into image, and state both what changes this turn + what remains unchanged in your prompt:

Python (Upload Two Local Reference Images)
1import os
2import requests
3
4resp = requests.post(
5 "https://api.zhenapi.ai/v1/images/edits",
6 headers={"Authorization": f"Bearer {os.environ['ZHENAPI_SEEDREAM_KEY']}"},
7 files=[
8 ("image", ("product.png", open("product.png", "rb"), "image/png")),
9 ("image", ("palette.png", open("palette.png", "rb"), "image/png")),
10 ],
11 data={
12 "model": "seedream-5-5",
13 "prompt": "Keep the bottle silhouette, glass refraction, and front label text from image 1 identical; replace the background with a mossy stream rock podium matching image 2",
14 "size": "3:4",
15 "resolution": "2K",
16 "background": "opaque",
17 "output_format": "png",
18 },
19 timeout=240,
20)
21resp.raise_for_status()
22print(resp.json()["data"][0]["url"])

3.4 Async Layer Decomposition (1 Base + Up to 99 Layers) & Rich-Text OCR

3 Hard Rules for Layer Decomposition: ① Pass strictly 1 PNG or JPEG input image; ② Omit background completely (even "auto" returns HTTP 400); ③ size only accepts "auto" (default), "1K", "1.5K", or "2K" (no aspect ratios, exact W×H, or 3K). Always submit via /async:
Node.js 18+ (Async Layer Split & Backoff Polling)
1const API_KEY = process.env.ZHENAPI_SEEDREAM_KEY;
2const BASE = "https://api.zhenapi.ai/v1";
3
4const submitRes = await fetch(`${BASE}/images/generations/async`, {
5 method: "POST",
6 headers: {
7 Authorization: `Bearer ${API_KEY}`,
8 "Content-Type": "application/json",
9 },
10 body: JSON.stringify({
11 model: "seedream-5-5",
12 image: "https://example.com/poster.png",
13 size: "auto",
14 layer_decomposition: true,
15 layer_decomposition_options: {
16 max_images: 20, // Integer [2, 100] (includes 1 base image), default 30
17 text_recognition: true, // Extract printed text, font family & color metadata
18 },
19 }),
20});
21const { task_id } = await submitRes.json();
22
23const startedAt = Date.now();
24while (true) {
25 const waitMs = Date.now() - startedAt < 30_000 ? 3000 : 6000;
26 await new Promise((r) => setTimeout(r, waitMs));
27 const pollRes = await fetch(`${BASE}/images/tasks/${task_id}`, {
28 headers: { Authorization: `Bearer ${API_KEY}` },
29 });
30 const task = await pollRes.json();
31 if (task.status === "completed" || task.status === "succeeded") {
32 console.log("Extracted base + layers:", task.result?.data?.length);
33 console.log(JSON.stringify(task.result.data, null, 2));
34 break;
35 }
36 if (task.status === "failed" || task.status === "indeterminate") {
37 throw new Error(`Task ended (${task.status}): ${JSON.stringify(task.error)}`);
38 }
39}

4. Full Request Parameter Reference

ParameterRequiredType / DefaultConstraints & Gateway Behavior
modelRequiredstring
Default seedream-5-5
Canonical doubao-seedream-5-5-261028 or alias seedream-5-5; auto-filled when omitted on Seedream-only groups via /v1/images/*.
promptConditionalstring
Default —
Required for standard generation/editing; optional when layer_decomposition: true. Recommended ≤ 300 Chinese chars or ≤ 600 English words.
image / image_urlsOptionalstring | string[]
Default —
Public http(s) URL, lowercase data:image/<fmt>;base64,..., or raw Base64. 0–10 images for normal generation/editing (also accepts images / image_url or /v1/images/edits files); strictly 1 image for layer decomposition.
sizeOptionalstring
Default 2K / auto
Normal mode: ① tier 1K / 1.5K / 2K (plus 3K on /v1); ② aspect ratio e.g. "16:9" (/v1 only); ③ exact WxH e.g. "2560x1440". Layer decomposition: only auto (default), 1K, 1.5K, 2K.
resolutionOptional (/v1)string
Default 2K
/v1/images/* only: 1K / 1.5K / 2K / 3K, paired with aspect-ratio size (or aspect_ratio).
output_formatOptionalstring
Default png
png or jpeg (webp / jpg on /v1 auto-convert to png / jpeg). In layer decomposition, applies only to data[0] base image; extracted layers are always transparent png.
backgroundOptionalstring
Default auto
Normal mode: auto, transparent (requires png), or opaque. Strictly forbidden when layer_decomposition: true.
watermarkOptionalboolean
Default false
Automatically set to false (no watermark); corner badge is added only when explicitly true.
response_formatOptionalstring
Default url
url (24h signed URL) or b64_json (async tasks rewrite persisted outputs to downloadable URLs).
layer_decompositionOptionalboolean
Default false
Set true to decompose 1 PNG/JPEG image into base + transparent layers (do not pass background).
layer_decomposition_optionsOptionalobject
Default —
Layer split options: max_images (int 2–100, default 30, includes base image); text_recognition (bool, default false, enables rich-text OCR).
sequential_image_generationOptionalstring
Default disabled
Ark native multi-image sequence mode ("auto" or "disabled"), paired with sequential_image_generation_options.max_images (reserves up to 15 if omitted).
optimize_prompt_optionsOptionalobject
Default {"mode":"standard"}
Seedream 5.5 supports only {"mode": "standard"} (enabled by default; "fast" or disabling is rejected).
safety_identifierOptionalstring
Default —
Hashed end-user ID up to 64 chars (OpenAI user field on /v1/images/* maps here automatically).

5. Pixel Matrix & Reference Image Limits

5.1 10 Aspect Ratios × 4 Tiers (40 Exact Resolutions)

Exact WxH sizes in normal mode must satisfy 921,600 ≤ W×H ≤ 8,294,400 and aspect ratio 1:16 – 16:1:

Aspect Ratio1K (≤1.40M px)1.5K (≤2.61M px)2K (≤4.63M px)3K Ultra (≤8.30M px)
1:1 Square1024x10241536x15362048x20482880x2880
16:9 Landscape1280x7201920x10802560x14403840x2160 (4K UHD)
9:16 Portrait720x12801080x19201440x25602160x3840
4:3 Standard1152x8641728x12962304x17283200x2400
3:4 Vertical864x11521296x17281728x23042400x3200
3:2 Photo1248x8321920x12802496x16643456x2304
2:3 Poster832x12481280x19201664x24962304x3456
21:9 Ultrawide1512x6482268x9723024x12964200x1800
2:1 Banner1440x7202048x10242880x14404000x2000
1:2 Tall720x14401024x20481440x28802000x4000

5.2 Reference Image Input Limits (Normal Edits vs. Layer Split)

ConstraintNormal Generation / Multi-Image EditsLayer Decomposition (layer_decomposition: true)
Image Count0 – 10 images (>10 returns HTTP 400)Strictly 1 image
File Formatsjpeg, png, webp, bmp, tiff, gif, heic, heifpng or jpeg only
File Size≤ 30 MiB per file (≤ 96 MiB total multipart payload)≤ 30 MiB
Total Pixels (W × H)196 – 36,000,000 (both width > 14 px & height > 14 px)262,144 (512×512) – 36,000,000
Aspect Ratio1:16 – 16:11:16 – 16:1
Data URI Formatdata:image/<lowercase-mime>;base64,<payload>data:image/png;base64,... or image/jpeg

6. Canvas Coordinate Reconstruction & Rich-Text OCR Schema

  • Canvas Reconstruction Rule: data[0] (z_index: 0) is the inpainted full-canvas base image whose size defines the master canvas dimensions; items with z_index >= 1 are cropped transparent PNG layers. A sub-layer’s own size is NOT its canvas placement size — resize each sub-layer to its bounding_box (width, height), position it at top-left (x, y), and composite in ascending z_index order.
  • OCR Scope Caveat: When text_recognition: true is enabled, text_recognition metadata (text, similar_font_family, text color/stroke styles) is returned only on regular printed text layers — it is omitted on the base image, illustrations, handwriting, or heavily stylized lettering. Always treat it as optional in client parsers.
Sample Layer Decomposition & OCR Payload (result.data[])
1{
2 "data": [
3 {
4 "z_index": 0,
5 "name": "background",
6 "size": "1728x2304",
7 "output_format": "png",
8 "background": "opaque",
9 "url": "https://ark-content-generation-.../base.png"
10 },
11 {
12 "z_index": 3,
13 "name": "headline_text",
14 "size": "1024x320",
15 "output_format": "png",
16 "background": "transparent",
17 "bounding_box": {
18 "x": 180,
19 "y": 210,
20 "width": 1368,
21 "height": 428
22 },
23 "text_recognition": {
24 "text": "SUMMER COLD BREW",
25 "similar_font_family": "Source Han Sans CN Bold",
26 "font_color": "#1F2937"
27 },
28 "url": "https://ark-content-generation-.../layer_3.png"
29 }
30 ],
31 "usage": {
32 "input_images": 1,
33 "generated_images": 12
34 }
35}

7. Two-Stage Pixel-Area Billing & Creations Gallery

Seedream uses transparent two-stage per-image billing with ¥0 prompt token fees:

Actual Charge = (Billable Input Images × Input Unit Price + ∑ Output Tier Unit Prices) × Effective Multiplier

Billing Item / Output TierPixel-Area Rule (Response data[].size W × H)Typical Dimensions & Notes
Input Reference ImageBilled per passed image (usage.input_images)¥0 for pure text-to-image; 2 fused images = 2× input unit; 1 source image in layer split = 1× input unit.
Output · 1K TierW × H ≤ 1,400,000 px1024×1024 (1.05M), 1280×720 (0.92M), 1152×864 (1.00M).
Output · 1.5K Tier1,400,000 < W × H ≤ 2,610,000 px1536×1536 (2.36M), 1920×1080 (2.07M), 2048×1024 (2.10M — billed as 1.5K by area!).
Output · 2K Tier2,610,000 < W × H ≤ 4,630,000 px2048×2048 (4.19M), 2560×1440 (3.69M), 2496×1664 (4.15M).
Output · 3K Tier4,630,000 < W × H ≤ 8,294,400 px2880×2880 (8.29M), 3840×2160 (8.29M · 4K UHD).
  • Layer Reserve & Instant Refund: Layer decomposition pre-reserves balance for max_images (default 30) and settles strictly by actual generated base + sub-layers, refunding unused reserve immediately.
  • 24h Signed URLs & 30-Day Creations Archive: Upstream Volcengine TOS links expire in 24 hours; download production assets promptly. Sync and async metadata are archived for 30 days in Creations with checkerboard alpha & layer preview.

8. Error Codes & Validation Troubleshooting (Zero Charge on Failures)

HTTPError MessageCause & Fix
401 / 403 / 404Volces native images API is only supported for seedream groups / Image generation is not enabledKey belongs to a non-Seedream or non-image group. Switch to a Seedream (Official Direct) key on API Keys.
400seedream cannot combine background=transparent with output_format=jpegJPEG lacks alpha support. Set "output_format": "png" when background is "transparent".
400seedream does not accept background parameter when layer_decomposition=trueRemove the background field completely during layer decomposition (even "auto" is rejected).
400seedream layer_decomposition=true requires exactly 1 input image / only supports size auto, 1K, 1.5K, or 2KPass strictly 1 PNG/JPEG image, keep size in auto / 1K / 1.5K / 2K, and set max_images within [2, 100].
400seedream 5.5 optimize_prompt_options.mode only supports standardOnly "standard" prompt optimization is supported (enabled by default); omit the field rather than passing "fast".
400requires total pixels within [921600, 8294400] / aspect ratio within [1:16, 16:1] / supports up to 10 reference imagesOn native /api/v3, exact WxH must fall in 921,600–8,294,400 px (/v1 auto-upscales small sizes); normal edits accept ≤10 images and ≤30 MiB per file.
400seedream does not support mask parameter / OpenAI file_id / n > 1 on /v1/imagesSeedream performs semantic reference editing without binary mask or OpenAI file_id; for multi-image sequences use sequential_image_generation: "auto".
429Too Many Requests (Upstream IPM Rate Limit)Upstream enforces images-per-minute (IPM) quotas, and layer jobs pre-occupy max_images slots until completion. Lower max_images to 10–25 and retry with exponential backoff.
Timeout / 504Client socket hangup or gateway timeoutLayer splits take 1–4 minutes. Submit via /v1/images/generations/async and poll /v1/images/tasks/{task_id} instead of retrying sync requests.

9. Official Documentation & Related Guides