> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anyfast.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# seedream-5.0-flash

> Seedream 5.0 Flash image generation, editing, transparency, and layer decomposition API.

Use `doubao-seedream-5-0-flash-260915` with the synchronous image generation endpoint. Select a capability tab to view its request and response shape.

<Warning>This model does not support grouped image generation, web search, or streaming. Do not send `sequential_image_generation`, `sequential_image_generation_options`, `tools`, or `stream`.</Warning>

<Tabs sync={false}>
  <Tab title="Text to image">
    ## Create an image

    `POST /v1/images/generations`

    <div className="kling-api-example-panel seedream-api-example-panel">
      ```bash cURL theme={null}
      curl --request POST \
        --url https://www.anyfast.ai/v1/images/generations \
        --header 'Authorization: Bearer YOUR_API_KEY' \
        --header 'Content-Type: application/json' \
        --data '{
          "model": "doubao-seedream-5-0-flash-260915",
          "prompt": "A single green leaf icon centered on a white background, simple flat design, no text",
          "size": "1K",
          "response_format": "url",
          "output_format": "jpeg",
          "watermark": false
        }'
      ```
    </div>

    <ParamField body="model" type="string" required>Must be `doubao-seedream-5-0-flash-260915`.</ParamField>
    <ParamField body="prompt" type="string" required>Image-generation prompt. Chinese prompts should generally stay within 300 characters and English prompts within 600 words.</ParamField>
    <ParamField body="size" type="string" default="2K">`1K`, `1.5K`, `2K`, or a valid explicit `widthxheight` value. Explicit dimensions require 921,600–4,624,220 total pixels and an aspect ratio in `[1/16, 16]`.</ParamField>
    <ParamField body="response_format" type="string" default="url">`url` or `b64_json`. URL results expire after 24 hours.</ParamField>
    <ParamField body="output_format" type="string" default="jpeg">`jpeg` or `png`.</ParamField>
    <ParamField body="watermark" type="boolean" default={true}>Whether to add the AI-generated watermark.</ParamField>
    <ParamField body="optimize_prompt_options" type="object">Prompt optimization configuration.</ParamField>
    <ParamField body="optimize_prompt_options.mode" type="string" default="standard">Only `standard` is supported; `fast` is not available for Flash.</ParamField>

    ### Create response

    <div className="kling-api-example-panel seedream-api-example-panel">
      ```json 200 theme={null}
      {
        "model": "dola-seedream-5-0-flash-260915",
        "created": 1792129491,
        "data": [
          {
            "url": "https://example.com/seedream-flash-text.jpeg",
            "size": "1024x1024",
            "output_format": "jpeg"
          }
        ],
        "usage": {
          "input_images": 0,
          "generated_images": 1,
          "output_tokens": 4096,
          "total_tokens": 4096
        }
      }
      ```
    </div>
  </Tab>

  <Tab title="Image editing">
    ## Edit or combine images

    `POST /v1/images/generations`

    <div className="kling-api-example-panel seedream-api-example-panel">
      ```bash cURL theme={null}
      curl --request POST \
        --url https://www.anyfast.ai/v1/images/generations \
        --header 'Authorization: Bearer YOUR_API_KEY' \
        --header 'Content-Type: application/json' \
        --data '{
          "model": "doubao-seedream-5-0-flash-260915",
          "prompt": "Keep the single green leaf icon on a white background and add one small blue circle below it. Simple flat design, no text.",
          "image": "https://example.com/green-leaf.jpeg",
          "size": "1K",
          "response_format": "url",
          "output_format": "jpeg",
          "watermark": false
        }'
      ```
    </div>

    <ParamField body="model" type="string" required>Must be `doubao-seedream-5-0-flash-260915`.</ParamField>
    <ParamField body="prompt" type="string" required>Editing or reference-generation instruction. Coordinate edits can use normalized `<point>` and `<bbox>` tags.</ParamField>
    <ParamField body="image" type="string | string[]" required>Image URL, Base64 data URI, or an array of up to 10 references.</ParamField>
    <ParamField body="size" type="string" default="2K">`1K`, `1.5K`, `2K`, or a valid explicit pixel size.</ParamField>
    <ParamField body="response_format" type="string" default="url">`url` or `b64_json`.</ParamField>
    <ParamField body="output_format" type="string" default="jpeg">`jpeg` or `png`.</ParamField>
    <ParamField body="watermark" type="boolean" default={true}>Whether to add the AI-generated watermark.</ParamField>
    <ParamField body="optimize_prompt_options.mode" type="string" default="standard">Only `standard` is supported; `fast` is not available for Flash.</ParamField>

    ### Create response

    <div className="kling-api-example-panel seedream-api-example-panel">
      ```json 200 theme={null}
      {
        "model": "dola-seedream-5-0-flash-260915",
        "created": 1792129583,
        "data": [
          {
            "url": "https://example.com/seedream-flash-edit.jpeg",
            "size": "1024x1024",
            "output_format": "jpeg"
          }
        ],
        "usage": {
          "input_images": 1,
          "generated_images": 1,
          "output_tokens": 4096,
          "total_tokens": 4096
        }
      }
      ```
    </div>
  </Tab>

  <Tab title="Transparent background">
    ## Preserve transparency

    `POST /v1/images/generations`

    <div className="kling-api-example-panel seedream-api-example-panel">
      ```bash cURL theme={null}
      curl --request POST \
        --url https://www.anyfast.ai/v1/images/generations \
        --header 'Authorization: Bearer YOUR_API_KEY' \
        --header 'Content-Type: application/json' \
        --data '{
          "model": "doubao-seedream-5-0-flash-260915",
          "prompt": "Keep the subject and refine the edges while preserving the transparent background.",
          "image": "https://example.com/transparent-source.png",
          "background": "transparent",
          "size": "1K",
          "response_format": "url",
          "output_format": "png",
          "watermark": false
        }'
      ```
    </div>

    <ParamField body="model" type="string" required>Must be `doubao-seedream-5-0-flash-260915`.</ParamField>
    <ParamField body="prompt" type="string" required>Editing instruction.</ParamField>
    <ParamField body="image" type="string" required>Exactly one input image with an alpha channel. PNG is supported; JPEG cannot carry transparency.</ParamField>
    <ParamField body="background" type="string" default="opaque">Use `transparent` to preserve transparent output, or `opaque` for a normal background.</ParamField>
    <ParamField body="size" type="string" default="2K">`1K`, `1.5K`, `2K`, or a valid explicit pixel size.</ParamField>
    <ParamField body="output_format" type="string" required>Must be `png` when `background` is `transparent`.</ParamField>
    <ParamField body="response_format" type="string" default="url">`url` or `b64_json`.</ParamField>
    <ParamField body="watermark" type="boolean" default={true}>Whether to add the AI-generated watermark.</ParamField>

    ### Create response

    <div className="kling-api-example-panel seedream-api-example-panel">
      ```json 200 theme={null}
      {
        "model": "dola-seedream-5-0-flash-260915",
        "created": 1792129634,
        "data": [
          {
            "url": "https://example.com/seedream-flash-transparent.png",
            "size": "1024x1024",
            "output_format": "png"
          }
        ],
        "usage": {
          "input_images": 1,
          "generated_images": 1,
          "output_tokens": 4096,
          "total_tokens": 4096
        }
      }
      ```
    </div>
  </Tab>

  <Tab title="Layer decomposition">
    ## Decompose an image

    `POST /v1/images/generations`

    <div className="kling-api-example-panel seedream-api-example-panel">
      ```bash cURL theme={null}
      curl --request POST \
        --url https://www.anyfast.ai/v1/images/generations \
        --header 'Authorization: Bearer YOUR_API_KEY' \
        --header 'Content-Type: application/json' \
        --data '{
          "model": "doubao-seedream-5-0-flash-260915",
          "prompt": "Separate the green leaf icon from the white background into one editable layer.",
          "image": "https://example.com/green-leaf.jpeg",
          "layer_decomposition": true,
          "size": "1K",
          "response_format": "url",
          "output_format": "jpeg",
          "watermark": false
        }'
      ```
    </div>

    <ParamField body="model" type="string" required>Must be `doubao-seedream-5-0-flash-260915`.</ParamField>
    <ParamField body="prompt" type="string">Optional decomposition instruction. Use normalized `<bbox>` coordinates to target specific elements.</ParamField>
    <ParamField body="image" type="string" required>Exactly one PNG or JPEG image.</ParamField>
    <ParamField body="layer_decomposition" type="boolean" required>Set to `true` to return one background and up to 16 editable layers.</ParamField>
    <ParamField body="size" type="string" default="auto">`auto`, `1K`, `1.5K`, or `2K`. Explicit pixel sizes are not supported in this mode.</ParamField>
    <ParamField body="response_format" type="string" default="url">`url` or `b64_json`.</ParamField>
    <ParamField body="output_format" type="string" default="jpeg">Controls only the background format. Extracted layers are always PNG.</ParamField>
    <ParamField body="watermark" type="boolean" default={true}>Whether to add the AI-generated watermark.</ParamField>

    ### Create response

    <div className="kling-api-example-panel seedream-api-example-panel">
      ```json 200 theme={null}
      {
        "model": "dola-seedream-5-0-flash-260915",
        "created": 1792129605,
        "data": [
          {
            "url": "https://example.com/seedream-flash-layer-0.jpeg",
            "size": "1024x1024",
            "output_format": "jpeg",
            "z_index": 0
          },
          {
            "url": "https://example.com/seedream-flash-layer-1.png",
            "size": "662x855",
            "output_format": "png",
            "z_index": 1,
            "bounding_box": {
              "absolute": [
                305,
                251,
                729,
                800
              ],
              "normalized": [
                298,
                245,
                711,
                780
              ]
            },
            "name": "green leaf icon",
            "description": "Extract the complete green leaf icon with leaf blade, veins and petiole, no other background elements included"
          }
        ],
        "usage": {
          "input_images": 1,
          "generated_images": 2,
          "output_tokens": 8549,
          "total_tokens": 8549
        }
      }
      ```
    </div>
  </Tab>
