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

# Create image

> One endpoint, two uses: **image generation** creates one image from a prompt and optional reference images (`image`, up to 10) and can output RGBA images with `background: transparent`; **layer decomposition** (`layer_decomposition: true`) splits the one image in `image` into a base image and transparent layers, optionally with rich-text OCR for text layers. The request is synchronous and blocks until the images are ready; streaming and image sets are not supported.



## OpenAPI

````yaml /openapi/en/seedream-5-5.json post /api/v3/images/generations
openapi: 3.1.0
info:
  description: >-
    Seedream 5.5: ByteDance's new-generation image model with stable multi-round
    editing, native transparent (RGBA) output, layer decomposition and rich-text
    OCR.
  title: Seedream 5.5
  version: v3
servers:
  - url: https://api.dreamto.ai
security:
  - bearerAuth: []
tags:
  - name: Seedream 5.5
paths:
  /api/v3/images/generations:
    post:
      tags:
        - Seedream 5.5
      summary: Create image
      description: >-
        One endpoint, two uses: **image generation** creates one image from a
        prompt and optional reference images (`image`, up to 10) and can output
        RGBA images with `background: transparent`; **layer decomposition**
        (`layer_decomposition: true`) splits the one image in `image` into a
        base image and transparent layers, optionally with rich-text OCR for
        text layers. The request is synchronous and blocks until the images are
        ready; streaming and image sets are not supported.
      operationId: seedream55ImageGenerate
      requestBody:
        content:
          application/json:
            examples:
              Text to image:
                description: >-
                  `size` is the resolution tier `2K`; describe the aspect ratio
                  in the prompt and the model picks the final size.
                summary: Text to image
                value:
                  model: seedream-5.5
                  prompt: >-
                    A vibrant close-up editorial portrait, piercing gaze,
                    sculptural hat, rich color blocking, vertical magazine cover
                  size: 2K
                  output_format: png
              Pixel size:
                description: >-
                  `size` as `WIDTHxHEIGHT`, e.g. `2816x1584` (16:9). The total
                  pixels must be between 921,600 and 4,624,220.
                summary: Pixel size
                value:
                  model: seedream-5.5
                  prompt: A mountain cabin in morning mist, cinematic wide frame
                  size: 2816x1584
                  output_format: jpeg
                  watermark: false
              Edit an image:
                description: >-
                  Pass one image in `image` and say what to change and what to
                  keep. For multi-turn editing, send the previous output as the
                  next `image`; `background: opaque` is recommended.
                summary: Edit an image
                value:
                  model: seedream-5.5
                  prompt: >-
                    Have the person blow a semi-transparent pink bubblegum
                    bubble; keep the face, hairstyle, clothing, pose, background
                    and composition unchanged
                  image: https://your-cdn.example.com/portrait.png
                  size: 2K
                  background: opaque
              Multiple reference images:
                description: >-
                  Pass an array of up to 10 images in `image` and refer to them
                  as "image 1", "image 2" in the prompt.
                summary: Multiple reference images
                value:
                  model: seedream-5.5
                  prompt: Replace the outfit in image 1 with the outfit in image 2
                  image:
                    - https://your-cdn.example.com/person.png
                    - https://your-cdn.example.com/clothes.png
                  size: 2K
              Transparent background (text to image):
                description: >-
                  `background: transparent` with `output_format: png` generates
                  an RGBA image with an alpha channel.
                summary: Transparent background (text to image)
                value:
                  model: seedream-5.5
                  prompt: >-
                    A Christmas-themed transparent acrylic standee with a
                    red-and-green vinyl record in the center surrounded by a
                    pine wreath, transparent background
                  size: 2K
                  output_format: png
                  background: transparent
              Transparent background (from images):
                description: >-
                  The reference images do not need an alpha channel; up to 10
                  images.
                summary: Transparent background (from images)
                value:
                  model: seedream-5.5
                  prompt: >-
                    Extract the stickers from image 1 and image 2 and place them
                    on one transparent image, without overlap, with sharp and
                    intact edges
                  image:
                    - https://your-cdn.example.com/stickers-a.png
                    - https://your-cdn.example.com/stickers-b.png
                  size: 2K
                  output_format: png
                  background: transparent
              Layer decomposition:
                description: >-
                  `layer_decomposition: true` splits one image into a base image
                  and transparent layers; `max_images` caps the base image plus
                  layers (2–100, default 30).
                summary: Layer decomposition
                value:
                  model: seedream-5.5
                  prompt: >-
                    Separate each animal into a complete, independent layer;
                    keep everything else in the base image and fill the gaps
                    naturally
                  image: https://your-cdn.example.com/animals.jpeg
                  size: 2K
                  layer_decomposition: true
                  layer_decomposition_options:
                    max_images: 40
                  output_format: png
              Layer decomposition with rich-text OCR:
                description: >-
                  `text_recognition: true` also returns the text, line positions
                  and styles (font, color, bold…) of regular text layers. Layer
                  decomposition does not need a `prompt`.
                summary: Layer decomposition with rich-text OCR
                value:
                  model: seedream-5.5
                  image: https://your-cdn.example.com/poster.png
                  size: auto
                  layer_decomposition: true
                  layer_decomposition_options:
                    max_images: 15
                    text_recognition: true
              Base64 output:
                description: >-
                  `response_format: b64_json` returns the image data;
                  `safety_identifier` carries a hashed end-user ID.
                summary: Base64 output
                value:
                  model: seedream-5.5
                  prompt: A flat green leaf icon on a white background
                  size: 1K
                  response_format: b64_json
                  safety_identifier: user_5f2b8c1d
            schema:
              $ref: '#/components/schemas/Seedream55ImageRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              examples:
                Image generation result:
                  description: >-
                    Text-to-image, editing and multi-image reference return one
                    image.
                  summary: Image generation result
                  value:
                    model: seedream-5.5
                    created: 1794844508
                    data:
                      - url: https://files.dreamto.ai/images/seedream_7f3c2a9e.png
                        size: 1760x2368
                        output_format: png
                        background: opaque
                    usage:
                      input_images: 0
                      generated_images: 1
                      output_tokens: 16280
                      total_tokens: 16280
                Layer decomposition result:
                  description: >-
                    `data[0]` is the base image (`z_index` 0), followed by the
                    layers; with `text_recognition`, regular text layers carry
                    `text_recognition`.
                  summary: Layer decomposition result
                  value:
                    model: seedream-5.5
                    created: 1794844620
                    data:
                      - url: https://files.dreamto.ai/images/seedream_base_1c9e.png
                        size: 2048x2048
                        output_format: png
                        z_index: 0
                      - url: >-
                          https://files.dreamto.ai/images/seedream_layer_1_4a7d.png
                        size: 1273x265
                        output_format: png
                        background: transparent
                        z_index: 1
                        name: Seedream title text
                        description: Large yellow Seedream title text in a serif font
                        bounding_box:
                          absolute:
                            - 383
                            - 120
                            - 1655
                            - 384
                          normalized:
                            - 187
                            - 59
                            - 808
                            - 188
                      - url: >-
                          https://files.dreamto.ai/images/seedream_layer_2_9b21.png
                        size: 1166x899
                        output_format: png
                        background: transparent
                        z_index: 2
                        name: Presenter text
                        description: Two lines of dark blue presenter text
                        bounding_box:
                          absolute:
                            - 1142
                            - 528
                            - 1474
                            - 784
                          normalized:
                            - 643
                            - 529
                            - 830
                            - 786
                        text_recognition:
                          text: |-
                            Presented By : 
                            Anna Katrina Marchesi
                          lines:
                            - bounding_box:
                                absolute:
                                  - 1196
                                  - 629
                                  - 1358
                                  - 658
                                normalized:
                                  - 673
                                  - 630
                                  - 765
                                  - 659
                              runs:
                                - text: 'Presented By : '
                                  style:
                                    similar_font_family: Helvetica Neue
                                    foreground_color: '#193366'
                                    bold: true
                                    italic: false
                                    underline: false
                                    strikethrough: false
                                    shadow: false
                                    translucent: false
                            - bounding_box:
                                absolute:
                                  - 1195
                                  - 651
                                  - 1427
                                  - 681
                                normalized:
                                  - 673
                                  - 652
                                  - 803
                                  - 682
                              runs:
                                - text: Anna Katrina Marchesi
                                  style:
                                    similar_font_family: Helvetica Neue
                                    foreground_color: '#46597E'
                                    bold: false
                                    italic: false
                                    underline: false
                                    strikethrough: false
                                    shadow: false
                                    translucent: false
                    usage:
                      input_images: 1
                      generated_images: 3
                      output_tokens: 21796
                      total_tokens: 21796
              schema:
                $ref: '#/components/schemas/Seedream55ImageResponse'
          description: >-
            Images generated: one image for image generation, the base image and
            its layers for layer decomposition. The `X-Request-Id` header
            carries the request ID; include it when reporting issues.
          headers:
            X-Request-Id:
              description: ID of this request; include it when reporting issues.
              schema:
                type: string
        '400':
          content:
            application/json:
              examples:
                example:
                  value:
                    error:
                      code: invalid_request
                      http_status: 400
                      message: >-
                        output_format must be png when background is
                        transparent.
                      request_id: req_7c1e9a4b2d3f5a6b8c9d0e1f
                      type: invalid_request_error
              schema:
                $ref: '#/components/schemas/ImageAPIErrorResponse'
          description: >-
            Invalid request: a required parameter is missing, a value is invalid
            or a parameter is not supported. Not charged.
        '401':
          content:
            application/json:
              examples:
                example:
                  value:
                    error:
                      code: unauthorized
                      http_status: 401
                      message: Unauthorized.
                      request_id: req_7c1e9a4b2d3f5a6b8c9d0e1f
                      type: authentication_error
              schema:
                $ref: '#/components/schemas/ImageAPIErrorResponse'
          description: Missing or invalid API Key.
        '402':
          content:
            application/json:
              examples:
                example:
                  value:
                    error:
                      code: insufficient_balance
                      http_status: 402
                      message: Insufficient balance.
                      request_id: req_7c1e9a4b2d3f5a6b8c9d0e1f
                      type: insufficient_balance_error
              schema:
                $ref: '#/components/schemas/ImageAPIErrorResponse'
          description: Insufficient balance.
        '429':
          content:
            application/json:
              examples:
                example:
                  value:
                    error:
                      code: rate_limit_exceeded
                      http_status: 429
                      message: Rate limit exceeded. Please try again later.
                      request_id: req_7c1e9a4b2d3f5a6b8c9d0e1f
                      type: rate_limit_error
              schema:
                $ref: '#/components/schemas/ImageAPIErrorResponse'
          description: Too many requests; retry later.
        '502':
          content:
            application/json:
              examples:
                example:
                  value:
                    error:
                      code: service_unavailable
                      http_status: 502
                      message: Service temporarily unavailable. Please try again later.
                      request_id: req_7c1e9a4b2d3f5a6b8c9d0e1f
                      type: api_error
              schema:
                $ref: '#/components/schemas/ImageAPIErrorResponse'
          description: >-
            Upstream generation failed (including content moderation refusals).
            Not charged; you may retry.
        '504':
          content:
            application/json:
              examples:
                example:
                  value:
                    error:
                      code: service_unavailable
                      http_status: 504
                      message: Service temporarily unavailable. Please try again later.
                      request_id: req_7c1e9a4b2d3f5a6b8c9d0e1f
                      type: api_error
              schema:
                $ref: '#/components/schemas/ImageAPIErrorResponse'
          description: Generation timed out. The request is not charged and can be retried.
