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

# Seedream 5.0 Pro API

> 支持 1K 至 2K 图片生成与参考图编辑，也可将源图拆成透明图层。

## 参数与输入模式

`model` 和 `input` 始终必填。任务结束前，参考图须保持可访问且内容不变。

使用预设尺寸时，传 `resolution` 和 `aspect_ratio`。用 `宽x高` 格式传入 `size` 时，以指定像素宽高为准，两个预设均不参与生成。

| 请求场景 | input 必填字段 |
| - | - |
| 文生图 | `prompt` |
| 图片编辑 | `prompt` 和非空的 `image_urls` 数组。 |
| 精确像素 | `prompt` 和 `size`。 |
| 拆分图层 | `layer_decomposition: true` 和恰好一张 JPEG 或 PNG 参考图。`prompt` 选填。 |

## 使用场景

```json 文生图 theme={null}
{
  "model": "seedream-5-0-pro",
  "input": {
    "prompt": "Studio photograph of a cobalt blue ceramic teapot, soft daylight, neutral background.",
    "resolution": "2K",
    "aspect_ratio": "16:9"
  }
}
```

```json 图片编辑 theme={null}
{
  "model": "seedream-5-0-pro",
  "input": {
    "prompt": "Replace the background with an ivory studio backdrop. Keep the teapot unchanged.",
    "image_urls": [
      "https://apistable.ai/models/seedream/seedream-5-5-teapot.png"
    ],
    "aspect_ratio": "auto"
  }
}
```

```json 指定输出像素 theme={null}
{
  "model": "seedream-5-0-pro",
  "input": {
    "prompt": "Studio photograph of a cobalt blue ceramic teapot, soft daylight, neutral background.",
    "size": "2560x1440"
  }
}
```

```json 拆分图片图层 theme={null}
{
  "model": "seedream-5-0-pro",
  "input": {
    "layer_decomposition": true,
    "image_urls": [
      "https://apistable.ai/models/seedream/seedream-5-5-teapot.png"
    ],
    "resolution": "2K"
  }
}
```

## 试用与价格

生成图片按成功张数收费。拆层按实际返回张数结算，包含底图。参考图费用因模型而异。

