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

> Seedream 5.5 Pro 文生图、图片编辑与透明图片生成 API。

使用 `seedream-5-5-pro` 通过同步图片生成接口创建图片。选择对应标签页，查看文生图、参考图编辑或透明图片输出的请求方式。

> [!WARNING]
>
> 生成透明图片时，请将 `background` 设为 `transparent`，并将 `output_format` 设为 `png`。未设置 `background: "transparent"` 时，接口返回不透明图片。

> [tab] 文生图
>
> ## 创建图片
>
> `POST /v1/images/generations`
>
> ```bash cURL theme={null}
> curl --request POST \
>   --url https://www.anyfast.ai/v1/images/generations \
>   --header 'Authorization: Bearer YOUR_API_KEY' \
>   --header 'Content-Type: application/json' \
>   --data '{
>     "model": "seedream-5-5-pro",
>     "prompt": "一张写实的编辑风茶壶照片，茶壶放在木桌上，清晨窗边柔光，细致呈现釉面与木材纹理",
>     "size": "1K",
>     "response_format": "url",
>     "output_format": "png",
>     "watermark": false
>   }'
> ```
>
> **model** `string` *required*
>
> 使用 `seedream-5-5-pro`。
>
> **prompt** `string` *required*
>
> 图片生成文本提示词。可描述主体、构图、风格、光线、材质和需要呈现的文字。
>
> **size** `string`
>
> 支持 `1K`、`1.5K` 和 `2K`。示例使用 `1K`，响应返回尺寸为 `1248x832`。
>
> **response\_format** `string`
>
> 将生成图片作为 URL 或 Base64 数据返回。
>
> **output\_format** `string`
>
> 可使用 `png` 或 `jpeg`，两种格式均已接受。需要 Alpha 通道时使用 `png`。
>
> **watermark** `boolean`
>
> 是否添加 AI 生成水印。
>
> ### 创建响应
>
> ```json 200 theme={null}
> {
>   "model": "dola-seedream-5-5-261028",
>   "created": 1794382953,
>   "data": [
>     {
>       "url": "https://example.com/generated-image.png",
>       "size": "1248x832",
>       "output_format": "png",
>       "background": "opaque"
>     }
>   ],
>   "usage": {
>     "input_images": 0,
>     "generated_images": 1,
>     "output_tokens": 4056,
>     "total_tokens": 4056
>   }
> }
> ```

> [tab] 图片编辑
>
> ## 编辑图片
>
> `POST /v1/images/generations`
>
> ```bash cURL theme={null}
> curl --request POST \
>   --url https://www.anyfast.ai/v1/images/generations \
>   --header 'Authorization: Bearer YOUR_API_KEY' \
>   --header 'Content-Type: application/json' \
>   --data '{
>     "model": "seedream-5-5-pro",
>     "prompt": "将蓝色围巾改为森林绿。保留人物、姿势、背景、光线和其他所有细节。",
>     "image": "https://example.com/source-image.png",
>     "size": "1K",
>     "response_format": "url",
>     "output_format": "png",
>     "watermark": false
>   }'
> ```
>
> **model** `string` *required*
>
> 使用 `seedream-5-5-pro`。
>
> **prompt** `string` *required*
>
> 图片编辑指令。说明要修改的内容和需要保留的细节。
>
> **image** `string` *required*
>
> 用于编辑的源图片 URL。
>
> **size** `string`
>
> 支持 `1K`、`1.5K` 和 `2K`。示例使用 `1K`，响应返回尺寸为 `1248x832`。
>
> **response\_format** `string`
>
> 将生成图片作为 URL 或 Base64 数据返回。
>
> **output\_format** `string`
>
> 可使用 `png` 或 `jpeg`，两种格式均已接受。需要 Alpha 通道时使用 `png`。
>
> **watermark** `boolean`
>
> 是否添加 AI 生成水印。
>
> 若要继续多轮编辑，可将最新输出图片作为下一次请求的 `image`，并描述下一项具体修改。
>
> ### 创建响应
>
> ```json 200 theme={null}
> {
>   "model": "dola-seedream-5-5-261028",
>   "created": 1794383042,
>   "data": [
>     {
>       "url": "https://example.com/edited-image.png",
>       "size": "1248x832",
>       "output_format": "png",
>       "background": "opaque"
>     }
>   ],
>   "usage": {
>     "input_images": 1,
>     "generated_images": 1,
>     "output_tokens": 4056,
>     "total_tokens": 4056
>   }
> }
> ```

