Skip to main content
Seedream is the BytePlus ModelArk image model family; 5.0 Flash and 5.0 Pro are the newest versions. On LaoZhang API, generation and edits share one JSON endpoint, billed per output image. Public prices as of September 25, 2026 (model and pricing catalog). Reference images are free, except on 5.0 Pro: $0.003 each after the first. Layer decomposition is also billed per output image.
A realistic sunset over mountains, generated by Seedream 5.0

Output of the generate example below: Seedream 5.0, 2K

To call another version, change model. 5.0 Flash and 5.0 Pro return HTTP 400 for sequential_image_generation or stream, so remove both first, including the edit examples’ "sequential_image_generation": "disabled" line.

Before you start

1

Create a key for per-call models

Seedream is a per-call (按次) model. In Token management, create a key (or edit an existing one) and set Billing mode (计费模式) to Usage first (按量优先, recommended) or Per-call (按次计费). A Usage first key can also call usage-based models; a Per-call key can only call per-call models.Keep the key in a server-side environment variable.In Token management, create a token with Billing mode set to Per-call (按次计费), then select Create.
2

Set up your environment

Export the key and install requests, which the Python examples use:

Generate an image

This request creates a 2K image without a watermark and writes the response to seedream-generation.json:
A successful response lists the image in data:

Save the result

Download the image as soon as the response arrives. Save this script as save_images.py; it saves every image in a response, whether it arrives as url or b64_json:
save_images.py
The script prints a line such as Saved seedream-sunset-1.jpg. Open the file and check the result.

Generate with Python

Edit an image

Add image to the request to edit or redraw an existing image. This example uses a public sample image from the BytePlus documentation, so you can run it as is:

Combine up to 10 reference images

Pass image as an array to use several references. Each item is a public URL or a data URL such as data:image/png;base64,..., and the images are numbered in array order, so the prompt can refer to image 1, image 2, and so on. This example sends three local files as data URLs:

Combine references with Python

This function accepts one to ten references, converts local files to data URLs, and passes public URLs through unchanged:

Split an image into transparent layers

Seedream 5.0 Flash (seedream-5-0-flash-260915) and 5.0 Pro (seedream-5-0-pro-260628) can decompose one finished image into a background plus separate transparent PNG layers, one element per layer. Use this to swap backgrounds, rearrange a layout, or reuse elements. Both models charge for every image they return, and each Pro image costs about 6.7 times as much as a Flash image, so start with Flash. Asking for a transparent background in a normal prompt doesn’t produce an alpha channel; layer decomposition does. A layer request differs from a normal edit in a few ways:
  • Set layer_decomposition to true.
  • Send exactly one image in image, either as a string or as a one-item array.
  • prompt is optional. Leave it out or send an empty string, and the model detects the main elements on its own.
  • Set size to 1K. Exact pixels aren’t accepted.
  • Layer requests accept only the levels 1K, 1.5K, 2K, and auto.
  • Only 5.0 Flash and 5.0 Pro support it. On seedream-5-0-260128 and seedream-4-5-251128, the parameter returns HTTP 400 with the error code InvalidParameter.

Send a layer request

Replace the image URL with a publicly downloadable image of your own, or pass a data URL. To use 5.0 Pro, change only model.
Layer decomposition charges for every returned image: $0.018 each on Flash and $0.12 each on Pro.
  • The model decides how many layers to return, and the count can differ between runs of the same image. A movie poster that splits into 6 images (1 background and 5 layers) costs $0.108 on Flash and $0.72 on Pro. Busier images can return a dozen or more, and 16 images on Flash cost $0.288.
  • At 1K, a 6-image result takes under a minute on Flash and about 70 seconds on Pro, and more layers take longer. Set the client timeout to at least 300 seconds. A 2K request can run for a long time and is still charged if your client disconnects.
  • If an image can’t be decomposed, the request returns HTTP 400 and isn’t charged. You can retry it.
  • The model paints in the areas behind removed elements, so check the background before commercial use.

Read the layer response

The first item in data[] is the background, and each remaining item is one layer. This response is trimmed to the background and a single layer:
usage also includes output_tokens, but the charge depends only on the image count. A layer file isn’t necessarily the size of its bounding box. In the example, a 916×529 PNG belongs in a 359×208 box, so scale each layer to its absolute box when you put the image back together.

Save the layers and recompose the image

This script reads seedream-layers.json, saves every image with its z_index and name in the filename, and uses Pillow to paste each layer into its bounding_box.absolute box on the background. Install Pillow first with python3 -m pip install pillow.
save_layers.py
You get files such as layer-00-base.jpg and layer-04-spaceship.png, plus recomposited.png. To change the background or drop an element, swap the background file or skip that layer before you composite.

Parameters

5.0 Flash and 5.0 Pro return HTTP 400 if the request includes sequential_image_generation (even "disabled") or stream. They also ignore n, so each request returns one image unless you use layer decomposition. Sequential generation and layer decomposition can return several images in one response, so save every item in data[], as save_images.py, save_all_images, and save_layers.py do.

Frequently asked questions

Which Seedream version should I use?

