Seedream 5.0 Flash
ByteDance Seedream 5.0 Flash on reAPI — async image generation and editing at 1K, 1.5K or 2K for one flat per-image price. Full parameter reference, layer decomposition and billing.
ByteDance's Seedream 5.0 Flash image model on reAPI. Text-to-image,
image-to-image and multi-reference fusion (up to 10 reference images),
point / box / sketch-mark editing, transparent-background editing and
layer decomposition, at 1K, 1.5K or 2K or an exact pixel size — all
at one flat price per image. Async-first: submit returns a task_id; poll
until ready. See current pricing on the
model page.
Quick example
curl https://reapi.ai/api/v1/images/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedream-5-0-flash",
"prompt": "A minimalist coffee shop poster with the headline \"SLOW MORNINGS\" in bold serif type",
"resolution": "1.5K",
"size": "3:4"
}'import requests
resp = requests.post(
"https://reapi.ai/api/v1/images/generations",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"model": "doubao-seedream-5-0-flash",
"prompt": 'A minimalist coffee shop poster with the headline "SLOW MORNINGS"',
"resolution": "1.5K",
"size": "3:4",
},
timeout=30,
)
print(resp.json())const r = await fetch("https://reapi.ai/api/v1/images/generations", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "doubao-seedream-5-0-flash",
prompt: 'A minimalist coffee shop poster with the headline "SLOW MORNINGS"',
resolution: "1.5K",
size: "3:4",
}),
});
console.log(await r.json());package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
)
func main() {
body, _ := json.Marshal(map[string]any{
"model": "doubao-seedream-5-0-flash",
"prompt": `A minimalist coffee shop poster with the headline "SLOW MORNINGS"`,
"resolution": "1.5K",
"size": "3:4",
})
req, _ := http.NewRequest("POST",
"https://reapi.ai/api/v1/images/generations", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
out, _ := io.ReadAll(resp.Body)
fmt.Println(string(out))
}Authentication
Every call needs a Bearer token. Generate keys at reapi.ai/settings/apikeys.
Authorization: Bearer YOUR_API_KEYEndpoint
POST /api/v1/images/generations
GET /api/v1/tasks/{id}Submission is async. The POST returns immediately with a task_id; the task
endpoint returns the same envelope until completion. Polling does not consume
credits. Seedream 5.0 Flash favors quality over speed — a 1K image takes about
90 seconds and a 2K image about 160 seconds — so poll every 5–10
seconds and allow about five minutes before giving up.
Request body
Mode is implicit: no image_urls is text-to-image; one or more is
image-to-image, multi-reference fusion or a marked-up edit.
layer_decomposition: true switches to layer splitting.
| Field | Type | Default | Notes |
|---|---|---|---|
model | string | — | doubao-seedream-5-0-flash. Required. |
prompt | string | — | Describe the image, up to 32000 chars (the model works best under about 600 English words). Required, except with layer_decomposition: true. Supports <point> / <bbox> coordinates — see Editing. |
size | string | auto | auto, a ratio, a tier, or exact pixels — see size. |
resolution | string | 1K | 1K / 1.5K / 2K (case-insensitive). Every tier costs the same. Ignored when size is exact pixels; when size is a tier, size wins. |
n | integer | 1 | Only 1 — one image per request. |
image_urls | string[] | — | Up to 10 reference images (jpeg / png / webp / bmp / tiff / gif / heic / heif, each ≤ 30 MB, ≤ 36,000,000 px, aspect ratio 1/16–16). Public HTTP(S) URLs. |
output_format | string | jpeg | jpeg / png. |
background | string | opaque | opaque / transparent. transparent edits one image that already has an alpha channel — needs exactly one image_urls entry and output_format: "png". |
layer_decomposition | boolean | false | Split one image into a base image plus up to 16 transparent layers — see Layer decomposition. |
optimize_prompt_options | object | { "mode": "standard" } | Prompt optimization. mode accepts standard only. |
watermark | boolean | false | Stamp an "AI generated" mark in the bottom-right corner. |
content_filter | boolean | true | Screens the prompt and input images before generation — see content_filter. |
Checked before anything is submitted or charged:
promptis present unlesslayer_decompositionistruenis1;image_urlshas at most 10 entriesresolutionis1K,1.5Kor2K(no 3K / 4K)sizeis one of the forms below; exact pixels total 921,600–4,624,220 with an aspect ratio between 1/16 and 16layer_decomposition: trueneeds exactly one image and asizeofauto,1K,1.5Kor2Kbackground: "transparent"needs exactly one image andoutput_format: "png"
size — string, default auto
Four forms are accepted:
auto— send only the resolution tier and let the model pick the frame from the prompt and references.- A ratio, combined with
resolution:1:1,4:3,3:4,16:9,9:16,3:2,2:3,2:1,1:2,21:9. Thexspelling (16x9) is also accepted — lowercase, no spaces. Any other ratio returns400. - A tier —
1K,1.5Kor2K, the same as settingresolution. - Exact pixels —
WIDTHxHEIGHTsuch as2048x1024(Xand×also work). The total must be between 921,600 and 4,624,220 pixels and the aspect ratio between 1/16 and 16;resolutionis ignored.
Tier × ratio → output pixels:
| Tier | 1:1 | 4:3 | 3:4 | 16:9 | 9:16 | 3:2 | 2:3 | 2:1 | 1:2 | 21:9 |
|---|---|---|---|---|---|---|---|---|---|---|
| 1K | 1024×1024 | 1152×864 | 864×1152 | 1312×736 | 736×1312 | 1248×832 | 832×1248 | 1440×720 | 720×1440 | 1568×672 |
| 1.5K | 1536×1536 | 1792×1344 | 1344×1792 | 2048×1152 | 1152×2048 | 1872×1248 | 1248×1872 | 2176×1088 | 1088×2176 | 2352×1008 |
| 2K | 2048×2048 | 2304×1728 | 1728×2304 | 2560×1440 | 1440×2560 | 2496×1664 | 1664×2496 | 2880×1440 | 1440×2880 | 3024×1296 |
layer_decomposition — boolean, default false
When true, Seedream 5.0 Flash splits your image into one base image plus up
to 16 transparent PNG layers, with the position and stacking order of each.
- Send exactly one PNG or JPEG image in
image_urls(total pixels 262,144–36,000,000, ≤ 30 MB). sizeacceptsauto,1K,1.5Kor2Konly.promptis optional — without it the model finds the main elements itself. Use<bbox>coordinates to say which elements to separate, for example"Separate the title <bbox>180 64 812 198</bbox> and the parrot <bbox>347 305 642 997</bbox>".output_formatsets the base image's format only; layers are always PNG.
Billing is per image returned — see Pricing.
Editing with coordinates and marks
Point the model at a region in either of two ways:
- Coordinates in the prompt —
<point>x y</point>marks a spot and lets the model judge the area;<bbox>x1 y1 x2 y2</bbox>marks a box by its top-left and bottom-right corners. Coordinates are normalized to 0–1000. Example:"Place the subject of image 1 <bbox>179 283 796 986</bbox> at image 2 <bbox>118 331 933 871</bbox>." - Hand-drawn marks — send an image with sketched outlines or arrows and
describe them:
"Add a stack of magazines in the marked lower-left area and a cup of coffee in the marked right area. Remove all sketch lines."
content_filter — boolean, default true
With the default (true), the prompt and input images are screened before the
task is submitted. A rejected request fails with a content-policy error
(80006) and is refunded.
Set content_filter: false to skip that screening. What changes:
- API keys only. The website playground always runs with the filter on.
- Same parameters. Every field and rule in this document applies unchanged. Unfiltered requests bill on their own line in the pricing table.
- Output lands in an isolated bucket and its URLs stay valid for 30 days — mirror the files if you need them longer.
Platform terms apply to everything you generate either way.
Troubleshooting
| Failure | What it means | What to do |
|---|---|---|
| Synchronous 400 on submit | A field breaks a rule above (ratio not in the list, n other than 1, layer mode without exactly one image, transparent background without png, …) | The error names the field — fix and resubmit; nothing was charged |
| Task fails citing content policy | The prompt or an input image was rejected by the content filter | Fully refunded. Rephrase the prompt or replace the image |
| Layer decomposition fails with "could not be processed" or "too complex to decompose" | The model splits graphic compositions — a title, a few subjects, a clean background. Photos, busy scenes and multi-panel portraits are rejected | Fully refunded. Use a poster-style image, or name the elements to separate with bounding-box coordinates in the prompt |
| Task fails after starting with a transparency error | background: "transparent" was sent with an image that has no alpha channel | Use a PNG that already carries transparency, or drop background |
402 on submit | Not enough credits for the reserve — layer decomposition reserves 17 images | Top up |
Task stays processing | Normal: about 90 s at 1K and 160 s at 2K | Keep polling every 5–10 s; tasks that can never finish are failed and refunded automatically |
No data: URIs. reAPI rejects base64 inputs platform-wide — every URL
field must be a public HTTP(S) URL. Upload to your own object storage (S3, R2,
OSS, …) and pass the URL.
Response envelope
Submit and poll share the same shape — only status and output fill in over
time.
{
"id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e",
"model": "doubao-seedream-5-0-flash",
"status": "completed",
"created_at": 1735000000,
"output": {
"image_urls": ["https://cdn.reapi.ai/media/tasks/.../0.jpeg"]
},
"error": null
}Poll GET /api/v1/tasks/{id} (see the Tasks reference) until
status === "completed". Generated URLs expire — mirror the files to your own
storage.
Layer decomposition output
A layer_decomposition: true task returns several images, and output.layers
describes them positionally: layers[i] belongs to image_urls[i].
{
"status": "completed",
"output": {
"image_urls": [
"https://cdn.reapi.ai/media/tasks/.../0.jpeg",
"https://cdn.reapi.ai/media/tasks/.../1.png"
],
"layers": [
{ "z_index": 0, "size": "2048x2048", "output_format": "jpeg" },
{
"z_index": 1,
"size": "1273x265",
"output_format": "png",
"name": "Title text",
"description": "Large yellow serif title text",
"bounding_box": {
"absolute": [383, 120, 1655, 384],
"normalized": [187, 59, 808, 188]
}
}
]
}
}z_index— stacking order.0is the base image; layers start at1and a higher value sits on top.bounding_box— where the layer belongs.absoluteis[left, top, right, bottom]in the base image's pixels;normalizedis the same four edges scaled to[0, 1000]. The base image carries no box.name/description— what the model identified in that layer.
To rebuild the original, place each layer at (left, top) with size
(right - left) × (bottom - top) and composite in ascending z_index. Use
normalized to composite onto a canvas of your own size.
Pricing
Seedream 5.0 Flash bills one flat price per output image:
credits = ceil(per_image_price × images_returned × 1000) 1 credit = $0.001The live per-image rate is on the model page. Failed tasks are always refunded in full.
1. Size and references do not change the price
1K, 1.5K and 2K cost the same, and so does an exact pixel size.
Reference images add nothing. That makes 1.5K the sensible default: better
detail than 1K at the same price.
2. Layer decomposition is charged per image returned
The model decides how many layers to produce, so a
layer_decomposition: true request reserves the worst case — the base image
plus 16 layers, 17 images — and settles to the images actually delivered:
credits = (1 + layers_returned) × per_image_creditsThe difference is refunded when the task settles. This is why a layer request
can return 402 on an account that could afford the result: the reserve has
to fit.
3. Unfiltered requests have their own line
content_filter: false requests bill on a separate line of the pricing table.
See the model page for its
current rate.
Related
- Seedream 5.0 Pro — the tier-priced sibling
- Seedream 5.0 Lite
- Tasks reference
- Errors catalog