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

# Suno API：生成音乐视频

> 基于现有的 Suno 音乐作品生成包含封面图与滚动歌词的音乐视频。

### 重要说明

* 需要提供之前生成的 Suno 音乐任务中的 `task_id` 和 `suno_id`

### 生成音乐视频

基于现有的 Suno 音乐结果创建音乐视频。

<CodeGroup>
  ```json minimal theme={null} theme={null}
  {
      "model": "suno/music-video",
      "callback_url": "",
      "input": {
          "task_id": "task_12345678",
          "suno_id": "suno_abc123"
      }
  }
  ```

  ```json with metadata theme={null} theme={null}
  {
      "model": "suno/music-video",
      "callback_url": "",
      "input": {
          "task_id": "task_12345678",
          "suno_id": "suno_abc123",
          "author": "Ava",
          "brand": "Acme Records"
      }
  }
  ```
</CodeGroup>

### 相关资源

现有的 Suno 音乐作品可来源于以下任意接口。

<CardGroup cols={2}>
  <Card title="生成音乐" icon="music" href="/zh/suno-api/generate-music"> 通过文本提示词创建多种风格的歌曲。 </Card>

  <Card title="扩展音乐" icon="forward" href="/zh/suno-api/extend-music"> 无缝延续并扩展现有音乐作品。 </Card>

  <Card title="上传音频扩展" icon="upload" href="/zh/suno-api/extend-music-upload"> 上传音频以扩展并优化音乐作品。 </Card>

  <Card title="音乐翻唱" icon="retweet" href="/zh/suno-api/cover-music"> 使用新的风格或声音重新演绎歌曲。 </Card>
</CardGroup>

### 获取任务结果

提交任务后，可以使用统一查询接口检查任务进度并获取生成结果：

<Card title="获取 Suno 任务信息" icon="magnifying-glass" href="/zh/suno-api/suno-task-info">
  了解如何查询 Suno 任务状态并获取生成结果
</Card>


## OpenAPI

````yaml zh/suno-api/generate-music-video.json post /api/v1/client/job/CreateTask
openapi: 3.0.0
info:
  title: Crun Suno 音乐视频生成 API
  description: crun.ai Suno 音乐视频生成 API 文档
  version: 1.0.0
  contact:
    name: 技术支持
    email: support@crun.ai
servers:
  - url: https://api.crun.ai
    description: API 服务地址
security:
  - ApiKeyAuth: []
paths:
  /api/v1/client/job/CreateTask:
    post:
      summary: Suno 音乐视频生成
      operationId: suno/music-video
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - input
              properties:
                model:
                  type: string
                  enum:
                    - suno/music-video
                  description: |-
                    使用的模型名称。

                    - 必须为 `suno/music-video`
                callback_url:
                  type: string
                  format: uri
                  description: |-
                    可选回调地址，用于接收任务完成通知。

                    - 任务完成后系统会 POST 结果到该地址
                    - 回调结构与任务查询接口一致
                    - 接口需返回 HTTP 200 表示接收成功
                  example: https://your-domain.com/api/callback
                input:
                  $ref: '#/components/schemas/SunoMusicVideoInput'
            example:
              model: suno/music-video
              callback_url: https://your-domain.com/api/callback
              input:
                task_id: task_12345678
                suno_id: suno_abc123
                author: Ava
                brand: Acme Records
      responses:
        '200':
          description: 请求成功
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          task_id:
                            type: string
                            description: 任务 ID，可用于查询任务状态
                            example: task_12345678
              example:
                code: 200
                message: success
                data:
                  task_id: task_12345678
        '422':
          description: 参数校验错误
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      errors:
                        type: array
                        description: 详细错误信息
                        items:
                          type: string
                        example:
                          - specific error field message
              example:
                code: 422
                message: Missing Params or Type Error
                errors:
                  - specific error field message
        '500':
          $ref: '#/components/responses/Error'
components:
  schemas:
    SunoMusicVideoInput:
      type: object
      description: |-
        基于已生成的 Suno 音乐任务生成音乐视频的输入参数。

        规则：
        - `task_id` 必填，必须来自已完成的音乐生成任务
        - `suno_id` 必填，对应音乐条目 ID
      properties:
        task_id:
          type: string
          description: 音乐生成任务 ID
          example: task_12345678
        suno_id:
          type: string
          description: Suno 音乐 ID
          example: suno_abc123
        author:
          type: string
          maxLength: 100
          description: 音乐视频封面显示的作者名称
          example: Ava
        brand:
          type: string
          maxLength: 100
          description: 显示在视频底部的品牌水印，用于推广与署名
          example: Acme Records
      required:
        - task_id
        - suno_id
    ApiResponse:
      type: object
      properties:
        code:
          type: integer
          enum:
            - 200
            - 401
            - 402
            - 404
            - 422
            - 429
            - 455
            - 500
            - 501
            - 505
          description: |-
            响应状态码

            - **200**：成功 - 请求已成功处理
            - **401**：未授权 - 认证信息缺失或无效
            - **402**：余额不足 - 账户积分不足
            - **404**：未找到 - 请求资源不存在
            - **422**：参数错误 - 请求参数校验失败
            - **429**：请求过于频繁 - 超出频率限制
            - **455**：服务不可用 - 系统维护中
            - **500**：服务器错误 - 处理请求时发生异常
            - **501**：生成失败 - 内容生成任务失败
            - **505**：功能禁用 - 当前功能不可用
        message:
          type: string
          description: 响应消息，失败时为错误说明
          example: success
  responses:
    Error:
      description: 服务器错误
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: |-
        所有 API 均需通过 API Key 进行身份认证。

        获取 API Key：
        1. 访问 [API Key 管理页面](https://crun.ai/zh/user-api-key) 获取你的 API Key

        使用方式：
        在请求头中添加：

        x-api-key: YOUR_API_KEY

        注意：
        - 请妥善保管 API Key，不要泄露给他人
        - 如果怀疑 API Key 已泄露，请立即在管理页面重置

````