众扬汇 AI 开放平台 API 文档

文生视频

接口:POST /qwen/api/v1/services/aigc/video-generation/video-synthesis 归属:视频模型/qwen视频模型 调用地址:Base URL https://api.allyang.cn(OpenAI 兼容前缀 https://api.allyang.cn/v1)+ 上述路径 鉴权:请求头 Authorization: Bearer <你的令牌>;令牌在控制台「令牌管理」创建 说明:下方为本接口契约。路径、字段名与枚举取值与线上接口一致;叙述文字已按本平台口径重写。价格、并发与限流等数值以控制台及实际返回为准,未确认处标注「待补」。

OpenAPI Specification

yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /qwen/api/v1/services/aigc/video-generation/video-synthesis:
    post:
      summary: 文生视频
      description: "通义万相文生视频:输入文案即可产出流畅视频。可选时长 5 秒/10 秒、分辨率 480P/720P/1080P,支持 prompt 智能改写与加水印;音频侧支持自动配音或传入自有音频做音画同步(限 wan2.5)。"
      tags:
        - 视频模型/qwen视频模型
      parameters:
        - name: X-DashScope-Async
          in: header
          description: ''
          required: true
          example: enable
          schema:
            type: string
        - name: Content-Type
          in: header
          description: ''
          required: true
          example: application/json
          schema:
            type: string
        - name: Authorization
          in: header
          description: ''
          required: false
          example: Bearer {{YOUR_API_KEY}}
          schema:
            type: string
            default: Bearer {{YOUR_API_KEY}}
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                model:
                  type: string
                input:
                  type: object
                  properties:
                    prompt:
                      type: string
                      description: "文本提示词,描述期望在视频中出现的元素与视觉特点。中英文均可,每个汉字或字母计一个字符,超出部分自动截断。长度上限随模型版本不同:wan2.5-t2v-preview 不超过 2000 字符;wan2.2 及更早版本不超过 800 字符。示例值:一只小猫在月光下奔跑。"
                    negative_prompt:
                      type: string
                      description: "负向提示词,用来圈定不想在画面里出现的内容,从而约束成片。中英文均可,上限 500 字符,超出自动截断。示例值:低分辨率、错误、最差质量、低质量、残缺、多余的手指、比例不良等。"
                    audio_url:
                      type: string
                      description: "音频文件 URL,模型据此生成带声视频;仅 wan2.5-t2v-preview 支持,用法见音频设置章节。地址需为 HTTP 或 HTTPS,本地文件先上传换取临时 URL。限制:wav 或 mp3,时长 3~30s,体积不超过 15MB。超限处理:音频长于 duration(5 秒或 10 秒)时截取前段、其余丢弃;音频短于视频时长时,超出部分为无声画面(例如音频 3 秒、视频 5 秒,则前 3 秒有声、后 2 秒无声)。示例值:<示例音频地址待补>。"
                  required:
                    - prompt
                parameters:
                  type: object
                  properties:
                    size:
                      type: string
                      description: "输出分辨率,写法为「宽*高」;默认值与可选取值随 model 变化:wan2.5-t2v-preview 默认 1920*1080(1080P),480P、720P、1080P 三档全量可选;wan2.2-t2v-plus 默认 1920*1080(1080P),可选 480P 与 1080P;wanx2.1-t2v-turbo 默认 1280*720(720P),可选 480P 与 720P;wanx2.1-t2v-plus 默认 1280*720(720P),仅可选 720P。各档位可选分辨率及宽高比:480P 档为 832*480(16:9)、480*832(9:16)、624*624(1:1);720P 档为 1280*720(16:9)、720*1280(9:16)、960*960(1:1)、1088*832(4:3)、832*1088(3:4);1080P 档为 1920*1080(16:9)、1080*1920(9:16)、1440*1440(1:1)、1632*1248(4:3)、1248*1632(3:4)。"
                    prompt_extend:
                      type: boolean
                      description: "是否开启 prompt 智能改写:开启后由大模型改写输入 prompt,对较短 prompt 的效果提升明显,但会略增耗时。true(默认)开启,false 关闭。示例值:true。"
                    duration:
                      type: integer
                      description: "生成视频时长,单位秒,取值随 model 而定:wan2.5-t2v-preview 可选 5 或 10,默认 5;wan2.2-t2v-plus、wanx2.1-t2v-plus、wanx2.1-t2v-turbo 固定 5 秒且不可修改。示例值:5。"
                    audio:
                      type: boolean
                      description: "仅 wan2.5-t2v-preview 支持。是否配音:优先级 audio_url > audio,audio_url 有值时不看 audio。true(默认)自动加音轨,false 出无声视频。示例值:true。"
                    watermark:
                      type: boolean
                      description: "是否加水印。水印固定打在视频右下角,文案为“AI生成”。false(默认)不加,true 加。"
                    seed:
                      type: integer
                      description: "随机种子,区间 [0, 2147483647]。留空由系统随机生成;想让结果可复现就固定同一个值。注意:生成带概率性,同种子也未必逐帧一致。示例值:12345。"
              required:
                - model
                - input
            example:
              model: wan2.5-t2v-preview
              input:
                prompt: >-
                  一幅史诗级可爱的场景。一只小巧可爱的卡通小猫将军,身穿细节精致的金色盔甲,头戴一个稍大的头盔,勇敢地站在悬崖上。他骑着一匹虽小但英勇的战马,说:”青海长云暗雪山,孤城遥望玉门关。黄沙百战穿金甲,不破楼兰终不还。“。悬崖下方,一支由老鼠组成的、数量庞大、无穷无尽的军队正带着临时制作的武器向前冲锋。这是一个戏剧性的、大规模的战斗场景,灵感来自中国古代的战争史诗。远处的雪山上空,天空乌云密布。整体氛围是“可爱”与“霸气”的搞笑和史诗般的融合。
              parameters:
                size: 832*480
                prompt_extend: true
                duration: 10
                audio: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties: {}
          headers: {}
      security: []
components:
  schemas: {}
  securitySchemes: {}
servers: []
security: []