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

# Seedream 4.0 Text-to-Image

> Supported models include `seedream-4-0-250828`. This document covers Text-to-Image and Sequential Image Generation scenarios. Public fields include `model`, `prompt`, `size`, `seed`, `sequential_image_generation`, `sequential_image_generation_options`, `response_format`, and `watermark`.



## OpenAPI

````yaml api-reference/en/zmodelImage/byteplus/seedream-4-0-text-to-image.json POST /v1/images/generations
openapi: 3.0.1
info:
  title: Seedream 4.0 Text-to-Image
  version: 1.0.0
  description: >-
    Seedream series Text-to-Image capability documentation. The public unified
    endpoint is `/v1/images/generations`.
  license:
    name: Project License
    url: https://github.com/QuantumNous/new-api/blob/main/LICENSE
servers:
  - url: https://api.powertokens.ai
    description: Baze API service endpoint
security: []
tags:
  - name: Seedream Image
    description: Seedream series image generation capabilities
paths:
  /v1/images/generations:
    post:
      tags:
        - Seedream Image
      summary: Seedream 4.0 Text-to-Image
      description: >-
        Supported models include `seedream-4-0-250828`. This document covers
        Text-to-Image and Sequential Image Generation scenarios. Public fields
        include `model`, `prompt`, `size`, `seed`,
        `sequential_image_generation`, `sequential_image_generation_options`,
        `response_format`, and `watermark`.
      operationId: byteplusTextToImage40
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TextToImageRequest'
            examples:
              text_to_image:
                summary: Basic Text-to-Image
                value:
                  model: seedream-4-0-250828
                  prompt: >-
                    A cute corgi running on the grass, sunny day, realistic
                    style
                  size: 2048x2048
                  response_format: url
              sequential_images:
                summary: Sequential Image Generation
                value:
                  model: seedream-4-0-250828
                  prompt: >-
                    A set of four-season landscape illustrations, spring,
                    summer, autumn, winter
                  sequential_image_generation: auto
                  response_format: url
              sequential_images_with_limit:
                summary: Limit Max Sequential Images
                value:
                  model: seedream-4-0-250828
                  prompt: >-
                    A set of four-season landscape illustrations, spring,
                    summer, autumn, winter
                  sequential_image_generation: auto
                  sequential_image_generation_options:
                    max_images: 3
      responses:
        '200':
          description: Success, returns the image generation result.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageGenerationResponse'
        '400':
          description: Invalid request parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                invalid_request:
                  summary: Parameter Error
                  value:
                    error:
                      message: Invalid request body format or field value
                      type: invalid_request_error
                      code: bad_request_body
                      param: ''
        '401':
          description: >-
            Authentication failed, for example, no token provided or invalid
            token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                unauthorized:
                  summary: Unauthorized
                  value:
                    error:
                      message: Invalid token
                      type: api_error
                      code: access_denied
                      param: ''
        '429':
          description: Rate limit triggered or insufficient account quota.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                quota_exceeded:
                  summary: Insufficient quota or rate limited
                  value:
                    error:
                      message: Insufficient account quota, please try again later
                      type: api_error
                      code: insufficient_user_quota
                      param: ''
        '500':
          description: Internal error occurred while processing the request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                internal_error:
                  summary: Internal processing failure
                  value:
                    error:
                      message: >-
                        Internal service processing failure, please try again
                        later
                      type: api_error
                      code: gen_relay_info_failed
                      param: ''
      security:
        - BearerAuth: []
