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).
watermark: false is injected automatically unless you explicitly send "watermark": true.background: "transparent" outputs smooth semi-transparent PNG edges directly; reference images do not need an alpha channel./v1/images/edits with strong multi-turn subject consistency.bounding_box coordinates and rich-text OCR.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:
| Endpoint | Protocol | Capabilities & Best Use Case |
|---|---|---|
POST /api/v3/images/generations(also /v3/images/generations) | Volcengine Ark Native | 100% 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-Compatible | Supports 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 Upload | Upload up to 10 local image files via multipart/form-data without staging files to public object storage first. |
POST /v1/images/generations/asyncPOST /v1/images/edits/async | Async Job Queue | Returns 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 Polling | Must query with the same API key; terminal states are completed / failed / indeterminate. Read URLs, layer coordinates, and OCR fields from result.data[]. |
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-261028Flagship · No Watermark (aliasesseedream-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 to8,294,400pixels (4K UHD3840x2160). Selected automatically whenmodelis omitted on Seedream-only groups via/v1/images/*.doubao-seedream-5-0-pro-260628(aliasseedream-5-0-pro) &doubao-seedream-5-0-flash-260915(aliasseedream-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, setIMAGE_GEN_API_KEY(and optionallyIMAGE_GEN_MODEL=seedream-5-5), then prompt naturally — e.g. “Use the image-gen skill withseedream-5-5to 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.aiand add modelseedream-5-5. - Dify / LobeChat / Open WebUI / NextChat / ComfyUI: Point any OpenAI Images integration to
https://api.zhenapi.ai/v1with modelseedream-5-5. The gateway automatically disables watermarks, upscales legacy512x512sizes 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)
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):
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:
3.4 Async Layer Decomposition (1 Base + Up to 99 Layers) & Rich-Text OCR
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:4. Full Request Parameter Reference
| Parameter | Required | Type / Default | Constraints & Gateway Behavior |
|---|---|---|---|
model | Required | stringDefault 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/*. |
prompt | Conditional | stringDefault — | Required for standard generation/editing; optional when layer_decomposition: true. Recommended ≤ 300 Chinese chars or ≤ 600 English words. |
image / image_urls | Optional | string | 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. |
size | Optional | stringDefault 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. |
resolution | Optional (/v1) | stringDefault 2K | /v1/images/* only: 1K / 1.5K / 2K / 3K, paired with aspect-ratio size (or aspect_ratio). |
output_format | Optional | stringDefault 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. |
background | Optional | stringDefault auto | Normal mode: auto, transparent (requires png), or opaque. Strictly forbidden when layer_decomposition: true. |
watermark | Optional | booleanDefault false | Automatically set to false (no watermark); corner badge is added only when explicitly true. |
response_format | Optional | stringDefault url | url (24h signed URL) or b64_json (async tasks rewrite persisted outputs to downloadable URLs). |
layer_decomposition | Optional | booleanDefault false | Set true to decompose 1 PNG/JPEG image into base + transparent layers (do not pass background). |
layer_decomposition_options | Optional | objectDefault — | Layer split options: max_images (int 2–100, default 30, includes base image); text_recognition (bool, default false, enables rich-text OCR). |
sequential_image_generation | Optional | stringDefault 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_options | Optional | objectDefault {"mode":"standard"} | Seedream 5.5 supports only {"mode": "standard"} (enabled by default; "fast" or disabling is rejected). |
safety_identifier | Optional | stringDefault — | 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 Ratio | 1K (≤1.40M px) | 1.5K (≤2.61M px) | 2K (≤4.63M px) | 3K Ultra (≤8.30M px) |
|---|---|---|---|---|
1:1 Square | 1024x1024 | 1536x1536 | 2048x2048 | 2880x2880 |
16:9 Landscape | 1280x720 | 1920x1080 | 2560x1440 | 3840x2160 (4K UHD) |
9:16 Portrait | 720x1280 | 1080x1920 | 1440x2560 | 2160x3840 |
4:3 Standard | 1152x864 | 1728x1296 | 2304x1728 | 3200x2400 |
3:4 Vertical | 864x1152 | 1296x1728 | 1728x2304 | 2400x3200 |
3:2 Photo | 1248x832 | 1920x1280 | 2496x1664 | 3456x2304 |
2:3 Poster | 832x1248 | 1280x1920 | 1664x2496 | 2304x3456 |
21:9 Ultrawide | 1512x648 | 2268x972 | 3024x1296 | 4200x1800 |
2:1 Banner | 1440x720 | 2048x1024 | 2880x1440 | 4000x2000 |
1:2 Tall | 720x1440 | 1024x2048 | 1440x2880 | 2000x4000 |
5.2 Reference Image Input Limits (Normal Edits vs. Layer Split)
| Constraint | Normal Generation / Multi-Image Edits | Layer Decomposition (layer_decomposition: true) |
|---|---|---|
| Image Count | 0 – 10 images (>10 returns HTTP 400) | Strictly 1 image |
| File Formats | jpeg, png, webp, bmp, tiff, gif, heic, heif | png 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 Ratio | 1:16 – 16:1 | 1:16 – 16:1 |
| Data URI Format | data: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 whosesizedefines the master canvas dimensions; items withz_index >= 1are cropped transparent PNG layers. A sub-layer’s ownsizeis NOT its canvas placement size — resize each sub-layer to itsbounding_box(width, height), position it at top-left(x, y), and composite in ascendingz_indexorder. - OCR Scope Caveat: When
text_recognition: trueis enabled,text_recognitionmetadata (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.
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 Tier | Pixel-Area Rule (Response data[].size W × H) | Typical Dimensions & Notes |
|---|---|---|
| Input Reference Image | Billed 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 Tier | W × H ≤ 1,400,000 px | 1024×1024 (1.05M), 1280×720 (0.92M), 1152×864 (1.00M). |
| Output · 1.5K Tier | 1,400,000 < W × H ≤ 2,610,000 px | 1536×1536 (2.36M), 1920×1080 (2.07M), 2048×1024 (2.10M — billed as 1.5K by area!). |
| Output · 2K Tier | 2,610,000 < W × H ≤ 4,630,000 px | 2048×2048 (4.19M), 2560×1440 (3.69M), 2496×1664 (4.15M). |
| Output · 3K Tier | 4,630,000 < W × H ≤ 8,294,400 px | 2880×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)
| HTTP | Error Message | Cause & Fix |
|---|---|---|
401 / 403 / 404 | Volces native images API is only supported for seedream groups / Image generation is not enabled | Key belongs to a non-Seedream or non-image group. Switch to a Seedream (Official Direct) key on API Keys. |
400 | seedream cannot combine background=transparent with output_format=jpeg | JPEG lacks alpha support. Set "output_format": "png" when background is "transparent". |
400 | seedream does not accept background parameter when layer_decomposition=true | Remove the background field completely during layer decomposition (even "auto" is rejected). |
400 | seedream layer_decomposition=true requires exactly 1 input image / only supports size auto, 1K, 1.5K, or 2K | Pass strictly 1 PNG/JPEG image, keep size in auto / 1K / 1.5K / 2K, and set max_images within [2, 100]. |
400 | seedream 5.5 optimize_prompt_options.mode only supports standard | Only "standard" prompt optimization is supported (enabled by default); omit the field rather than passing "fast". |
400 | requires total pixels within [921600, 8294400] / aspect ratio within [1:16, 16:1] / supports up to 10 reference images | On 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. |
400 | seedream does not support mask parameter / OpenAI file_id / n > 1 on /v1/images | Seedream performs semantic reference editing without binary mask or OpenAI file_id; for multi-image sequences use sequential_image_generation: "auto". |
429 | Too 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 / 504 | Client socket hangup or gateway timeout | Layer splits take 1–4 minutes. Submit via /v1/images/generations/async and poll /v1/images/tasks/{task_id} instead of retrying sync requests. |