Skip to content

创建文生音频任务

OpenAPI Specification

yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /ent/v2/text2audio:
    post:
      summary: 创建文生音频任务
      deprecated: false
      description: 官方文档:https://platform.vidu.cn/docs/text-to-audio
      tags:
        - 官方VIDU视频生成、图片生成、音频生成
      parameters:
        - name: Authorization
          in: header
          description: ''
          required: false
          example: Bearer {{YOUR_API_KEY}}
          schema:
            type: string
        - name: Content-Type
          in: header
          description: ''
          required: false
          example: application/json
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                prompt:
                  type: string
                  description: 文本提示词用于生成音频的描述。字符长度不能超过 1500 个字符
                model:
                  type: string
                  description: 模型名称可选值:audio1.0
                callback_url:
                  type: string
                  description: >-
                    Callback 协议

                    需要您在创建任务时主动设置 callback_url,请求方法为 POST,当视频生成任务有状态变化时,Vidu
                    将向此地址发送包含任务最新状态的回调请求。回调请求内容结构与查询任务API的返回体一致

                    回调返回的“status”包括以下状态:

                    - processing 任务处理中

                    - success 任务完成(如发送失败,回调三次)

                    - failed 任务失败(如发送失败,回调三次)

                    Vidu采用回调签名算法进行认证,详情见:回调签名算法
                duration:
                  type: string
                  description: 音频时长默认 10,可选范围:2~10 秒内
                seed:
                  type: string
                  description: "\t随机种子随机种子,若不传或传0则自动生成随机数,传固定值生成确定性结果"
              required:
                - model
                - prompt
              x-apifox-orders:
                - model
                - prompt
                - duration
                - seed
                - callback_url
            example:
              model: audio1.0
              prompt: 雨滴落在窗户上的声音,伴随着轻柔的雷声
              duration: 5
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  task_id:
                    type: string
                  state:
                    type: string
                  model:
                    type: string
                  prompt:
                    type: string
                  duration:
                    type: integer
                  seed:
                    type: integer
                  created_at:
                    type: string
                  credits:
                    type: integer
                required:
                  - task_id
                  - state
                  - model
                  - prompt
                  - duration
                  - seed
                  - created_at
                  - credits
                x-apifox-orders:
                  - task_id
                  - state
                  - model
                  - prompt
                  - duration
                  - seed
                  - created_at
                  - credits
              example:
                task_id: '911094612548939776'
                state: created
                model: audio1.0
                prompt: 雨滴落在窗户上的声音,伴随着轻柔的雷声
                duration: 5
                seed: 0
                created_at: '2026-01-20T07:16:38.094635957Z'
                credits: 10
          headers: {}
          x-apifox-name: 成功
      security: []
      x-apifox-folder: 官方VIDU视频生成、图片生成、音频生成
      x-apifox-status: released
      x-run-in-apifox: https://app.apifox.com/web/project/5443236/apis/api-407976770-run
components:
  schemas: {}
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
servers:
  - url: https://www.anyapi.vip
    description: 正式环境
security:
  - bearer: []

AnyAPI — 专业的 AI 接口聚合服务