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

# Seedance 2.0

> 使用提示词、首尾帧或多模态参考素材生成视频。

## 参数与输入模式

| 请求场景 | input 必填字段 |
| - | - |
| 文生视频 | prompt |
| 首帧或首尾帧 | first\_frame\_url。last\_frame\_url 可选。 |
| 参考素材生成 | reference\_image\_urls 或 reference\_video\_urls 至少一组非空。音频可选。 |

## 使用场景

将所选示例提交到创建任务接口。请把示例中的素材地址替换为你自己的公网 HTTPS 文件直链。

在提示词里用 @图片1、@视频1、@音频1 指定每种素材的用途。编号从 1 开始，分别对应各自数组中的顺序。需要严格指定首帧时，使用 first\_frame\_url。

```json 文生视频 theme={null}
{
  "model": "seedance-2.0",
  "input": {
    "prompt": "Morning mist drifts across a mountain lake as the camera moves forward.",
    "duration": 5,
    "aspect_ratio": "16:9"
  }
}
```

```json 首帧生视频 theme={null}
{
  "model": "seedance-2.0",
  "input": {
    "prompt": "Slowly pull back to reveal the valley.",
    "first_frame_url": "https://cdn.example.com/start.jpg"
  }
}
```

```json 指定首尾帧 theme={null}
{
  "model": "seedance-2.0",
  "input": {
    "prompt": "Move the camera slowly toward the cabin.",
    "first_frame_url": "https://cdn.example.com/start.jpg",
    "last_frame_url": "https://cdn.example.com/end.jpg",
    "aspect_ratio": "adaptive",
    "duration": 5
  }
}
```

```json 参考图片、音频与视频 theme={null}
{
  "model": "seedance-2.0",
  "input": {
    "reference_image_urls": [
      "https://cdn.example.com/cabin.jpg"
    ],
    "reference_video_urls": [
      "https://cdn.example.com/camera-motion.mp4"
    ],
    "duration": 5,
    "prompt": "以 @图片1 中雾里的木屋门廊作为开场画面，沿用 @视频1 的第一人称运镜穿过走廊，推开门时逐渐拉高 @音频1 的背景音乐。",
    "reference_audio_urls": [
      "https://cdn.example.com/beat.mp3"
    ],
    "generate_audio": true
  }
}
```

```json 生成同步声音 theme={null}
{
  "model": "seedance-2.0",
  "input": {
    "prompt": "咖啡店门口，店员拿起椅背上的围巾，朝正要出门的客人喊：「等一下，你的围巾忘拿了！」镜头对准店员的脸，清楚听到这句普通话，口型与台词同步。",
    "generate_audio": true
  }
}
```

```json 用尾帧衔接下一段 theme={null}
{
  "model": "seedance-2.0",
  "input": {
    "prompt": "Continue from this frame and move the camera through the doorway.",
    "first_frame_url": "https://cdn.example.com/previous-last-frame.jpg",
    "return_last_frame": true
  }
}
```

> 衔接两段视频时，先为上一段传 return\_last\_frame=true，再把它返回的 result.items\[].last\_frame\_url 用作下一段的 first\_frame\_url。

## 试用与价格

费用 = 每秒积分（向上取整为整数）× 计费秒数，精确到 0.001 积分。已提交任务按提交时报价结算。