components:
  schemas:
    TextToImageRequest:
      type: object
      required:
        - model
        - prompt
      properties:
        model:
          type: string
          enum:
            - seedream-4-0-250828
          description: >-
            The name of the image generation model. Supported models include
            `seedream-4-0-250828`.
        prompt:
          type: string
          description: >-
            The prompt for generating images. Supports both Chinese and English.
            It is recommended not to exceed 300 Chinese characters or 600
            English words. If the prompt is too long, the information may be
            diluted, causing the model to ignore details and focus only on key
            points, resulting in missing elements in the image.
          example: >-
            Vibrant close-up editorial portrait, model with sharp eyes, wearing
            a sculptural hat, rich color blocking.
        size:
          type: string
          x-enum:
            - 1K
            - 2K
            - 4K
          description: >-
            Specifies the size information of the generated image. Different
            models support different size configuration methods.


            **seedream-4-0-250828**:

            Specifies the size information of the generated image. Supports the
            following two methods, which cannot be mixed.


            * Method 1 | Specify the pixel width and height of the generated
            image:
              * Default value: `2048x2048`
              * Total pixel value range: [`1280x720` (921600), `4096x4096` (16777216)]
              * Aspect ratio range: [1/16, 16]

              > Note: When using Method 1, both the total pixel value range and the aspect ratio range must be satisfied simultaneously. The total pixel value is the product of the width and height pixels of a single image, not a restriction on individual width or height values.
              > * Valid example: `1600x600`
                Total pixel value 1600x600=960000, which meets the [921600, 16777216] range requirement; aspect ratio 1600/600=8/3, which meets the [1/16, 16] range requirement, so the example value is valid.
              > * Invalid example: `800x800`
                Total pixel value 800x800=640000, which does not meet the minimum requirement of 921600; aspect ratio 800/800=1, although it meets the [1/16, 16] range requirement, the two restrictions are not satisfied simultaneously, so the example value is invalid.

            * Method 2 | Specify the resolution of the generated image, and
            describe the image aspect ratio, shape, or purpose in natural
            language within the prompt, allowing the model to determine the size
            of the generated image.
              * Available values: `1K`, `2K`, `4K`

              Note: When using Method 2 and describing a specific aspect ratio in the prompt, the reference pixel dimensions actually mapped by the model are:

              | Resolution | Aspect Ratio | Pixel Dimensions |
              |---|---|---|
              | 1K | 1:1 | 1024x1024 |
              | | 4:3 | 1152x864 |
              | | 3:4 | 864x1152 |
              | | 16:9 | 1280x720 |
              | | 9:16 | 720x1280 |
              | | 3:2 | 1248x832 |
              | | 2:3 | 832x1248 |
              | | 21:9 | 1512x648 |
              | 2K | 1:1 | 2048x2048 |
              | | 4:3 | 2304x1728 |
              | | 3:4 | 1728x2304 |
              | | 16:9 | 2848x1600 |
              | | 9:16 | 1600x2848 |
              | | 3:2 | 2496x1664 |
              | | 2:3 | 1664x2496 |
              | | 21:9 | 3136x1344 |
              | 4K | 1:1 | 4096x4096 |
              | | 4:3 | 4704x3520 |
              | | 3:4 | 3520x4704 |
              | | 16:9 | 5504x3040 |
              | | 9:16 | 3040x5504 |
              | | 3:2 | 4992x3328 |
              | | 2:3 | 3328x4992 |
              | | 21:9 | 6240x2656 |
          default: 2K
          example: 2K
        response_format:
          type: string
          enum:
            - url
            - b64_json
          description: >-
            Specifies the return format of the generated image. Supports the
            following two return methods:

            - `url`: Returns an image download link; the link is valid for 24
            hours after image generation, please download the image promptly.

            - `b64_json`: Returns image data in JSON format as a Base64-encoded
            string.
          default: url
        seed:
          type: integer
          description: >-
            Random seed. Supported by some Seedream models. Value range: [-1,
            2147483647].
          default: -1
          minimum: -1
          maximum: 2147483647
        sequential_image_generation:
          type: string
          enum:
            - auto
            - disabled
          description: >-
            Controls whether to disable the sequential image generation feature.

            - `auto`: Automatic determination mode. The model will autonomously
            decide whether to return a set of images and the number of images
            based on the user's prompt.

            - `disabled`: Disable the sequential image generation feature. The
            model will only generate one image.


            Only seedream 5.0/4.5/4.0 support this parameter.
          default: disabled
        sequential_image_generation_options:
          type: object
          description: >-
            Configuration for the sequential image generation feature. Only
            takes effect when `sequential_image_generation` is set to `auto`.


            Only seedream 5.0/4.5/4.0 support this parameter.
          properties:
            max_images:
              type: integer
              description: >-
                Specifies the maximum number of images that can be generated in
                this request.

                - Value range: [1, 15]


                Note: The actual number of images that can be generated is
                affected not only by `max_images` but also by the number of
                input reference images. The number of input reference images +
                the final generated images ≤ 15.
              minimum: 1
              maximum: 15
              default: 15
        watermark:
          type: boolean
          description: >-
            Whether to add a watermark to the generated image.

            - `false`: No watermark added.

            - `true`: Adds an "AIGeneration" watermark in the bottom right
            corner of the image.
          default: true
    ImageGenerationResponse:
      type: object
      properties:
        created:
          type: integer
          format: int64
          description: Unix timestamp (seconds) of the creation time.
        data:
          type: array
          items:
            $ref: '#/components/schemas/ImageData'
          description: >-
            List of generated images. May contain multiple images in sequential
            image generation scenarios.
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
            code:
              type: string
    ImageData:
      type: object
      properties:
        url:
          type: string
          description: Image download link. Valid for 24 hours, please save it promptly.
        b64_json:
          type: string
          description: Base64-encoded image data.
        size:
          type: string
          description: >-
            Image dimensions (width x height). Only returned by
            seedream-5.0-lite/4.5/4.0.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Pass in the request header as `Authorization: Bearer <token>`.'

````