> ## 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-lite

> Seedream 5.0 Lite text-to-image and image-to-image API.

Use `seedream-5-0-lite-260128` with the same synchronous endpoint for single images, image editing, and sequential image generation.

<Info>Select the **Special-Ns** resource group for specific content requests.</Info>

<Tabs>
  <Tab title="Text to image">
    ## Create an image

    `POST /v1/images/generations`

    ```bash cURL theme={null}
    curl --request POST \
      --url https://www.anyfast.ai/v1/images/generations \
      --header 'Authorization: Bearer <token>' \
      --header 'Content-Type: application/json' \
      --data '{
        "model": "seedream-5-0-lite-260128",
        "prompt": "Create four coherent storyboard frames showing an astronaut repairing a spacecraft",
        "size": "2K",
        "seed": 42,
        "sequential_image_generation": "auto",
        "sequential_image_generation_options": { "max_images": 4 },
        "response_format": "url",
        "output_format": "png",
        "watermark": false,
        "optimize_prompt_options": { "mode": "standard" }
      }'
    ```

    <ParamField body="model" type="string" required>Must be `seedream-5-0-lite-260128`.</ParamField>
    <ParamField body="prompt" type="string" required>The image-generation prompt.</ParamField>
    <ParamField body="size" type="string">`2K`, `3K`, `4K`, or a supported explicit pixel size.</ParamField>
    <ParamField body="seed" type="integer">Random seed.</ParamField>
    <ParamField body="sequential_image_generation" type="string" default="disabled">Use `auto` for sequential images or `disabled` for a single image.</ParamField>
    <ParamField body="sequential_image_generation_options.max_images" type="integer">Maximum number of sequential images.</ParamField>
    <ParamField body="response_format" type="string" default="url">`url` or `b64_json`. URLs expire after 24 hours.</ParamField>
    <ParamField body="output_format" type="string" default="jpeg">`png` or `jpeg`.</ParamField>
    <ParamField body="watermark" type="boolean" default={true}>Whether to add an AI-generated watermark.</ParamField>
    <ParamField body="optimize_prompt_options.mode" type="string" default="standard">Prompt optimization mode.</ParamField>
  </Tab>

  <Tab title="Image to image">
    ## Create an image

    `POST /v1/images/generations`

    ```bash cURL theme={null}
    curl --request POST \
      --url https://www.anyfast.ai/v1/images/generations \
      --header 'Authorization: Bearer <token>' \
      --header 'Content-Type: application/json' \
      --data '{
        "model": "seedream-5-0-lite-260128",
        "prompt": "Replace the outfit in image one with the outfit in image two while preserving identity and pose",
        "image": [
          "https://example.com/person.png",
          "https://example.com/outfit.png"
        ],
        "size": "2K",
        "response_format": "url",
        "output_format": "png",
        "watermark": false
      }'
    ```

    <ParamField body="model" type="string" required>Must be `seedream-5-0-lite-260128`.</ParamField>
    <ParamField body="prompt" type="string" required>The image-editing instruction.</ParamField>
    <ParamField body="image" type="string | string[]" required>An image URL, Base64 data URI, or up to 14 reference images.</ParamField>
    <ParamField body="size" type="string">`2K`, `3K`, `4K`, or a supported explicit pixel size.</ParamField>
    <ParamField body="seed" type="integer">Random seed.</ParamField>
    <ParamField body="sequential_image_generation" type="string" default="disabled">Use `auto` for sequential images or `disabled` for a single image.</ParamField>
    <ParamField body="sequential_image_generation_options.max_images" type="integer">Maximum output count. Reference and generated images together must not exceed 15.</ParamField>
    <ParamField body="response_format" type="string" default="url">`url` or `b64_json`. URLs expire after 24 hours.</ParamField>
    <ParamField body="output_format" type="string" default="jpeg">`png` or `jpeg`.</ParamField>
    <ParamField body="watermark" type="boolean" default={true}>Whether to add an AI-generated watermark.</ParamField>
    <ParamField body="optimize_prompt_options.mode" type="string" default="standard">Prompt optimization mode.</ParamField>

    <Note>Supported formats are jpeg, png, webp, bmp, tiff, gif, heic, and heif. Each image must be at most 30 MB, have an aspect ratio in `[1/16, 16]`, have both dimensions greater than 14 px, and contain no more than 36,000,000 pixels.</Note>
  </Tab>
</Tabs>

## Headers

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

## Response

```json 200 theme={null}
{
  "model": "seedream-5-0-lite-260128",
  "created": 1775029815,
  "data": [{
    "url": "https://example.com/generated-image.png",
    "size": "2048x2048"
  }],
  "usage": {
    "generated_images": 1,
    "output_tokens": 16384,
    "total_tokens": 16384
  }
}
```

<ResponseField name="model" type="string">The model ID used for the request.</ResponseField>
<ResponseField name="created" type="integer">Creation time as a Unix timestamp in seconds.</ResponseField>
<ResponseField name="data" type="object[]">Generated images.</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[].size" type="string">Generated image dimensions.</ResponseField>
<ResponseField name="usage.generated_images" type="integer">Number of generated images.</ResponseField>
<ResponseField name="usage.output_tokens" type="integer">Output token count.</ResponseField>
<ResponseField name="usage.total_tokens" type="integer">Total token count.</ResponseField>

## Error responses

Error responses use an `error` object with `code`, `message`, and `type` fields.

<ResponseField name="error" type="object">Error information.</ResponseField>
<ResponseField name="error.code" type="string">Machine-readable error code.</ResponseField>
<ResponseField name="error.message" type="string">Human-readable error message.</ResponseField>
<ResponseField name="error.type" type="string">Error category.</ResponseField>

<Tabs>
  <Tab title="400">
    Invalid request or unsupported parameter value.

    ```json theme={null}
    { "error": { "code": "invalid_request_error", "message": "Invalid request parameter", "type": "invalid_request_error" } }
    ```
  </Tab>

  <Tab title="401">
    Missing or invalid API key.

    ```json theme={null}
    { "error": { "code": "unauthorized", "message": "Invalid API key", "type": "authentication_error" } }
    ```
  </Tab>

  <Tab title="429">
    Rate limit exceeded.

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

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