components:
  schemas:
    Seedream55ImageRequest:
      additionalProperties: false
      description: Request body of image generation.
      properties:
        model:
          description: |-
            Model name.

            **Allowed values:**
            - `seedream-5.5`: Seedream 5.5.
          enum:
            - seedream-5.5
          type: string
        prompt:
          description: >-
            The prompt. Required for image generation: what to generate or
            change. Optional for layer decomposition: how to split the image;
            without it the model finds the main elements itself. Keep it under
            about 300 Chinese characters or 600 English words; longer prompts
            make the model drop details.
          type: string
        image:
          description: >-
            Input images: a string for one or an array for several; image links
            or Base64 (`data:image/png;base64,<data>`, lowercase format), each
            up to 30 MB. For image generation these are reference images, up to
            10, and make the request image-to-image; for layer decomposition it
            is required and must be the single image to decompose (`png` /
            `jpeg`).
          oneOf:
            - title: One reference image
              type: string
            - items:
                type: string
              maxItems: 10
              title: Several reference images
              type: array
        size:
          description: >-
            Output size. Image generation: the tier `1K` / `1.5K` / `2K`
            (default `2K`; describe the aspect ratio in the prompt) or pixels
            `WIDTHxHEIGHT` (921,600–4,624,220 total pixels, aspect ratio
            1/16–16). Layer decomposition: only `1K` / `1.5K` / `2K` or `auto`
            (default, follows the source image).
          type: string
        layer_decomposition:
          description: >-
            Enables layer decomposition; default `false`. With `true` the one
            image in `image` is split into a base image and independently
            editable layers (PNG with an alpha channel); if any layer fails, the
            whole request fails.
          type: boolean
        layer_decomposition_options:
          $ref: '#/components/schemas/Seedream55LayerOptions'
          description: >-
            Layer decomposition options; only used when `layer_decomposition` is
            `true`.
        output_format:
          default: png
          description: >-
            File format of the output image. In layer decomposition it only sets
            the base image; layers are always `png`. Must be `png` when
            `background` is `transparent`.


            **Allowed values:**

            - `png`: PNG (default); supports an alpha channel.

            - `jpeg`: JPEG: smaller files, no alpha channel.
          enum:
            - png
            - jpeg
          type: string
        background:
          default: auto
          description: >-
            Whether the output has an alpha channel; image generation only.
            Passing it with layer decomposition returns 400.


            **Allowed values:**

            - `auto`: Decided by the model from the prompt and `output_format`
            (default); `jpeg` output has no alpha channel.

            - `transparent`: An RGBA image with an alpha channel;
            `output_format` must be `png`.

            - `opaque`: An RGB image without an alpha channel.
          enum:
            - auto
            - transparent
            - opaque
          type: string
        response_format:
          default: url
          description: |-
            How images are returned.

            **Allowed values:**
            - `url`: Return an image download link (default).
            - `b64_json`: Return Base64 image data.
          enum:
            - url
            - b64_json
          type: string
        optimize_prompt_options:
          $ref: '#/components/schemas/Seedream55OptimizePromptOption'
          description: Prompt optimization options.
        watermark:
          description: >-
            Whether to add a watermark; default `true` adds an "AI generated"
            watermark in the lower-right corner, `false` adds none.
          type: boolean
        safety_identifier:
          description: >-
            A unique identifier of the end user that helps the platform detect
            users who may violate the use policy. A stable English string unique
            to each user, up to 64 characters; hash the username, user ID or
            email.
          type: string
      required:
        - model
      type: object
    Seedream55ImageResponse:
      additionalProperties: false
      description: Generation result.
      properties:
        model:
          description: |-
            Echoes `model` from the request.

            **Allowed values:**
            - `seedream-5.5`: Seedream 5.5.
          enum:
            - seedream-5.5
          type: string
        created:
          description: Creation time, Unix seconds.
          format: int64
          type: integer
        data:
          description: >-
            Output images: one image for image generation; for layer
            decomposition the base image first, then the layers.
          items:
            $ref: '#/components/schemas/Seedream55ImageData'
          type: array
        safety_identifier:
          description: Returned unchanged when the request set `safety_identifier`.
          type: string
        usage:
          $ref: '#/components/schemas/Seedream55ImageUsage'
          description: Usage.
      required:
        - model
        - created
        - data
      type: object
    ImageAPIErrorResponse:
      additionalProperties: false
      description: Error response.
      properties:
        error:
          $ref: '#/components/schemas/ImageAPIError'
          description: Error details.
      required:
        - error
      type: object
    Seedream55LayerOptions:
      additionalProperties: false
      description: Layer decomposition options.
      properties:
        max_images:
          description: >-
            Maximum number of output images (base image plus layers), 2–100,
            default 30. When the prompt does not say how to split, a larger
            value usually gives a finer decomposition. The balance is checked
            for this many images before the call; only the images actually
            returned are charged.
          format: int64
          type: integer
        text_recognition:
          description: >-
            Whether to also return rich-text OCR for regular text layers
            (`data[].text_recognition`); default `false`. Non-text layers and
            irregular text such as artistic or handwritten text return no OCR
            result.
          type: boolean
      type: object
    Seedream55OptimizePromptOption:
      additionalProperties: false
      description: Prompt optimization options.
      properties:
        mode:
          default: standard
          description: |-
            Prompt optimization mode.

            **Allowed values:**
            - `standard`: Standard mode (default): higher quality, takes longer.
          enum:
            - standard
          type: string
      type: object
    Seedream55ImageData:
      additionalProperties: false
      description: >-
        One output image: the generated image, or the base image or a layer of a
        layer decomposition.
      properties:
        url:
          description: >-
            Image link (with `response_format=url`), valid for 24 hours after
            generation; download it promptly.
          type: string
        b64_json:
          description: Base64 image (with `response_format=b64_json`).
          type: string
        size:
          description: >-
            Actual size, e.g. `2048x2048`. Each image is billed by the tier of
            its actual pixels.
          type: string
        output_format:
          default: png
          description: >-
            Actual format of this image. Layers of a layer decomposition are
            always `png`.


            **Allowed values:**

            - `png`: PNG (default); supports an alpha channel.

            - `jpeg`: JPEG: smaller files, no alpha channel.
          enum:
            - png
            - jpeg
          type: string
        background:
          description: >-
            Actual transparency of this image; may differ from the requested
            `background`.


            **Allowed values:**

            - `transparent`: The image has transparent or translucent pixels.

            - `opaque`: The whole image is opaque.
          enum:
            - transparent
            - opaque
          type: string
        z_index:
          description: >-
            Stacking order (layer decomposition only): the base image is 0 and
            layers count up from 1; larger is higher.
          format: int64
          type: integer
        name:
          description: >-
            Layer name (layers only), generated by the model from the layer
            content.
          type: string
        description:
          description: >-
            Detailed description of the layer (layers only), with more features
            than `name`, such as color, state and material.
          type: string
        bounding_box:
          $ref: '#/components/schemas/Seedream55BoundingBox'
          description: >-
            Bounding box of the layer in the coordinate system of the output
            base image (layers only; the base image covers the whole canvas and
            has none).
        text_recognition:
          $ref: '#/components/schemas/Seedream55TextRecognition'
          description: >-
            Rich-text OCR of a regular text layer; returned only for layer
            decomposition with `text_recognition` `true` when the model
            identifies the layer as regular text.
      required:
        - size
      type: object
    Seedream55ImageUsage:
      additionalProperties: false
      description: Usage.
      properties:
        input_images:
          description: Number of input images.
          format: int64
          type: integer
        generated_images:
          description: >-
            Number of images generated (base image included for layer
            decomposition); only generated images are charged.
          format: int64
          type: integer
        output_tokens:
          description: '`sum(width × height) / 256`, rounded down.'
          format: int64
          type: integer
        total_tokens:
          description: Same as `output_tokens` (input tokens are not counted).
          format: int64
          type: integer
      required:
        - input_images
        - generated_images
        - output_tokens
        - total_tokens
      type: object
    ImageAPIError:
      additionalProperties: false
      description: Error details.
      properties:
        code:
          description: Error code.
          type: string
        http_status:
          description: HTTP status code.
          format: int64
          type: integer
        message:
          description: Human-readable error message.
          type: string
        request_id:
          description: Request ID; include it when reporting issues.
          type: string
        type:
          description: |-
            Error type.

            **Allowed values:**
            - `invalid_request_error`: Invalid request.
            - `authentication_error`: Authentication failed.
            - `insufficient_balance_error`: Insufficient balance.
            - `permission_error`: Permission denied.
            - `rate_limit_error`: Rate limited.
            - `api_error`: Server or upstream error.
          enum:
            - invalid_request_error
            - authentication_error
            - insufficient_balance_error
            - permission_error
            - rate_limit_error
            - api_error
          type: string
      required:
        - code
        - http_status
        - message
        - request_id
        - type
      type: object
    Seedream55BoundingBox:
      additionalProperties: false
      description: A bounding box in the coordinate system of the output base image.
      properties:
        absolute:
          description: >-
            Absolute pixel coordinates `[left, top, right, bottom]`; the
            top-left of the base image is `(0, 0)`. Scale the layer to `(right -
            left) × (bottom - top)` and place it at `(left, top)` to restore it
            on the base image.
          items:
            format: int64
            type: integer
          type: array
        normalized:
          description: >-
            Normalized coordinates `[left, top, right, bottom]`, integers 0–1000
            relative to the base image size, for restoring on a canvas of any
            size; rounding may cause an error of about a pixel.
          items:
            format: int64
            type: integer
          type: array
      required:
        - absolute
        - normalized
      type: object
    Seedream55TextRecognition:
      additionalProperties: false
      description: Rich-text OCR of a text layer.
      properties:
        text:
          description: >-
            The full plain text of the layer, top to bottom and left to right,
            with lines separated by `\n`.
          type: string
        lines:
          description: The text lines in order; each has a position and style runs.
          items:
            $ref: '#/components/schemas/Seedream55TextLine'
          type: array
      required:
        - text
        - lines
      type: object
    Seedream55TextLine:
      additionalProperties: false
      description: One text line.
      properties:
        bounding_box:
          $ref: '#/components/schemas/Seedream55BoundingBox'
          description: >-
            Bounding box of the line in the coordinate system of the output base
            image; same rules as the layer `bounding_box`.
        runs:
          description: >-
            Style runs of the line: one element when the whole line shares a
            style, several when the font, color, weight and so on change within
            the line.
          items:
            $ref: '#/components/schemas/Seedream55TextRun'
          type: array
      required:
        - bounding_box
        - runs
      type: object
    Seedream55TextRun:
      additionalProperties: false
      description: A run of text with one style.
      properties:
        text:
          description: Text of the run, without line breaks.
          type: string
        style:
          $ref: '#/components/schemas/Seedream55TextStyle'
          description: >-
            Approximate visual style of the run, recognized by the model; may
            differ from the exact attributes of the original design file.
      required:
        - text
        - style
      type: object
    Seedream55TextStyle:
      additionalProperties: false
      description: Approximate visual style of text.
      properties:
        similar_font_family:
          description: >-
            Name of the closest font matched from the appearance; not guaranteed
            to be the original font. `unknown` when it cannot be recognized or
            confidence is low.
          type: string
        foreground_color:
          description: Text color as uppercase hexadecimal `#RRGGBB`, without alpha.
          type: string
        bold:
          description: Whether the text is recognized as bold.
          type: boolean
        italic:
          description: >-
            Whether the text is recognized as italic: `true` only when the
            glyphs themselves slant right, not for rotation of the layer or
            perspective.
          type: boolean
        underline:
          description: >-
            Whether the text is underlined; separate dividers, table rules and
            decorative lines do not count.
          type: boolean
        strikethrough:
          description: Whether the text is struck through.
          type: boolean
        shadow:
          description: >-
            Whether the text has a distinct drop shadow, shadow or glow offset;
            ordinary antialiasing at the edges does not count.
          type: boolean
        translucent:
          description: >-
            Whether the text ink itself is visibly translucent and shows the
            background beneath; solid light colors such as light gray or light
            blue do not count.
          type: boolean
      required:
        - similar_font_family
        - foreground_color
        - bold
        - italic
        - underline
        - strikethrough
        - shadow
        - translucent
      type: object
  securitySchemes:
    bearerAuth:
      description: >-
        API Key created in the DreamTo console, sent as `Authorization: Bearer
        <API Key>`.
      scheme: bearer
      type: http

````

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