> [card] [在线试用](https://apistable.ai/zh/models/seedream-5-0-pro#try)
>
> 设置参数并在线生成图片。

> [card] [查看价格](https://apistable.ai/zh/models/seedream-5-0-pro#pricing)
>
> 按分辨率查看标准价和回退价。


## OpenAPI

````yaml openapi-seedream-5-0-pro-zh.json POST /api/v1/tasks/create_task
openapi: 3.1.0
info:
  title: APIstable API
  version: 1.0.0-preview
  description: >-
    Public /api/v1 protocol. Valid API keys have the same account-scoped access.
    Read the selected model documentation for its ID, supported inputs, result
    format and availability before submitting. No client submission idempotency
    or max_credits. Availability, pricing, file retention and callback formats
    follow the selected model contract. Unconfigured operations return 503.
servers:
  - url: https://apistable.ai
    description: API Stable API
security: []
paths:
  /api/v1/tasks/create_task:
    post:
      summary: Seedream 5.0 Pro API
      description: 支持 1K 至 2K 图片生成与参考图编辑，也可将源图拆成透明图层。
      operationId: seedream-5-0-pro
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - input
              additionalProperties: false
              properties:
                model:
                  type: string
                  enum:
                    - seedream-5-0-pro
                  example: seedream-5-0-pro
                  description: 本页对应的 APIstable 模型 ID。
                input:
                  $schema: https://json-schema.org/draft/2020-12/schema
                  anyOf:
                    - type: object
                      properties:
                        layer_decomposition:
                          type: boolean
                          const: false
                        prompt:
                          type: string
                          minLength: 1
                          description: 生成或编辑图片的文字描述。
                        resolution:
                          default: 2K
                          description: 分辨率档位，可与宽高比搭配使用。传入 `size` 时失效。
                          type: string
                          enum:
                            - 1K
                            - 1.5K
                            - 2K
                        aspect_ratio:
                          description: '`auto` 由模型选择比例。 固定比例也接受 `16x9` 这类写法。传入 `size` 时失效。'
                          default: auto
                          anyOf:
                            - type: string
                              enum:
                                - auto
                                - '1:1'
                                - '4:3'
                                - '3:4'
                                - '16:9'
                                - '9:16'
                                - '3:2'
                                - '2:3'
                                - '21:9'
                                - '2:1'
                                - '1:2'
                            - type: string
                              enum:
                                - 1x1
                                - 4x3
                                - 3x4
                                - 16x9
                                - 9x16
                                - 3x2
                                - 2x3
                                - 21x9
                                - 2x1
                                - 1x2
                        size:
                          description: >-
                            精确像素尺寸，例如 `2560x1440`。宽、高须为正整数，中间用小写 x。宽 × 高须为
                            921,600–4,624,220 像素，宽 ÷ 高须为 1/16–16。覆盖分辨率和宽高比预设。
                          type: string
                          pattern: ^\d{1,7}x\d{1,7}$
                        image_urls:
                          default: []
                          description: >-
                            最多 10 张公网 HTTP(S) 图片或受支持的 Base64 Data URI。JSON
                            请求体上限为 64,000 字节。
                          maxItems: 10
                          type: array
                          items:
                            anyOf:
                              - type: string
                                pattern: >-
                                  ^[Hh][Tt][Tt][Pp][Ss]?:\/\/[^/?#@\s\\]+(?:[/?][^#\s\\]*)?$
                              - type: string
                                pattern: >-
                                  ^data:image\/(jpeg|png|webp|bmp|tiff|gif|heic|heif);base64,((?=[A-Za-z0-9+/])(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?)$
                        output_format:
                          description: 输出格式。默认 JPEG。透明背景使用 PNG。
                          type: string
                          enum:
                            - jpeg
                            - png
                        background:
                          description: 输出背景。透明背景使用 PNG。透明编辑需要一张带 Alpha 通道的参考图。
                          type: string
                          enum:
                            - opaque
                            - transparent
                        optimize_prompt:
                          default: false
                          description: 在生成图片前优化提示词的表达。
                          type: boolean
                        watermark:
                          description: 添加可见水印。默认关闭。
                          type: boolean
                        output_count:
                          default: 1
                          description: 独立生成 1–4 张图片。
                          type: integer
                          minimum: 1
                          maximum: 4
                        official_fallback:
                          default: false
                          description: 允许使用最终回退档。
                          type: boolean
                        nsfw_check:
                          default: false
                          description: 在受理任务前审核提示词和参考图。
                          type: boolean
                      required:
                        - prompt
                      additionalProperties: false
                      allOf:
                        - if:
                            properties:
                              background:
                                const: transparent
                            required:
                              - background
                          then:
                            properties:
                              output_format:
                                const: png
                              image_urls:
                                minItems: 1
                                maxItems: 1
                            required:
                              - image_urls
                      title: 图片生成与编辑
                    - type: object
                      properties:
                        layer_decomposition:
                          type: boolean
                          const: true
                          description: 设为 `true` 以拆分图层。返回一张底图和最多 16 张透明图层。
                        prompt:
                          default: ''
                          type: string
                          description: 选填。描述要拆分的元素。
                        image_urls:
                          minItems: 1
                          maxItems: 1
                          type: array
                          items:
                            anyOf:
                              - type: string
                                pattern: >-
                                  ^[Hh][Tt][Tt][Pp][Ss]?:\/\/[^/?#@\s\\]+(?:[/?][^#\s\\]*)?$
                              - type: string
                                pattern: >-
                                  ^data:image\/(jpeg|png);base64,((?=[A-Za-z0-9+/])(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?)$
                          description: 恰好一张 JPEG 或 PNG 图片，可用公网 HTTP(S) 地址或 Base64 Data URI。
                        resolution:
                          default: auto
                          type: string
                          enum:
                            - auto
                            - 1K
                            - 1.5K
                            - 2K
                          description: 拆层分辨率档位，默认 `auto`。最终回退需要指定固定分辨率档位。
                        output_format:
                          default: png
                          type: string
                          enum:
                            - jpeg
                            - png
                          description: 底图格式。图层始终为透明 PNG。
                        output_count:
                          default: 1
                          type: number
                          const: 1
                          description: 一次拆层任务，固定为 `1`。
                        watermark:
                          description: 添加可见水印。默认关闭。
                          type: boolean
                        official_fallback:
                          default: false
                          description: 允许使用最终回退档。
                          type: boolean
                        nsfw_check:
                          default: false
                          description: 在受理任务前审核提示词和参考图。
                          type: boolean
                      required:
                        - layer_decomposition
                        - image_urls
                      additionalProperties: false
                      title: 拆分图层
                callback_url:
                  type: string
                  format: uri
                  description: 任务完成时接收签名回调的公网 HTTPS 地址。须为可直接访问的地址，不能跳转到其他地址。省略时可轮询查询任务接口。
            example:
              model: seedream-5-0-pro
              input:
                prompt: >-
                  Studio photograph of a cobalt blue ceramic teapot, soft
                  daylight, neutral background.
                resolution: 2K
                aspect_ratio: '16:9'
      responses:
        '200':
          description: 已受理。使用 `task_id` [查询任务](/zh/query-task)，或通过 `callback_url` 接收结果。
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - msg
                  - data
                additionalProperties: false
                properties:
                  code:
                    const: 200
                    type: integer
                  msg:
                    const: success
                    type: string
                  data:
                    type: object
                    required:
                      - task_id
                    additionalProperties: false
                    properties:
                      task_id:
                        type: string
                        format: uuid
                        description: 用于查询生成结果的任务 ID。
              example:
                code: 200
                msg: success
                data:
                  task_id: 00000000-0000-4000-8000-000000000001
        '400':
          description: >-
            40001 invalid JSON, 40002 invalid input/callback or input rejected
            by screening, 40003 unsupported parameter.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Invalid or revoked API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          description: '40201: Insufficient credits (live acceptance).'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: '40301: Website session requests require the APIstable site origin.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: '40401: Unknown model or resource not found in this account.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: '40901: Resource incompatible with this operation.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '410':
          description: '41001: Source audio or temporary resource has expired.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '413':
          description: '41301: Request too large.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: '42201: Requested capability combination is not enabled.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: '42901: Rate/concurrency limit (live acceptance).'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: '50301: Service unavailable. No live submission or charge.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      callbacks:
        Webhook:
          '{$request.body#/callback_url}':
            post:
              requestBody:
                required: true
                description: >-
                  任务成功或失败后，APIstable 向创建任务时传入的 `callback_url` 发送 JSON POST。验签后返回
                  HTTP 2xx 确认接收。


                  用 `data.status` 判断生成结果。部分成功也返回 `succeeded`。`data.result.urls`
                  列出成功图片，图片保留 14 天。全部失败时为 `failed`，`data.result` 为
                  `null`，`data.message` 提供失败原因。


                  签名和去重使用 `X-APIstable-Signature`、`X-APIstable-Timestamp` 和
                  `X-APIstable-Event-Id`。详见 [Webhook 安全与验签](/zh/webhook-secret)。


                  **Webhook 请求体示例**


                  ```json

                  {
                    "code": 200,
                    "msg": "success",
                    "data": {
                      "task_id": "00000000-0000-4000-8000-000000000001",
                      "model": "seedream-5-0-pro",
                      "status": "succeeded",
                      "created_at": "2026-11-13T08:30:00.000Z",
                      "completed_at": "2026-11-13T08:30:08.000Z",
                      "duration": 8000,
                      "charged_credits": 13.5,
                      "message": "",
                      "input": "{\"prompt\":\"Studio photograph of a cobalt blue teapot.\",\"resolution\":\"2K\"}",
                      "result": {
                        "urls": [
                          "https://cdn.example.com/generated/image.jpg"
                        ],
                        "items": [
                          {
                            "id": "00000000-0000-4000-8000-000000000002",
                            "status": "succeeded",
                            "charged_credits": 13.5,
                            "urls": [
                              "https://cdn.example.com/generated/image.jpg"
                            ]
                          }
                        ]
                      }
                    }
                  }

                  ```
                content:
                  application/json:
                    schema:
                      type: object
                      required:
                        - code
                        - msg
                        - data
                      properties:
                        code:
                          const: 200
                          type: integer
                        msg:
                          const: success
                          type: string
                        data:
                          type: object
                          additionalProperties: false
                          required:
                            - task_id
                            - model
                            - status
                            - created_at
                            - completed_at
                            - duration
                            - charged_credits
                            - message
                            - input
                            - result
                          properties:
                            task_id:
                              type: string
                            model:
                              type: string
                              const: seedream-5-0-pro
                            status:
                              type: string
                              enum:
                                - succeeded
                                - failed
                            created_at:
                              type: string
                              format: date-time
                            completed_at:
                              type:
                                - string
                                - 'null'
                              format: date-time
                            duration:
                              type:
                                - integer
                                - 'null'
                              minimum: 0
                              description: >-
                                Total elapsed milliseconds; null while
                                processing.
                            charged_credits:
                              type:
                                - number
                                - 'null'
                              minimum: 0
                              description: Final charged Credits; null until completion.
                            message:
                              type: string
                              description: >-
                                Failure reason for failed tasks, or an
                                actionable pending-settlement message while
                                processing; empty on success.
                            input:
                              type: string
                              contentMediaType: application/json
                              description: JSON-serialized accepted model input.
                            result:
                              type:
                                - object
                                - 'null'
                              required:
                                - urls
                                - items
                              properties:
                                layers:
                                  type: array
                                  maxItems: 17
                                  description: >-
                                    Layer mode only. Base image first. Optional
                                    OCR/layout metadata; coordinates refer to
                                    the base canvas. URLs are retained for 14
                                    days.
                                  items:
                                    $schema: >-
                                      https://json-schema.org/draft/2020-12/schema
                                    type: object
                                    properties:
                                      z_index:
                                        type: integer
                                        minimum: 0
                                        maximum: 99
                                      name:
                                        type: string
                                        maxLength: 200
                                      description:
                                        type: string
                                        maxLength: 1000
                                      bounding_box:
                                        type: object
                                        properties:
                                          absolute:
                                            type: array
                                            prefixItems:
                                              - type: number
                                              - type: number
                                              - type: number
                                              - type: number
                                            items: false
                                            minItems: 4
                                            maxItems: 4
                                          normalized:
                                            type: array
                                            prefixItems:
                                              - type: number
                                              - type: number
                                              - type: number
                                              - type: number
                                            items: false
                                            minItems: 4
                                            maxItems: 4
                                        additionalProperties: false
                                      text_recognition:
                                        type: object
                                        properties:
                                          text:
                                            type: string
                                            maxLength: 4000
                                          lines:
                                            maxItems: 100
                                            type: array
                                            items:
                                              type: object
                                              properties:
                                                bounding_box:
                                                  type: object
                                                  properties:
                                                    absolute:
                                                      type: array
                                                      prefixItems:
                                                        - type: number
                                                        - type: number
                                                        - type: number
                                                        - type: number
                                                      items: false
                                                      minItems: 4
                                                      maxItems: 4
                                                    normalized:
                                                      type: array
                                                      prefixItems:
                                                        - type: number
                                                        - type: number
                                                        - type: number
                                                        - type: number
                                                      items: false
                                                      minItems: 4
                                                      maxItems: 4
                                                  additionalProperties: false
                                                runs:
                                                  maxItems: 20
                                                  type: array
                                                  items:
                                                    type: object
                                                    properties:
                                                      text:
                                                        type: string
                                                        maxLength: 500
                                                      style:
                                                        type: object
                                                        properties:
                                                          similar_font_family:
                                                            type: string
                                                            maxLength: 200
                                                          foreground_color:
                                                            type: string
                                                            pattern: ^#[0-9a-f]{6}$
                                                          bold:
                                                            type: boolean
                                                          italic:
                                                            type: boolean
                                                          underline:
                                                            type: boolean
                                                          strikethrough:
                                                            type: boolean
                                                          shadow:
                                                            type: boolean
                                                          translucent:
                                                            type: boolean
                                                        additionalProperties: false
                                                    required:
                                                      - text
                                                    additionalProperties: false
                                              additionalProperties: false
                                        additionalProperties: false
                                      index:
                                        type: integer
                                        minimum: 0
                                        maximum: 16
                                      url:
                                        type: string
                                        format: uri
                                      width:
                                        type: integer
                                        exclusiveMinimum: 0
                                        maximum: 9007199254740991
                                      height:
                                        type: integer
                                        exclusiveMinimum: 0
                                        maximum: 9007199254740991
                                      output_format:
                                        type: string
                                        enum:
                                          - png
                                          - jpeg
                                    required:
                                      - index
                                      - url
                                      - width
                                      - height
                                      - output_format
                                    additionalProperties: false
                                urls:
                                  type: array
                                  maxItems: 100
                                  items:
                                    type: string
                                    format: uri
                                items:
                                  type: array
                                  maxItems: 4
                                  items:
                                    type: object
                                    required:
                                      - id
                                      - status
                                      - charged_credits
                                      - urls
                                    properties:
                                      id:
                                        type: string
                                        format: uuid
                                      status:
                                        type: string
                                      charged_credits:
                                        type: number
                                        minimum: 0
                                      urls:
                                        type: array
                                        items:
                                          type: string
                                          format: uri
                    example:
                      code: 200
                      msg: success
                      data:
                        task_id: 00000000-0000-4000-8000-000000000001
                        model: seedream-5-0-pro
                        status: succeeded
                        created_at: '2026-11-13T08:30:00.000Z'
                        completed_at: '2026-11-13T08:30:08.000Z'
                        duration: 8000
                        charged_credits: 13.5
                        message: ''
                        input: >-
                          {"prompt":"Studio photograph of a cobalt blue
                          teapot.","resolution":"2K"}
                        result:
                          urls:
                            - https://cdn.example.com/generated/image.jpg
                          items:
                            - id: 00000000-0000-4000-8000-000000000002
                              status: succeeded
                              charged_credits: 13.5
                              urls:
                                - https://cdn.example.com/generated/image.jpg
              responses:
                2XX:
                  description: 已接收 Webhook。
              method: post
              type: path
            path: '{$request.body#/callback_url}'
      security:
        - bearerAuth: []
components:
  schemas:
    Error:
      type: object
      required:
        - code
        - msg
        - data
      properties:
        code:
          type: integer
        msg:
          type: string
        data:
          type: 'null'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        登录 APIstable 后，在 [API Key 管理](https://apistable.ai/zh/console/keys)
        创建并复制密钥。


        每次调用都要在 HTTP 请求头传入：


        ```http

        Authorization: Bearer YOUR_API_KEY

        ```


        将 YOUR_API_KEY 替换为你创建的 API Key。

````

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