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

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

Use `doubao-seedream-5-0-pro-260628` 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>

<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>
  <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-5-0-pro-260628",
        "prompt": "Create a premium product key visual for a smart speaker",
        "size": "2K",
        "response_format": "url",
        "output_format": "png",
        "watermark": false,
        "optimize_prompt_options": { "mode": "standard" }
      }'
    ```

    <ParamField body="model" type="string" required>Must be `doubao-seedream-5-0-pro-260628`.</ParamField>
    <ParamField body="prompt" type="string" required>The image-generation prompt.</ParamField>
    <ParamField body="size" type="string">`1K`, `2K`, or an explicit pixel size such as `2048x1024`. Explicit dimensions must meet the documented total-pixel and aspect-ratio limits.</ParamField>
    <ParamField body="response_format" type="string" default="url">`url` or `b64_json`. URLs are temporary and should be saved promptly.</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. Only `standard` is supported.</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-5-0-pro-260628",
        "prompt": "Add a ceramic coffee cup in the marked area while preserving the composition",
        "image": ["https://example.com/reference.png"],
        "size": "2K",
        "response_format": "url",
        "output_format": "png",
        "watermark": false
      }'
    ```

    <ParamField body="model" type="string" required>Must be `doubao-seedream-5-0-pro-260628`.</ParamField>
    <ParamField body="prompt" type="string" required>The editing instruction. Coordinate edits can use `point` or `bbox` tags.</ParamField>
    <ParamField body="image" type="string | string[]" required>An image URL, Base64 data URI, or up to 10 reference images.</ParamField>
    <ParamField body="size" type="string">`1K`, `2K`, or an explicit pixel size.</ParamField>
    <ParamField body="response_format" type="string" default="url">`url` or `b64_json`. URLs are temporary and should be saved promptly.</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. Only `standard` is supported.</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 at least 14 px, and contain no more than 36,000,000 pixels.</Note>
  </Tab>
</Tabs>

## Size limits

Resolution tiers are `1K` and `2K`. For explicit `widthxheight` values, the total pixel range is `1280x720` through `2048x2048x1.1025`, and the aspect ratio range is `[1/16, 16]`.

## 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-5-0-pro-260628",
  "created": 1775029815,
  "data": [{
    "url": "https://example.com/generated-image.png",
    "output_format": "png",
    "size": "2048x2048"
  }],
  "usage": {
    "generated_images": 1,
    "input_images": 0,
    "output_tokens": 16384,
    "total_tokens": 16384
  }
}
```

<ResponseField name="model" type="string">The model ID used for the request. Upstream responses may return a provider-side model name.</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[].output_format" type="string">Generated image format.</ResponseField>
<ResponseField name="data[].size" type="string">Generated image dimensions.</ResponseField>
<ResponseField name="data[].error" type="object">Per-image error information when one generated image fails.</ResponseField>
<ResponseField name="data[].error.code" type="string">Per-image error code.</ResponseField>
<ResponseField name="data[].error.message" type="string">Per-image error message.</ResponseField>
<ResponseField name="usage.generated_images" type="integer">Number of generated images.</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>

## Error responses

<Tabs>
  <Tab title="400">
    The request body is invalid or contains an unsupported parameter value.

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

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

    ```json theme={null}
    {
      "error": {
        "code": "unauthorized",
        "message": "Invalid API key"
      }
    }
    ```
  </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>

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