{
  "openapi": "3.1.0",
  "info": {
    "title": "PixVerse 三模型视频API",
    "version": "2.0.0",
    "description": "用户注册后自建Key，所有Key共享⚡钱包。新建视频任务受理时预扣，成功结算，失败退款；查询、上传、下载免费。单价由管理员设置，按受理时锁价。金额均为三位小数的十进制字符串。支持上传ID以及公网HTTPS图片、视频、音频参考。"
  },
  "servers": [
    {
      "url": "https://api.youqian666.vip/v1"
    }
  ],
  "security": [
    {
      "ApiKey": []
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "pvk_调用密钥"
      }
    },
    "schemas": {
      "LightningAmount": {
        "type": "string",
        "pattern": "^-?(?:0|[1-9][0-9]*)\\.[0-9]{3}$",
        "description": "十进制字符串，精度0.001⚡；不要使用浮点数计算金额。",
        "examples": [
          "1.250"
        ]
      },
      "Pricing": {
        "type": "object",
        "required": [
          "configured",
          "enabled",
          "allowFree",
          "unitPrice",
          "unit"
        ],
        "properties": {
          "configured": {
            "type": "boolean"
          },
          "enabled": {
            "type": "boolean"
          },
          "allowFree": {
            "type": "boolean",
            "description": "0⚡价格只有管理员显式允许时才可启用。"
          },
          "unitPrice": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^-?(?:0|[1-9][0-9]*)\\.[0-9]{3}$",
            "description": "每个新建视频任务的统一单价；尚未配置时为null。",
            "examples": [
              "1.250"
            ]
          },
          "version": {
            "type": [
              "integer",
              "null"
            ]
          },
          "unit": {
            "const": "⚡"
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "Wallet": {
        "type": "object",
        "required": [
          "userId",
          "unit",
          "available",
          "pending",
          "spent"
        ],
        "properties": {
          "userId": {
            "type": "string",
            "format": "uuid"
          },
          "unit": {
            "const": "⚡"
          },
          "available": {
            "type": "string",
            "pattern": "^-?(?:0|[1-9][0-9]*)\\.[0-9]{3}$",
            "description": "十进制字符串，精度0.001⚡；不要使用浮点数计算金额。",
            "examples": [
              "1.250"
            ]
          },
          "pending": {
            "type": "string",
            "pattern": "^-?(?:0|[1-9][0-9]*)\\.[0-9]{3}$",
            "description": "十进制字符串，精度0.001⚡；不要使用浮点数计算金额。",
            "examples": [
              "1.250"
            ]
          },
          "spent": {
            "type": "string",
            "pattern": "^-?(?:0|[1-9][0-9]*)\\.[0-9]{3}$",
            "description": "十进制字符串，精度0.001⚡；不要使用浮点数计算金额。",
            "examples": [
              "1.250"
            ]
          },
          "updatedAt": {
            "type": "string"
          }
        }
      },
      "VideoBilling": {
        "type": "object",
        "required": [
          "amount",
          "unit",
          "status",
          "price_version"
        ],
        "description": "受理时锁定的任务计费记录。同Key与同幂等键重放不会重复预扣。",
        "properties": {
          "amount": {
            "type": "string",
            "pattern": "^-?(?:0|[1-9][0-9]*)\\.[0-9]{3}$",
            "description": "十进制字符串，精度0.001⚡；不要使用浮点数计算金额。",
            "examples": [
              "1.250"
            ]
          },
          "unit": {
            "const": "⚡"
          },
          "status": {
            "enum": [
              "reserved",
              "review",
              "settled",
              "refunded"
            ]
          },
          "price_version": {
            "type": "integer"
          }
        }
      }
    }
  },
  "paths": {
    "/balance": {
      "get": {
        "summary": "查询当前用户的⚡钱包",
        "description": "免费。用户所有Key共享一个钱包，初始余额0⚡。内部Key不关联用户钱包，internal为true且wallet为null。",
        "responses": {
          "200": {
            "description": "钱包与当前单价",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "wallet",
                    "pricing",
                    "internal"
                  ],
                  "properties": {
                    "wallet": {
                      "oneOf": [
                        {
                          "$ref": "#/components/schemas/Wallet"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "pricing": {
                      "type": "object",
                      "required": [
                        "configured",
                        "enabled",
                        "allowFree",
                        "unitPrice",
                        "unit"
                      ],
                      "properties": {
                        "configured": {
                          "type": "boolean"
                        },
                        "enabled": {
                          "type": "boolean"
                        },
                        "allowFree": {
                          "type": "boolean",
                          "description": "0⚡价格只有管理员显式允许时才可启用。"
                        },
                        "unitPrice": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "pattern": "^-?(?:0|[1-9][0-9]*)\\.[0-9]{3}$",
                          "description": "每个新建视频任务的统一单价；尚未配置时为null。",
                          "examples": [
                            "1.250"
                          ]
                        },
                        "version": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "unit": {
                          "const": "⚡"
                        },
                        "updatedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      }
                    },
                    "internal": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "请求失败，查看error.code与error.message",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "请求失败，查看error.code与error.message",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/pricing": {
      "get": {
        "summary": "查询当前统一调用单价",
        "description": "免费。已受理任务固定原单价与版本，不受后续调价影响。未配置价格时不接受新用户视频任务。",
        "responses": {
          "200": {
            "description": "当前计费设置",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "pricing"
                  ],
                  "properties": {
                    "pricing": {
                      "type": "object",
                      "required": [
                        "configured",
                        "enabled",
                        "allowFree",
                        "unitPrice",
                        "unit"
                      ],
                      "properties": {
                        "configured": {
                          "type": "boolean"
                        },
                        "enabled": {
                          "type": "boolean"
                        },
                        "allowFree": {
                          "type": "boolean",
                          "description": "0⚡价格只有管理员显式允许时才可启用。"
                        },
                        "unitPrice": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "pattern": "^-?(?:0|[1-9][0-9]*)\\.[0-9]{3}$",
                          "description": "每个新建视频任务的统一单价；尚未配置时为null。",
                          "examples": [
                            "1.250"
                          ]
                        },
                        "version": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "unit": {
                          "const": "⚡"
                        },
                        "updatedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "请求失败，查看error.code与error.message",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "请求失败，查看error.code与error.message",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/models": {
      "get": {
        "summary": "查询三个可用模型与参数能力",
        "responses": {
          "200": {
            "description": "模型能力目录"
          },
          "401": {
            "description": "请求失败，查看error.code与error.message",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "请求失败，查看error.code与error.message",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/files": {
      "post": {
        "summary": "上传单张参考图片，最大10MB",
        "description": "平台确认受理后清理本地副本。尚待提交或缺受理回执的共享引用继续保留。未成功提交使用的上传图片在满24小时后回收。",
        "requestBody": {
          "required": true,
          "content": {
            "image/png": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "image/jpeg": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "image/webp": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "返回id、bytes、filename"
          },
          "401": {
            "description": "请求失败，查看error.code与error.message",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "请求失败，查看error.code与error.message",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "请求失败，查看error.code与error.message",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "请求失败，查看error.code与error.message",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/videos": {
      "post": {
        "summary": "创建一个异步视频任务并预扣⚡",
        "description": "受理时按当前单价预扣；成功结算，明确失败或可取消的本地任务取消后退回。相同Key、幂等键和参数重放原任务，不重复扣款。余额不足返回402 INSUFFICIENT_BALANCE；未配置并启用单价返回503 BILLING_NOT_CONFIGURED。平台提交超时且没有平台任务号时失败退款并释放名额，禁止自动重发。",
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "model",
                      "prompt"
                    ],
                    "properties": {
                      "model": {
                        "type": "string",
                        "const": "wan-3.0"
                      },
                      "prompt": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 20000,
                        "description": "去除首尾空白后按 UTF-16 代码单元计数。"
                      },
                      "duration": {
                        "type": "integer",
                        "enum": [
                          2,
                          3,
                          4,
                          5,
                          6,
                          7,
                          8,
                          9,
                          10,
                          11,
                          12,
                          13,
                          14,
                          15,
                          16,
                          17,
                          18,
                          19,
                          20,
                          21,
                          22,
                          23,
                          24,
                          25,
                          26,
                          27,
                          28,
                          29,
                          30
                        ],
                        "default": 5
                      },
                      "quality": {
                        "type": "string",
                        "enum": [
                          "480p",
                          "720p",
                          "1080p"
                        ],
                        "default": "720p"
                      },
                      "aspect_ratio": {
                        "type": "string",
                        "enum": [
                          "auto",
                          "16:9",
                          "4:3",
                          "1:1",
                          "3:4",
                          "9:16"
                        ],
                        "description": "省略时为16:9。"
                      },
                      "audio": {
                        "type": "boolean",
                        "default": true,
                        "description": "Wan3音频可选；省略时沿用默认true，可显式false关闭。"
                      },
                      "relax_mode": {
                        "type": "boolean",
                        "default": true,
                        "description": "默认开启休闲模式。显式false可能扣积分，仅用提交前积分大于500的合格账号。暂无合格账号时继续排队。关闭休闲不计入本服务的单账号休闲并发和每小时受理额度，平台实际容量仍生效。"
                      },
                      "reference_id": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "旧单图首帧模式：使用同一API Key上传的一个图片编号。不能与非空reference_ids同时使用。"
                      },
                      "reference_ids": {
                        "type": "array",
                        "minItems": 1,
                        "maxItems": 10,
                        "uniqueItems": true,
                        "items": {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,128}$"
                        },
                        "description": "多图参考模式：逐张上传后按顺序填写图片编号，最多10张；每张必须属于同一API Key。不会把参考图固定为首帧。"
                      },
                      "media": {
                        "type": "array",
                        "minItems": 1,
                        "maxItems": 20,
                        "uniqueItems": true,
                        "items": {
                          "type": "object",
                          "required": [
                            "type",
                            "url"
                          ],
                          "additionalProperties": false,
                          "properties": {
                            "type": {
                              "enum": [
                                "first_frame",
                                "reference_image",
                                "reference_video",
                                "reference_audio"
                              ]
                            },
                            "url": {
                              "type": "string",
                              "format": "uri",
                              "maxLength": 2048,
                              "pattern": "^https://"
                            }
                          }
                        },
                        "description": "公网HTTPS参考素材。图片10张、视频5段、音频5段。首帧独占。不能与已上传素材ID混用。"
                      }
                    },
                    "allOf": [
                      {
                        "not": {
                          "required": [
                            "reference_id",
                            "reference_ids"
                          ],
                          "properties": {
                            "reference_id": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      {
                        "if": {
                          "required": [
                            "media"
                          ]
                        },
                        "then": {
                          "not": {
                            "anyOf": [
                              {
                                "required": [
                                  "reference_ids"
                                ]
                              },
                              {
                                "required": [
                                  "reference_id"
                                ],
                                "properties": {
                                  "reference_id": {
                                    "type": "string"
                                  }
                                }
                              }
                            ]
                          }
                        }
                      },
                      {
                        "if": {
                          "required": [
                            "media"
                          ],
                          "properties": {
                            "media": {
                              "contains": {
                                "properties": {
                                  "type": {
                                    "const": "first_frame"
                                  }
                                }
                              }
                            }
                          }
                        },
                        "then": {
                          "properties": {
                            "media": {
                              "maxItems": 1
                            },
                            "aspect_ratio": {
                              "enum": [
                                "auto",
                                "16:9",
                                "4:3",
                                "1:1",
                                "3:4",
                                "9:16"
                              ]
                            }
                          }
                        }
                      },
                      {
                        "if": {
                          "anyOf": [
                            {
                              "required": [
                                "reference_ids"
                              ]
                            },
                            {
                              "required": [
                                "media"
                              ],
                              "properties": {
                                "media": {
                                  "not": {
                                    "contains": {
                                      "properties": {
                                        "type": {
                                          "const": "first_frame"
                                        }
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          ]
                        },
                        "then": {
                          "properties": {
                            "duration": {
                              "enum": [
                                2,
                                3,
                                4,
                                5,
                                6,
                                7,
                                8,
                                9,
                                10,
                                11,
                                12,
                                13,
                                14,
                                15,
                                16,
                                17,
                                18,
                                19,
                                20,
                                21,
                                22,
                                23,
                                24,
                                25,
                                26,
                                27,
                                28,
                                29,
                                30
                              ]
                            },
                            "quality": {
                              "enum": [
                                "480p",
                                "720p",
                                "1080p"
                              ]
                            },
                            "aspect_ratio": {
                              "enum": [
                                "auto",
                                "16:9",
                                "4:3",
                                "1:1",
                                "3:4",
                                "9:16"
                              ]
                            }
                          }
                        }
                      }
                    ]
                  },
                  {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "model",
                      "prompt"
                    ],
                    "properties": {
                      "model": {
                        "type": "string",
                        "const": "seedance-2.5-flash"
                      },
                      "prompt": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 5000,
                        "description": "去除首尾空白后按 UTF-16 代码单元计数。"
                      },
                      "duration": {
                        "type": "integer",
                        "enum": [
                          4,
                          5,
                          6,
                          7,
                          8,
                          9,
                          10,
                          11,
                          12,
                          13,
                          14,
                          15,
                          16,
                          17,
                          18,
                          19,
                          20,
                          21,
                          22,
                          23,
                          24,
                          25,
                          26,
                          27,
                          28,
                          29,
                          30
                        ],
                        "default": 5
                      },
                      "quality": {
                        "type": "string",
                        "enum": [
                          "720p",
                          "480p"
                        ],
                        "default": "720p"
                      },
                      "aspect_ratio": {
                        "type": "string",
                        "enum": [
                          "21:9",
                          "16:9",
                          "4:3",
                          "1:1",
                          "3:4",
                          "9:16",
                          "auto"
                        ],
                        "description": "文生与多图参考使用六种固定比例，单图首帧必须auto；省略时按输入模式选择。"
                      },
                      "audio": {
                        "type": "boolean",
                        "const": false,
                        "description": "该模型不能通过CLI控制声音，省略或false不代表结果静音。"
                      },
                      "relax_mode": {
                        "type": "boolean",
                        "default": true,
                        "description": "默认开启休闲模式。显式false可能扣积分，仅用提交前积分大于500的合格账号。暂无合格账号时继续排队。关闭休闲不计入本服务的单账号休闲并发和每小时受理额度，平台实际容量仍生效。"
                      },
                      "reference_id": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "旧单图首帧模式：使用同一API Key上传的一个图片编号。不能与非空reference_ids同时使用。"
                      },
                      "reference_ids": {
                        "type": "array",
                        "minItems": 1,
                        "maxItems": 10,
                        "uniqueItems": true,
                        "items": {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,128}$"
                        },
                        "description": "多图参考模式：逐张上传后按顺序填写图片编号，最多10张；每张必须属于同一API Key。不会把参考图固定为首帧。"
                      },
                      "media": {
                        "type": "array",
                        "minItems": 1,
                        "maxItems": 20,
                        "uniqueItems": true,
                        "items": {
                          "type": "object",
                          "required": [
                            "type",
                            "url"
                          ],
                          "additionalProperties": false,
                          "properties": {
                            "type": {
                              "enum": [
                                "first_frame",
                                "reference_image",
                                "reference_video",
                                "reference_audio"
                              ]
                            },
                            "url": {
                              "type": "string",
                              "format": "uri",
                              "maxLength": 2048,
                              "pattern": "^https://"
                            }
                          }
                        },
                        "description": "公网HTTPS参考素材。图片10张、视频5段、音频5段。首帧独占。不能与已上传素材ID混用。"
                      }
                    },
                    "allOf": [
                      {
                        "not": {
                          "required": [
                            "reference_id",
                            "reference_ids"
                          ],
                          "properties": {
                            "reference_id": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      {
                        "if": {
                          "required": [
                            "media"
                          ]
                        },
                        "then": {
                          "not": {
                            "anyOf": [
                              {
                                "required": [
                                  "reference_ids"
                                ]
                              },
                              {
                                "required": [
                                  "reference_id"
                                ],
                                "properties": {
                                  "reference_id": {
                                    "type": "string"
                                  }
                                }
                              }
                            ]
                          }
                        }
                      },
                      {
                        "if": {
                          "required": [
                            "media"
                          ],
                          "properties": {
                            "media": {
                              "contains": {
                                "properties": {
                                  "type": {
                                    "const": "first_frame"
                                  }
                                }
                              }
                            }
                          }
                        },
                        "then": {
                          "properties": {
                            "media": {
                              "maxItems": 1
                            },
                            "aspect_ratio": {
                              "enum": [
                                "auto"
                              ]
                            }
                          }
                        }
                      },
                      {
                        "if": {
                          "anyOf": [
                            {
                              "required": [
                                "reference_ids"
                              ]
                            },
                            {
                              "required": [
                                "media"
                              ],
                              "properties": {
                                "media": {
                                  "not": {
                                    "contains": {
                                      "properties": {
                                        "type": {
                                          "const": "first_frame"
                                        }
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          ]
                        },
                        "then": {
                          "properties": {
                            "duration": {
                              "enum": [
                                4,
                                5,
                                6,
                                7,
                                8,
                                9,
                                10,
                                11,
                                12,
                                13,
                                14,
                                15,
                                16,
                                17,
                                18,
                                19,
                                20,
                                21,
                                22,
                                23,
                                24,
                                25,
                                26,
                                27,
                                28,
                                29,
                                30
                              ]
                            },
                            "quality": {
                              "enum": [
                                "720p",
                                "480p"
                              ]
                            },
                            "aspect_ratio": {
                              "enum": [
                                "21:9",
                                "16:9",
                                "4:3",
                                "1:1",
                                "3:4",
                                "9:16"
                              ]
                            }
                          }
                        },
                        "else": {
                          "if": {
                            "anyOf": [
                              {
                                "required": [
                                  "media"
                                ]
                              },
                              {
                                "required": [
                                  "reference_id"
                                ],
                                "properties": {
                                  "reference_id": {
                                    "type": "string"
                                  }
                                }
                              }
                            ]
                          },
                          "then": {
                            "properties": {
                              "aspect_ratio": {
                                "enum": [
                                  "auto"
                                ]
                              }
                            }
                          },
                          "else": {
                            "properties": {
                              "aspect_ratio": {
                                "enum": [
                                  "21:9",
                                  "16:9",
                                  "4:3",
                                  "1:1",
                                  "3:4",
                                  "9:16"
                                ]
                              }
                            }
                          }
                        }
                      }
                    ]
                  },
                  {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "model",
                      "prompt"
                    ],
                    "properties": {
                      "model": {
                        "type": "string",
                        "const": "minimax-h3"
                      },
                      "prompt": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 5000,
                        "description": "去除首尾空白后按 UTF-16 代码单元计数。"
                      },
                      "duration": {
                        "type": "integer",
                        "enum": [
                          5,
                          6,
                          7,
                          8,
                          9,
                          10,
                          11,
                          12,
                          13,
                          14,
                          15
                        ],
                        "default": 5
                      },
                      "quality": {
                        "type": "string",
                        "enum": [
                          "768p",
                          "1440p"
                        ],
                        "default": "768p"
                      },
                      "aspect_ratio": {
                        "type": "string",
                        "enum": [
                          "21:9",
                          "16:9",
                          "4:3",
                          "1:1",
                          "3:4",
                          "9:16",
                          "auto"
                        ],
                        "description": "省略时为16:9。"
                      },
                      "audio": {
                        "type": "boolean",
                        "const": false,
                        "description": "该模型不能通过CLI控制声音，省略或false不代表结果静音。"
                      },
                      "relax_mode": {
                        "type": "boolean",
                        "default": true,
                        "description": "默认开启休闲模式。显式false可能扣积分，仅用提交前积分大于500的合格账号。暂无合格账号时继续排队。关闭休闲不计入本服务的单账号休闲并发和每小时受理额度，平台实际容量仍生效。"
                      },
                      "reference_id": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "旧单图首帧模式：使用同一API Key上传的一个图片编号。不能与非空reference_ids同时使用。"
                      },
                      "reference_ids": {
                        "type": "array",
                        "minItems": 1,
                        "maxItems": 9,
                        "uniqueItems": true,
                        "items": {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,128}$"
                        },
                        "description": "多图参考模式：逐张上传后按顺序填写图片编号，最多9张；每张必须属于同一API Key。不会把参考图固定为首帧。"
                      },
                      "media": {
                        "type": "array",
                        "minItems": 1,
                        "maxItems": 15,
                        "uniqueItems": true,
                        "items": {
                          "type": "object",
                          "required": [
                            "type",
                            "url"
                          ],
                          "additionalProperties": false,
                          "properties": {
                            "type": {
                              "enum": [
                                "first_frame",
                                "reference_image",
                                "reference_video",
                                "reference_audio"
                              ]
                            },
                            "url": {
                              "type": "string",
                              "format": "uri",
                              "maxLength": 2048,
                              "pattern": "^https://"
                            }
                          }
                        },
                        "description": "公网HTTPS参考素材。图片9张、视频3段、音频3段。首帧独占。不能与已上传素材ID混用。"
                      }
                    },
                    "allOf": [
                      {
                        "not": {
                          "required": [
                            "reference_id",
                            "reference_ids"
                          ],
                          "properties": {
                            "reference_id": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      {
                        "if": {
                          "required": [
                            "media"
                          ]
                        },
                        "then": {
                          "not": {
                            "anyOf": [
                              {
                                "required": [
                                  "reference_ids"
                                ]
                              },
                              {
                                "required": [
                                  "reference_id"
                                ],
                                "properties": {
                                  "reference_id": {
                                    "type": "string"
                                  }
                                }
                              }
                            ]
                          }
                        }
                      },
                      {
                        "if": {
                          "required": [
                            "media"
                          ],
                          "properties": {
                            "media": {
                              "contains": {
                                "properties": {
                                  "type": {
                                    "const": "first_frame"
                                  }
                                }
                              }
                            }
                          }
                        },
                        "then": {
                          "properties": {
                            "media": {
                              "maxItems": 1
                            },
                            "aspect_ratio": {
                              "enum": [
                                "21:9",
                                "16:9",
                                "4:3",
                                "1:1",
                                "3:4",
                                "9:16",
                                "auto"
                              ]
                            }
                          }
                        }
                      },
                      {
                        "if": {
                          "anyOf": [
                            {
                              "required": [
                                "reference_ids"
                              ]
                            },
                            {
                              "required": [
                                "media"
                              ],
                              "properties": {
                                "media": {
                                  "not": {
                                    "contains": {
                                      "properties": {
                                        "type": {
                                          "const": "first_frame"
                                        }
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          ]
                        },
                        "then": {
                          "properties": {
                            "duration": {
                              "enum": [
                                5,
                                6,
                                7,
                                8,
                                9,
                                10,
                                11,
                                12,
                                13,
                                14,
                                15
                              ]
                            },
                            "quality": {
                              "enum": [
                                "768p",
                                "1440p"
                              ]
                            },
                            "aspect_ratio": {
                              "enum": [
                                "21:9",
                                "16:9",
                                "4:3",
                                "1:1",
                                "3:4",
                                "9:16",
                                "auto"
                              ]
                            }
                          }
                        }
                      }
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "视频任务",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "object",
                    "model",
                    "status"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "object": {
                      "const": "video"
                    },
                    "model": {
                      "type": "string",
                      "enum": [
                        "wan-3.0",
                        "seedance-2.5-flash",
                        "minimax-h3"
                      ]
                    },
                    "status": {
                      "enum": [
                        "queued",
                        "in_progress",
                        "completed",
                        "failed",
                        "requires_attention",
                        "cancelled"
                      ]
                    },
                    "parameters": {
                      "type": "object"
                    },
                    "content_url": {
                      "type": "string"
                    },
                    "video_url": {
                      "type": "string",
                      "format": "uri",
                      "description": "已完成任务的上游成片 HTTPS 地址，仅当查询带 include=video_url 且原地址可返回时提供。"
                    },
                    "billing": {
                      "type": "object",
                      "required": [
                        "amount",
                        "unit",
                        "status",
                        "price_version"
                      ],
                      "description": "受理时锁定的任务计费记录。同Key与同幂等键重放不会重复预扣。",
                      "properties": {
                        "amount": {
                          "type": "string",
                          "pattern": "^-?(?:0|[1-9][0-9]*)\\.[0-9]{3}$",
                          "description": "十进制字符串，精度0.001⚡；不要使用浮点数计算金额。",
                          "examples": [
                            "1.250"
                          ]
                        },
                        "unit": {
                          "const": "⚡"
                        },
                        "status": {
                          "enum": [
                            "reserved",
                            "review",
                            "settled",
                            "refunded"
                          ]
                        },
                        "price_version": {
                          "type": "integer"
                        }
                      }
                    },
                    "error": {
                      "type": [
                        "object",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "请求失败，查看error.code与error.message",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "请求失败，查看error.code与error.message",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "请求失败，查看error.code与error.message",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "请求失败，查看error.code与error.message",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "410": {
            "description": "请求失败，查看error.code与error.message",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "请求失败，查看error.code与error.message",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "请求失败，查看error.code与error.message",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/videos/{id}": {
      "get": {
        "summary": "查询同一API Key创建的任务",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "include",
            "schema": {
              "const": "video_url"
            },
            "description": "已完成时请求返回上游成片的 HTTPS 地址。"
          }
        ],
        "responses": {
          "200": {
            "description": "视频任务",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "object",
                    "model",
                    "status"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "object": {
                      "const": "video"
                    },
                    "model": {
                      "type": "string",
                      "enum": [
                        "wan-3.0",
                        "seedance-2.5-flash",
                        "minimax-h3"
                      ]
                    },
                    "status": {
                      "enum": [
                        "queued",
                        "in_progress",
                        "completed",
                        "failed",
                        "requires_attention",
                        "cancelled"
                      ]
                    },
                    "parameters": {
                      "type": "object"
                    },
                    "content_url": {
                      "type": "string"
                    },
                    "video_url": {
                      "type": "string",
                      "format": "uri",
                      "description": "已完成任务的上游成片 HTTPS 地址，仅当查询带 include=video_url 且原地址可返回时提供。"
                    },
                    "billing": {
                      "type": "object",
                      "required": [
                        "amount",
                        "unit",
                        "status",
                        "price_version"
                      ],
                      "description": "受理时锁定的任务计费记录。同Key与同幂等键重放不会重复预扣。",
                      "properties": {
                        "amount": {
                          "type": "string",
                          "pattern": "^-?(?:0|[1-9][0-9]*)\\.[0-9]{3}$",
                          "description": "十进制字符串，精度0.001⚡；不要使用浮点数计算金额。",
                          "examples": [
                            "1.250"
                          ]
                        },
                        "unit": {
                          "const": "⚡"
                        },
                        "status": {
                          "enum": [
                            "reserved",
                            "review",
                            "settled",
                            "refunded"
                          ]
                        },
                        "price_version": {
                          "type": "integer"
                        }
                      }
                    },
                    "error": {
                      "type": [
                        "object",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "请求失败，查看error.code与error.message",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "请求失败，查看error.code与error.message",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "请求失败，查看error.code与error.message",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/videos/status-batch": {
      "post": {
        "summary": "批量查询当前 API Key 的视频任务",
        "description": "仅读取已有任务的状态。按请求顺序返回当前 Key 可见的任务。",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "ids"
                ],
                "additionalProperties": false,
                "properties": {
                  "ids": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 1000,
                    "uniqueItems": true,
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "include": {
                    "const": "video_url"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "当前 Key 可见的任务状态",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "object",
                          "model",
                          "status"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "object": {
                            "const": "video"
                          },
                          "model": {
                            "type": "string",
                            "enum": [
                              "wan-3.0",
                              "seedance-2.5-flash",
                              "minimax-h3"
                            ]
                          },
                          "status": {
                            "enum": [
                              "queued",
                              "in_progress",
                              "completed",
                              "failed",
                              "requires_attention",
                              "cancelled"
                            ]
                          },
                          "parameters": {
                            "type": "object"
                          },
                          "content_url": {
                            "type": "string"
                          },
                          "video_url": {
                            "type": "string",
                            "format": "uri",
                            "description": "已完成任务的上游成片 HTTPS 地址，仅当查询带 include=video_url 且原地址可返回时提供。"
                          },
                          "billing": {
                            "type": "object",
                            "required": [
                              "amount",
                              "unit",
                              "status",
                              "price_version"
                            ],
                            "description": "受理时锁定的任务计费记录。同Key与同幂等键重放不会重复预扣。",
                            "properties": {
                              "amount": {
                                "type": "string",
                                "pattern": "^-?(?:0|[1-9][0-9]*)\\.[0-9]{3}$",
                                "description": "十进制字符串，精度0.001⚡；不要使用浮点数计算金额。",
                                "examples": [
                                  "1.250"
                                ]
                              },
                              "unit": {
                                "const": "⚡"
                              },
                              "status": {
                                "enum": [
                                  "reserved",
                                  "review",
                                  "settled",
                                  "refunded"
                                ]
                              },
                              "price_version": {
                                "type": "integer"
                              }
                            }
                          },
                          "error": {
                            "type": [
                              "object",
                              "null"
                            ]
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "请求失败，查看error.code与error.message",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "请求失败，查看error.code与error.message",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "请求失败，查看error.code与error.message",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/videos/{id}/content": {
      "get": {
        "summary": "下载已完成视频，需同一API Key",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "视频文件",
            "content": {
              "video/mp4": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "请求失败，查看error.code与error.message",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "请求失败，查看error.code与error.message",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "请求失败，查看error.code与error.message",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "请求失败，查看error.code与error.message",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "请求失败，查看error.code与error.message",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