> [tab] 透明背景
>
> ## 生成透明图片
>
> `POST /v1/images/generations`
>
> ```bash cURL theme={null}
> curl --request POST \
>   --url https://www.anyfast.ai/v1/images/generations \
>   --header 'Authorization: Bearer YOUR_API_KEY' \
>   --header 'Content-Type: application/json' \
>   --data '{
>     "model": "seedream-5-5-pro",
>     "prompt": "一只飞翔的雪鸮，精细呈现羽毛边缘，独立素材，雪鸮以外的区域保持透明",
>     "size": "1K",
>     "response_format": "url",
>     "output_format": "png",
>     "watermark": false
>   }'
> ```
>
> **model** `string` *required*
>
> 使用 `seedream-5-5-pro`。
>
> **prompt** `string` *required*
>
> 描述图片内容，并要求主体以外的区域保持透明。
>
> **size** `string`
>
> 支持 `1K`、`1.5K` 和 `2K`。示例使用 `1K`，响应返回尺寸为 `1248x832`。
>
> **response\_format** `string`
>
> 将生成图片作为 URL 或 Base64 数据返回。
>
> **output\_format** `string` *required*
>
> 使用 `png` 以保留 RGBA 输出中的全透明和半透明效果。
>
> **background** `string` *required*
>
> 设置为 `transparent` 以请求透明 RGBA 输出。响应会返回 `opaque` 或 `transparent`。
>
> ### 创建响应
>
> ```json 200 theme={null}
> {
>   "model": "dola-seedream-5-5-261028",
>   "created": 1794383006,
>   "data": [
>     {
>       "url": "https://example.com/transparent-image.png",
>       "size": "1248x832",
>       "output_format": "png",
>       "background": "transparent"
>     }
>   ],
>   "usage": {
>     "input_images": 0,
>     "generated_images": 1,
>     "output_tokens": 4056,
>     "total_tokens": 4056
>   }
> }
> ```

## 请求头

**Authorization** `string` *required*

Bearer 鉴权，格式为 `Bearer YOUR_API_KEY`。

**Content-Type** `string` *required* (default: application/json)

请求体格式。

## 响应字段

**model** `string`

响应中返回的模型标识。本次请求返回 `dola-seedream-5-5-261028`。

**created** `integer`

请求创建时间，Unix 秒级时间戳。

**data** `object[]`

生成图片列表。

**data\[].url** `string`

`response_format` 为 `url` 时返回的临时图片链接。

**data\[].b64\_json** `string`

`response_format` 为 `b64_json` 时返回的 Base64 数据。

**data\[].size** `string`

生成图片尺寸。

**data\[].output\_format** `string`

生成图片格式。

**data\[].background** `string`

生成图片的背景模式，值为 `opaque` 或 `transparent`。

**usage.generated\_images** `integer`

生成图片数量。

**usage.input\_images** `integer`

适用时返回的输入图片数量。

**usage.output\_tokens** `integer`

输出 token 数量。

**usage.total\_tokens** `integer`

总 token 数量。

## 错误响应

错误响应通过 `error` 对象返回 `code`、`message` 和 `type` 字段。

**error** `object`

错误信息。

**error.code** `string`

可供程序识别的错误码。

**error.message** `string`

错误说明。

**error.type** `string`

错误类型。

> [tab] 400
>
> 请求无效，或包含不支持的参数值。
>
> ```json theme={null}
> { "error": { "code": "invalid_request_error", "message": "Invalid request parameter", "type": "invalid_request_error" } }
> ```

> [tab] 401
>
> API 密钥缺失或无效。
>
> ```json theme={null}
> { "error": { "code": "unauthorized", "message": "Invalid API key", "type": "authentication_error" } }
> ```

> [tab] 429
>
> 请求超过速率限制。
>
> ```json theme={null}
> { "error": { "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "type": "rate_limit_error" } }
> ```


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