</Tabs>

## Headers

<ParamField header="Authorization" type="string" required>Bearer authentication in the form `Bearer YOUR_API_KEY`.</ParamField>
<ParamField header="Content-Type" type="string" default="application/json" required>Request body format.</ParamField>

## Response fields

<ResponseField name="model" type="string">Provider model name. Successful AnyFast responses returned `dola-seedream-5-0-flash-260915` for this request model.</ResponseField>
<ResponseField name="created" type="integer">Creation time as a Unix timestamp in seconds.</ResponseField>
<ResponseField name="data" type="object[]">Generated images, or the background and extracted layers in decomposition mode.</ResponseField>
<ResponseField name="data[].url" type="string">Temporary image URL when `response_format` is `url`.</ResponseField>
<ResponseField name="data[].b64_json" type="string">Base64 image data when `response_format` is `b64_json`.</ResponseField>
<ResponseField name="data[].output_format" type="string">Generated image format.</ResponseField>
<ResponseField name="data[].size" type="string">Generated image dimensions.</ResponseField>
<ResponseField name="data[].z_index" type="integer">Layer order in decomposition mode. The background uses `0`.</ResponseField>
<ResponseField name="data[].name" type="string">Generated layer name in decomposition mode.</ResponseField>
<ResponseField name="data[].description" type="string">Generated layer description in decomposition mode.</ResponseField>
<ResponseField name="data[].bounding_box.absolute" type="integer[]">Layer bounds as `[left, top, right, bottom]` in output-image pixels.</ResponseField>
<ResponseField name="data[].bounding_box.normalized" type="integer[]">Layer bounds mapped to a 1000 × 1000 coordinate system.</ResponseField>
<ResponseField name="data[].error" type="object">Optional per-image error information if an output fails.</ResponseField>
<ResponseField name="data[].error.code" type="string">Per-image error code, when present.</ResponseField>
<ResponseField name="data[].error.message" type="string">Per-image error message, when present.</ResponseField>
<ResponseField name="usage.generated_images" type="integer">Number of generated outputs. In decomposition mode this includes the background and layers.</ResponseField>
<ResponseField name="usage.input_images" type="integer">Number of input images.</ResponseField>
<ResponseField name="usage.output_tokens" type="integer">Output token count.</ResponseField>
<ResponseField name="usage.total_tokens" type="integer">Total token count.</ResponseField>
<ResponseField name="error" type="object">Request-level error information.</ResponseField>
<ResponseField name="error.code" type="string">Request-level error code.</ResponseField>
<ResponseField name="error.message" type="string">Request-level error message.</ResponseField>
<ResponseField name="error.type" type="string">Error category when returned by AnyFast.</ResponseField>
<ResponseField name="error.param" type="string">Invalid parameter name when returned by the upstream API.</ResponseField>

## Error responses

<div className="kling-api-example-panel seedream-api-example-panel">
  <Tabs sync={false}>
    <Tab title="400">
      Invalid or unsupported request parameters.

      ```json theme={null}
      {
        "error": {
          "message": "The parameter is not supported by the current model.",
          "type": "BadRequest",
          "param": "sequential_image_generation",
          "code": "InvalidParameter"
        }
      }
      ```
    </Tab>

    <Tab title="401">
      The API key is missing or invalid.

      ```json theme={null}
      {
        "error": {
          "code": "",
          "message": "Invalid token (request id: REQUEST_ID)",
          "type": "new_api_error"
        }
      }
      ```
    </Tab>

    <Tab title="429">
      The request exceeded the applicable rate limit.

      ```json theme={null}
      {
        "error": {
          "code": "rate_limit_exceeded",
          "message": "Rate limit exceeded"
        }
      }
      ```
    </Tab>
  </Tabs>
</div>

<script src="/public/feedback.js" />


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.