Seedream
Official API reference: Image generation API (Volcengine Ark). Every field on this page is checked against it; gateway-specific behaviour is collected in "Differences from the official API" at the end.
Models and tiers
| Model | Default size | Common size values (examples) |
|---|---|---|
doubao-seedream-4.0 | 2K | 1K / 2K / 4K |
doubao-seedream-5.0-pro | 2K | 1K / 1.5K / 2K |
doubao-seedream-5.0-lite | 2K | 2K / 3K / 4K |
doubao-seedream-5.0 | 2K | Same as 5.0 lite |
doubao-seedream-4.5 | 2K | 2K / 4K |
- The models above share the same inbound
POST /api/v3/images/generations, support text to image and image to image (single / multiple references), and requiremodelandprompt. Sequential sets (sequential_image_generation: "auto") are supported on 5.0 lite / 5.0 / 4.5 / 4.0. doubao-seedream-5.0is an alias ofdoubao-seedream-5.0-lite: Ark has no standalone 5.0 model, so the two share tiers and price.- The supported tiers differ by model; the table above lists only common values. See the official Ark documentation for the full range. A tier outside it is refused at creation (HTTP
400) — nothing is rendered, nothing is charged. - On 5.0 pro,
1.5Kis priced the same as1K(Ark pricing) and is served by only part of the supplier pool, so fewer lanes are available than for the other tiers. - Which models are reachable on which entry point is decided by the model's protocol list.
doubao-seedream-4.0is served on both the Ark native entry point (this page) and the OpenAI-compatible one (POST /v1/images/generations, see "OpenAI-compatible entry point" below); 5.0 / 5.0 lite / 5.0 pro are served through the OpenAI-compatible image API only (see Image generation (OpenAI-compatible)). Calling an entry point the model does not offer returns400 model_protocol_not_offered.
The ModelGo gateway accepts Seedream requests on the official Volcengine Ark Images API path with the official request/response shapes unchanged; the gateway routes to a supplier and bills the call. Which supplier renders the image is invisible to the caller. Images are returned synchronously — there is no polling.
With the official Ark SDK (
volcenginesdkarkruntime), pointbase_urlathttps://api.modelgo.ai/api/v3and use your ModelGo API key asapi_key.
1. Create an image
POST https://api.modelgo.ai/api/v3/images/generations
Text to image (4.0)
curl https://api.modelgo.ai/api/v3/images/generations \
-H "Authorization: Bearer $MODELGO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedream-4.0",
"prompt": "A fluffy orange cat sitting on a sunny windowsill, 16:9 landscape, film grain",
"size": "2K",
"watermark": false
}'Text to image (5.0 pro)
curl https://api.modelgo.ai/api/v3/images/generations \
-H "Authorization: Bearer $MODELGO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedream-5.0-pro",
"prompt": "A fluffy orange cat sitting on a sunny windowsill, 16:9 landscape, film grain",
"size": "2K",
"watermark": false
}'Text to image (5.0 lite)
curl https://api.modelgo.ai/api/v3/images/generations \
-H "Authorization: Bearer $MODELGO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedream-5.0-lite",
"prompt": "A fluffy orange cat sitting on a sunny windowsill, film grain",
"size": "2K",
"watermark": false
}'Image to image / multiple references
curl https://api.modelgo.ai/api/v3/images/generations \
-H "Authorization: Bearer $MODELGO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedream-5.0-pro",
"prompt": "Place the cat from the first image into the neon street of the second image",
"image": ["https://example-cdn.com/cat.jpg", "https://example-cdn.com/street.jpg"],
"size": "1280x720",
"response_format": "b64_json"
}'Sequential sets (4.0)
Sequential (multi-image) output is enabled with sequential_image_generation: "auto". The model decides how many images to render from the prompt; max_images caps it. See the official documentation for the allowed range.
curl https://api.modelgo.ai/api/v3/images/generations \
-H "Authorization: Bearer $MODELGO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedream-4.0",
"prompt": "Four shiba-inu posters in different styles: cyberpunk, watercolor, minimal, vintage film",
"size": "2K",
"sequential_image_generation": "auto",
"sequential_image_generation_options": {"max_images": 4}
}'For example, requesting 4 images returns 4 entries in data[], usage.generated_images = 4, and the call is billed as 4 × unit price.
OpenAI-compatible entry point
doubao-seedream-4.0 is also served on the OpenAI-compatible entry point POST https://api.modelgo.ai/v1/images/generations. The body carries the official Ark fields verbatim and the response keeps the official shape; billing is identical to the native entry point (see "Billing"). Any OpenAI SDK or client works without the Ark SDK.
curl https://api.modelgo.ai/v1/images/generations \
-H "Authorization: Bearer $MODELGO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedream-4.0",
"prompt": "Four shiba-inu posters in different styles: cyberpunk, watercolor, minimal, vintage film",
"size": "2K",
"sequential_image_generation": "auto",
"sequential_image_generation_options": {"max_images": 4}
}'nmust be omitted or1: Ark's Images API has non, andn ≥ 2is refused at creation (HTTP400). Usesequential_image_generation: "auto"to render several images at once.- Sequential sets behave exactly as on the native entry point:
sequential_image_generationplussequential_image_generation_options.max_images; for example, requesting 4 returns 4 and bills as 4 × unit price. - Image to image / multiple references uses the JSON
imagefield (as in the official API). Do not use the multipart/v1/images/editsendpoint — it is not enabled for this model and answers400 model_protocol_not_offered. - Every other field (
size,watermark,response_format,stream, …) carries the same limits as the native entry point; see "Parameters" and "Differences from the official API".
Response
{
"model": "doubao-seedream-5.0-pro",
"created": 1757318400,
"data": [{"url": "https://ark-content-generation.tos-cn-beijing.volces.com/...", "size": "2816x1584", "output_format": "jpeg"}],
"usage": {"generated_images": 1, "input_images": 0, "output_tokens": 17424, "total_tokens": 17424}
}modelalways echoes the logical model you requested (e.g.doubao-seedream-4.0), not Ark's internal version id (which looks likedoubao-seedream-5-0-260128/doubao-seedream-4-5-251128/doubao-seedream-4-0-250828).response_formatdefaults tourl; the link is valid for 24 hours — download promptly and do not persist the URL.- With
response_format: "b64_json",data[].b64_jsoncarries the base64 image directly. data[].sizeis the actual output resolution.data[].output_format(encoding) andusage.input_imagesare returned by 5.0 pro / 5.0 flash only; 4.0 / 4.5 / 5.0 lite responses carry neither.usage.output_tokens/total_tokensare informational values echoed from upstream and are not billed; settlement usesusage.generated_imagesonly.- In a sequential set, a failed image appears as its own
{"error": {...}}entry while the rest are returned; only successfully generated images are billed. - On 5.0 lite with
tools: [{"type":"web_search"}], the search count is echoed inusage.tool_usage.web_searchand billed separately as an addon.
Save to a file:
curl -s https://api.modelgo.ai/api/v3/images/generations \
-H "Authorization: Bearer $MODELGO_API_KEY" -H "Content-Type: application/json" \
-d '{"model":"doubao-seedream-5.0-lite","prompt":"a red ball on a wooden table","size":"2K","response_format":"b64_json"}' \
| python3 -c 'import sys,json,base64; open("out.jpg","wb").write(base64.b64decode(json.load(sys.stdin)["data"][0]["b64_json"]))'2. Parameters
Field names, types, defaults and per-model support follow the official API reference. The table adds ModelGo's current behaviour where it differs.
| Field | Type | Models | Description |
|---|---|---|---|
model | string | all | Required. doubao-seedream-4.0 / doubao-seedream-5.0-pro / doubao-seedream-5.0-lite / doubao-seedream-5.0 / doubao-seedream-4.5 |
prompt | string | all | Required. Describes the image; with tier sizes, describe the composition / aspect here |
image | string / string[] | all | Reference image URL or data:image/<format>;base64,<...> (lower-case format). 2–14 references; references + generated images ≤ 15 |
size | string | all | Resolution tier (default 2K; tiers per model under "Models and tiers"), or explicit pixels WxH (e.g. 1280x720, 2560x1440) |
sequential_image_generation | string | 5.0 lite / 5.0 / 4.5 / 4.0 | disabled (default) / auto. auto on 5.0 pro → 400 |
sequential_image_generation_options.max_images | integer | 5.0 lite / 5.0 / 4.5 / 4.0 | Maximum images per request, default 15; only effective with auto, and the allowed range follows the official documentation |
stream | boolean | official: 5.0 lite / 4.5 / 4.0 | Not supported on ModelGo: true → 400; this entry point returns one complete JSON body |
response_format | string | all | url (default, valid 24 hours) / b64_json |
output_format | string | 5.0 pro / 5.0 flash / 5.0 lite | jpeg (default) / png. On 4.0 / 4.5 the upstream rejects it (400) |
background | string | official: 5.0 pro / 5.0 flash | opaque (default) / transparent. ModelGo currently allows it on 5.0 pro only; other models → 400 |
layer_decomposition | boolean | official: 5.0 pro / 5.0 flash | Layer split. Not enabled on ModelGo yet; passing it → 400 |
optimize_prompt_options.mode | string | all | standard (default) / fast; the official docs state fast is unsupported on 5.0 flash / lite / 4.5 |
tools[].type | string | 5.0 lite | web_search; searches are billed through the web_search_calls addon |
watermark | boolean | all | Add a watermark, default true |
seed | int | — | Accepted and forwarded by the gateway; not listed in the official 4.0/5.0 docs, behaviour is the upstream's; not recommended for new integrations |
guidance_scale | number | — | Same as seed |
- Any field outside the table →
400; unknown fields are rejected, not ignored (stricter than the official API, which does not guarantee an error). - Routing follows deliverable tiers. The gateway prefers suppliers that can deliver the declared
size; if none claims that tier it still routes to an available supplier and lets it decide (a400if unsupported).
Resolution tiers
size accepts a tier such as 1K / 2K / 4K or an explicit WxH such as 1280x720 or 2048x2048. The tier sets the total pixel budget; the exact dimensions come from the composition described in the prompt or from an explicit WxH. Available tiers and pixel bounds differ by model — the table above lists common values; see the official Ark documentation for the full constraints. An out-of-range value returns HTTP 400 and is never silently downgraded or upgraded. Nothing is charged.
Reference image requirements
- Must be a direct link the upstream server can
GET: no auth, no redirects, no Referer / Cookie dependency. - Some sites return 403 to non-browser fetches, which fails the request — not billed. Use your own object storage or CDN.
3. Full example (Python, official Ark SDK)
import os, requests
from volcenginesdkarkruntime import Ark
client = Ark(api_key=os.environ["MODELGO_API_KEY"], base_url="https://api.modelgo.ai/api/v3")
# 5.0 pro: tier + aspect described in the prompt
r = client.images.generate(model="doubao-seedream-5.0-pro",
prompt="An orange cat on a windowsill, 16:9 landscape, film grain",
size="2K", watermark=False)
img = r.data[0]
print(r.model, img.size, r.usage.generated_images)
open("cat.jpg", "wb").write(requests.get(img.url, timeout=60).content)
# 5.0 lite: default 2K tier (2048x2048)
l = client.images.generate(model="doubao-seedream-5.0-lite",
prompt="An orange cat on a windowsill, film grain",
size="2K", watermark=False)
open("cat-lite.jpg", "wb").write(requests.get(l.data[0].url, timeout=60).content)
# Multiple references
e = client.images.generate(model="doubao-seedream-5.0-pro",
prompt="Place the cat from the first image into the neon street of the second image",
image=["https://example-cdn.com/cat.jpg", "https://example-cdn.com/street.jpg"],
size="1280x720")
open("cat-neon.jpg", "wb").write(requests.get(e.data[0].url, timeout=60).content)4. Billing
- Per image: settlement uses
usage.generated_imagesat a flat price per image, independent of thesizetier. A sequential set of N images is billed as N × the unit price. - Both entry points price identically: the Ark native and OpenAI-compatible entries feed the same metering (
image_generation_calls= images actually generated), so the same request is charged the same on either. - One price per model: 4.0 / 5.0 pro / 5.0 lite / 5.0 / 4.5 each have their own price card in the console's model list and the prices differ (5.0 and 5.0 lite share one price).
- A reservation is frozen at request time (for the number of images the request can produce) and settled on the actual number generated; the difference is released.
- Rejected requests (
400) and failed generations are never billed; the reservation is released automatically. - An HTTP
200whosedata[]contains nourl/b64_jsonat all (e.g. every entry is anerror) is not billed. - A content-moderation refusal (e.g.
OutputImageSensitiveContentDetected) returns HTTP400with the upstream error code; it is neither billed nor retried.
5. Differences from the official API
The differences below are deliberate gateway behaviour; every other field, value range and default matches the official API reference (aligned with the official documentation).
| Item | Official | ModelGo |
|---|---|---|
stream | 5.0 lite / 4.5 / 4.0 support streaming | Not supported; stream: true → 400; one complete JSON body is returned |
layer_decomposition | 5.0 pro / 5.0 flash support layer split | Not enabled yet; passing it → 400 (tracked in shared/modelgo_prd#1366) |
background | 5.0 pro / 5.0 flash | 5.0 pro only; other models → 400 |
seed / guidance_scale | not listed in the 4.0/5.0 docs | Accepted and forwarded, with no guarantee they take effect |
| Unknown fields | no guaranteed error | Strictly rejected with 400 naming the field |
output_format | 5.0 pro / flash / lite | Same; on 4.0 / 4.5 the upstream answers 400 |
Common errors
| Symptom | Cause | Fix |
|---|---|---|
400 | size outside the tier table or WxH out of bounds; missing prompt; a field the model or the gateway does not support (e.g. stream, layer_decomposition); no supplier can currently produce the requested tier | Fix per the parameter table or change tier |
400 (4.0) | A tier the model does not offer, or a too-small WxH | Use a common tier for that model (e.g. 2K), or a larger WxH |
400 (5.0 lite / 5.0 / 4.5) | size below the model's minimum, or a tier the model does not offer | Use a common tier for that model (e.g. 2K / 4K), or a larger WxH |
400 (5.0 pro) | 3K / 4K requested; 5.0 pro does not offer those tiers | Use 1K / 1.5K / 2K or WxH |
400 with metadata.upstream_reason=parameter_invalid and upstream_param=max_images | max_images outside the allowed range | Use a value in the official range |
400 with model does not offer this inbound protocol | The model's public protocol list does not include the entry point called (e.g. the 5.0 family uses the OpenAI-compatible API only on the domestic site; 4.0 does not enable multipart /v1/images/edits) | Pick the entry point listed on the model's detail page |
400 with metadata.upstream_error_code such as OutputImageSensitiveContentDetected | Upstream content moderation refused the request; not billed, not retried | Adjust the prompt / reference images and retry |
| Generation failed | Upstream could not download a URL in image | Use a publicly downloadable direct link |
data[].url download returns 403 / 404 | The 24-hour link has expired | Regenerate, or use response_format: "b64_json" |
401 | Invalid API key or missing Authorization header | Check the key |