Choose by what the task needs:
  • Low price, speed, or high volume: Seedream 5.0 Flash (seedream-5-0-flash-260915), at $0.018 per image. BytePlus positions it for ad creatives, product images, and posters or other designs with text.
  • Highest quality: Seedream 5.0 Pro (seedream-5-0-pro-260628), for realistic portraits, fine material detail, and complex instructions. At $0.12 per image it costs about 3.4 times as much as 5.0 and is slower, so use 5.0 or Flash for routine work.
  • 3K output, sequential generation, or streaming: Seedream 5.0 (seedream-5-0-260128). The BytePlus documentation calls this model Seedream 5.0 lite; it supports 2K and 3K output, up to 3K.
  • 4K: Seedream 4.5 (seedream-4-5-251128) or 4.0 (seedream-4-0-250828). Otherwise, keep these two versions only when an existing workflow depends on their output.
  • Transparent layers from an existing image: layer decomposition on 5.0 Flash. 5.0 Pro supports it too, at about 6.7 times the price per image.
The model and pricing catalog lists current prices for every version.

How is Seedream API pricing calculated?

You pay a fixed price for each returned image, set by the model version: from $0.018 on 5.0 Flash to $0.12 on 5.0 Pro, as listed in the price table at the top of this page.
  • Output size doesn’t change the price.
  • A request that returns several images, such as sequential generation, is billed per image.
  • Reference images are free, except on 5.0 Pro, where each one after the first costs $0.003.
  • Non-200 responses aren’t charged.

Does the Seedream API have rate limits or a concurrency cap?

No. LaoZhang API sets no concurrency cap or throttling on Seedream. An occasional 429 comes from upstream capacity, isn’t charged, and can be retried after a short wait; see Concurrency and 429.

What values does size accept? Can I get 4K?

Use one of two forms, not both. Either pass a resolution level and describe the aspect ratio in the prompt (for example, “a 16:9 landscape”), or pass exact pixels such as 2848x1600. Each model supports these resolution levels:
  • seedream-5-0-flash-260915: 1K, 1.5K, 2K (defaults to 2K)
  • seedream-5-0-pro-260628: 1K, 2K
  • seedream-5-0-260128: 2K, 3K (up to 3K)
  • seedream-4-5-251128: 2K, 4K
  • seedream-4-0-250828: 1K, 2K, 4K
Exact pixels must meet both a total-pixel range and an aspect-ratio range:
  • Minimum: 2560×1440 (3,686,400 pixels) for 5.0 and 4.5, and 1280×720 (921,600 pixels) for 4.0.
  • Maximum: 4096×4096 for 4.5 and 4.0, and the 3K level for 5.0.
  • 5.0 Flash: 921,600 to 4,624,220 pixels in total.
  • 5.0 Pro: up to about 4.19 million pixels, such as 2048x2048, or 2720x1530 for 16:9.
  • Aspect ratio: from 1/16 to 16 on 5.0 Flash, 5.0, 4.5, and 4.0.
That’s why a small size such as 1024x1024 fails on 5.0 and 4.5. With a resolution level, 5.0 Flash chooses the aspect ratio from the content, so pass exact pixels such as 2560x1440 when you need a fixed ratio. On 5.0 Flash, 3K and 4K return HTTP 400. The per-image price doesn’t change with size. Layer decomposition accepts only 1K, 1.5K, 2K, or auto, not exact pixels.

How does sequential generation work, and how is it billed?

Set sequential_image_generation to auto, and the model decides from the prompt how many related images to return, for example “three images of the same character in the morning, at noon, and at night.” To cap the count, BytePlus documents sequential_image_generation_options.max_images (1–15). Reference images plus generated images can’t exceed 15. The response then lists several images in data[], so save every item. You pay for each returned image, so four images from seedream-5-0-260128 cost $0.14; reference images aren’t charged. Check call logs for the actual charge. 5.0 Flash and 5.0 Pro don’t support sequential generation: any sequential_image_generation value, including "disabled", returns HTTP 400. Use 5.0 for sequential generation, or send one request per image to Flash or Pro.

How do I send a local image, and what are the limits?

Convert it to a data URL in the form data:image/png;base64,<Base64 data>, with the format name in lowercase, such as png or jpeg. The Python helper does this for you. BytePlus sets these limits for each reference:
  • Format: jpeg, png, webp, bmp, tiff, gif, heic, or heif.
  • Size: up to 30 MB.
  • Dimensions: width and height each more than 14 pixels, and no more than 6000×6000 pixels in total.
  • Aspect ratio: between 1/16 and 16.
A public URL must be directly downloadable. For large images, prefer a public URL: Base64 encoding makes the request body about a third larger.

How do I remove the watermark?

Send "watermark": false, as every example on this page does. BytePlus defaults watermark to true, which adds an “AI generated” label to the lower-right corner, so set it to false explicitly when you need a clean image.

How long do result URLs last? Can I get Base64 instead?

BytePlus says image URLs stay valid for 24 hours after generation. Download the image as soon as the response arrives and keep your own copy; don’t store the returned URL as a permanent address. To receive the image inside the response, set response_format to b64_json. The save_images.py script and the Python examples handle both formats.

Am I charged for failed requests?

No. A non-200 response, such as a parameter error or a moderation block, isn’t charged; you pay only when images are returned. A client timeout isn’t the same as a failure. The server may have finished and charged for the image, so check call logs before you resend. Call logs are the final record of what you were charged. Set the client timeout by model to avoid cutting off requests that are still running:
  • 5.0 Flash: at least 60 seconds. BytePlus says it finishes within 20 seconds; with ten references, expect about 30 seconds.
  • 5.0 Pro: at least 240 seconds, because a request typically takes about 2 minutes.
  • Layer decomposition on 5.0 Flash or 5.0 Pro: at least 300 seconds at 1K.

Sources