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

> Seedream 4.5 text-to-image and image-to-image API.

Use `doubao-seedream-4-5-251128` with the same synchronous endpoint for text-to-image and image-to-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": "doubao-seedream-4-5-251128",
        "prompt": "A serene mountain landscape at sunrise with misty valleys",
        "size": "2048x2048",
        "seed": 42,
        "watermark": false,
        "logo_info": {"add_logo": false}
      }'
    ```

    <ParamField body="model" type="string" required>Must be `doubao-seedream-4-5-251128`.</ParamField>
    <ParamField body="prompt" type="string" required>Text prompt for image generation.</ParamField>
    <ParamField body="size" type="string">Output image size.</ParamField>
    <ParamField body="watermark" type="boolean" default={false}>Whether to add a watermark.</ParamField>
    <ParamField body="seed" type="integer">Random seed.</ParamField>
    <ParamField body="logo_info" type="object">Custom logo and watermark configuration.</ParamField>
    <ParamField body="logo_info.add_logo" type="boolean">Whether to add a logo.</ParamField>
    <ParamField body="logo_info.position" type="integer">Logo position.</ParamField>
    <ParamField body="logo_info.language" type="integer">Logo language.</ParamField>
    <ParamField body="logo_info.opacity" type="number">Logo opacity from 0 to 1.</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": "doubao-seedream-4-5-251128",
        "prompt": "Create three coherent amusement-park images from both references",
        "image": ["https://example.com/ref1.png", "https://example.com/ref2.png"],
        "sequential_image_generation": "auto",
        "sequential_image_generation_options": {"max_images": 3},
        "size": "2K",
        "watermark": false
      }'
    ```

    <ParamField body="model" type="string" required>Must be `doubao-seedream-4-5-251128`.</ParamField>
    <ParamField body="prompt" type="string" required>Image generation or editing prompt.</ParamField>
    <ParamField body="image" type="string[]" required>Reference image URLs.</ParamField>
    <ParamField body="sequential_image_generation" type="string">Set to `auto` to generate an image batch.</ParamField>
    <ParamField body="sequential_image_generation_options.max_images" type="integer">Maximum number of generated images.</ParamField>
    <ParamField body="size" type="string">Output image size.</ParamField>
    <ParamField body="watermark" type="boolean" default={false}>Whether to add a watermark.</ParamField>
    <ParamField body="seed" type="integer">Random seed.</ParamField>
    <ParamField body="logo_info" type="object">Custom logo and watermark configuration.</ParamField>
  </Tab>
</Tabs>

## Supported sizes

`2048x2048`, `1728x2304`, `2304x1728`, `2848x1600`, `1600x2848`, `2496x1664`, `1664x2496`, `3136x1344`, `4096x4096`, `3520x4704`, `4704x3520`, `5504x3040`, `3040x5504`, `3328x4992`, `4992x3328`, and `6240x2656`.

## 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": "doubao-seedream-4-5-251128",
  "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">Model used for generation.</ResponseField>
<ResponseField name="created" type="integer">Creation time as a Unix timestamp in seconds.</ResponseField>
<ResponseField name="data" type="object[]">Generated image list.</ResponseField>
<ResponseField name="data[].url" type="string">Generated image URL.</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

* `401 Unauthorized` — The API key is missing or invalid.
* `429 Rate limit exceeded` — The request exceeded the applicable rate limit.

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