> [card] [在线试用](https://apistable.ai/zh/models/seedance-2.0#try)
>
> 设置参数并在线生成视频。

> [card] [查看价格](https://apistable.ai/zh/models/seedance-2.0#pricing)
>
> 按分辨率查看普通渠道与官方回退的价格。


## OpenAPI

````yaml openapi-seedance-2.0-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: Seedance 2.0
      description: 使用提示词、首尾帧或多模态参考素材生成视频。
      operationId: seedance-2.0
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - input
              additionalProperties: false
              properties:
                model:
                  type: string
                  enum:
                    - seedance-2.0
                  example: seedance-2.0
                  description: 本页对应的 APIstable 模型 ID。
                input:
                  $schema: https://json-schema.org/draft/2020-12/schema
                  type: object
                  properties:
                    prompt:
                      type: string
                      minLength: 1
                      maxLength: 4000
                      description: >-
                        描述主体、动作和镜头。文生视频必填。有素材且省略提示词时，仅使用支持此组合的渠道。传入时去掉首尾空白后须为
                        1–4000 字符。
                    resolution:
                      type: string
                      enum:
                        - 480p
                        - 720p
                        - 1080p
                        - 4k
                      description: 输出分辨率。可选 480p、720p、1080p、4k，默认 720p。
                      default: 720p
                    aspect_ratio:
                      type: string
                      enum:
                        - adaptive
                        - '16:9'
                        - '4:3'
                        - '1:1'
                        - '3:4'
                        - '9:16'
                        - '21:9'
                      description: >-
                        输出宽高比。默认 adaptive，由模型根据输入决定。16:9 为横屏，9:16 为竖屏，1:1
                        为方形，另支持 4:3、3:4 和 21:9。
                      default: adaptive
                    generate_audio:
                      type: boolean
                      description: 是否生成同步音轨。默认 true，传 false 生成无声视频。
                      default: true
                    seed:
                      type: integer
                      minimum: -1
                      maximum: 4294967295
                      description: >-
                        随机种子，范围为 -1 至 4294967295 的整数。-1
                        使用随机种子。固定种子可提高可复现性，结果仍可能不同。
                    return_last_frame:
                      type: boolean
                      description: 传 true 额外返回尾帧图片。默认 false。
                      default: false
                    web_search:
                      type: boolean
                      description: 传 true 在生成时启用联网检索。默认 false。
                      default: false
                    nsfw_check:
                      type: boolean
                      description: 生成前审核提示词和输入图片（含首尾帧），默认 false。传 true 时须提供提示词或图片。
                      default: false
                    output_count:
                      default: 1
                      type: integer
                      minimum: 1
                      maximum: 4
                      description: 生成结果数量，1–4 个，默认 1。每个结果独立执行和结算，失败项不扣费。
                    official_fallback:
                      default: false
                      type: boolean
                      description: 默认 false。传 true 允许使用支持所选参数的官方兜底渠道。仅官方生成成功时按官方档结算。
                    duration:
                      type: integer
                      minimum: 4
                      maximum: 15
                      description: 输出时长，单位秒。可传 4–15 的整数，默认 5。
                      default: 5
                    first_frame_url:
                      type: string
                      format: uri
                      description: >-
                        首帧和首尾帧模式必填。填写首帧图片的公网 HTTPS URL。不能与参考素材同时使用。
                        任务完成前，请保持链接可访问且文件内容不变。
                    last_frame_url:
                      type: string
                      format: uri
                      description: >-
                        尾帧图片的公网 HTTPS URL。须同时提供 first_frame_url。
                        任务完成前，请保持链接可访问且文件内容不变。
                    reference_image_urls:
                      maxItems: 9
                      type: array
                      items:
                        type: string
                        format: uri
                        description: 服务端可访问的公网 HTTPS 文件直链。
                      description: 最多 9 张。由生成渠道校验文件。 任务完成前，请保持链接可访问且文件内容不变。
                    reference_video_urls:
                      maxItems: 3
                      type: array
                      items:
                        type: string
                        format: uri
                        description: 服务端可访问的公网 HTTPS 文件直链。
                      description: 最多 3 段参考视频。计费需要读取视频时长。由生成渠道校验文件。 任务完成前，请保持链接可访问且文件内容不变。
                    reference_audio_urls:
                      maxItems: 3
                      type: array
                      items:
                        type: string
                        format: uri
                        description: 服务端可访问的公网 HTTPS 文件直链。
                      description: >-
                        最多 3 段参考音频。由生成渠道校验文件。须同时提供参考图片或视频。
                        任务完成前，请保持链接可访问且文件内容不变。
                  additionalProperties: false
                  description: 视频生成参数。可用组合取决于所选模型和输入模式。
                callback_url:
                  type: string
                  format: uri
                  description: 任务完成时接收签名回调的公网 HTTPS 地址。须为可直接访问的地址，不能跳转到其他地址。省略时可轮询查询任务接口。
            example:
              model: seedance-2.0
              input:
                prompt: A quiet mountain lake at sunrise
                resolution: 720p
                duration: 5
                aspect_ratio: '16:9'
                official_fallback: false
      responses:
        '200':
          description: Accepted task. Poll the common task endpoint or use callback_url.
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - msg
                  - data
                additionalProperties: false
                properties:
                  code:
                    const: 200
                  msg:
                    const: success
                  data:
                    type: object
                    required:
                      - task_id
                    additionalProperties: false
                    properties:
                      task_id:
                        type: string
        '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`，结果只包含成功项。全部失败时为
                  `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": "c6adbc82-8b9a-4d6f-8b60-1114c8c4aafb",
                      "model": "seedance-2.0",
                      "status": "succeeded",
                      "created_at": "2026-11-13T08:30:00.000Z",
                      "completed_at": "2026-11-13T08:31:20.000Z",
                      "duration": 80000,
                      "charged_credits": 100,
                      "message": "",
                      "input": "{\"prompt\":\"A quiet mountain lake at sunrise\"}",
                      "result": {
                        "urls": [
                          "https://cdn.example.com/generated/video.mp4"
                        ],
                        "items": [
                          {
                            "id": "e7aacd19-819a-4747-bbbf-46fb6f2995a5",
                            "urls": [
                              "https://cdn.example.com/generated/video.mp4"
                            ],
                            "last_frame_url": null,
                            "draft": false,
                            "draft_expires_at": null
                          }
                        ]
                      }
                    }
                  }

                  ```
                content:
                  application/json:
                    schema:
                      type: object
                      required:
                        - code
                        - msg
                        - data
                      properties:
                        code:
                          type: integer
                          const: 200
                        msg:
                          type: string
                          const: success
                        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: seedance-2.0
                            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:
                                urls:
                                  type: array
                                  items:
                                    type: string
                                    format: uri
                                items:
                                  type: array
                                  items:
                                    type: object
                                    required:
                                      - id
                                      - urls
                                      - last_frame_url
                                      - draft
                                      - draft_expires_at
                                    properties:
                                      id:
                                        type: string
                                        format: uuid
                                      urls:
                                        type: array
                                        items:
                                          type: string
                                          format: uri
                                      last_frame_url:
                                        type:
                                          - string
                                          - 'null'
                                        format: uri
                                      draft:
                                        type: boolean
                                      draft_expires_at:
                                        type:
                                          - string
                                          - 'null'
                                        format: date-time
                    example:
                      code: 200
                      msg: success
                      data:
                        task_id: c6adbc82-8b9a-4d6f-8b60-1114c8c4aafb
                        model: seedance-2.0
                        status: succeeded
                        created_at: '2026-11-13T08:30:00.000Z'
                        completed_at: '2026-11-13T08:31:20.000Z'
                        duration: 80000
                        charged_credits: 100
                        message: ''
                        input: '{"prompt":"A quiet mountain lake at sunrise"}'
                        result:
                          urls:
                            - https://cdn.example.com/generated/video.mp4
                          items:
                            - id: e7aacd19-819a-4747-bbbf-46fb6f2995a5
                              urls:
                                - https://cdn.example.com/generated/video.mp4
                              last_frame_url: null
                              draft: false
                              draft_expires_at: null
              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.