{
  "openapi": "3.1.0",
  "info": {
    "title": "PixVerse 三模型视频API",
    "version": "1.0.0",
    "description": "独立号池接入；Wan3强制休闲；异步单候选；结果不明不自动重发。"
  },
  "servers": [
    {
      "url": "https://pix.youqian666.vip/v1"
    }
  ],
  "security": [
    {
      "ApiKey": []
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "pvk_调用密钥"
      }
    }
  },
  "paths": {
    "/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",
        "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": "创建一个异步视频任务",
        "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": 5000
                      },
                      "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": false
                      },
                      "relax_mode": {
                        "type": "boolean",
                        "const": true,
                        "default": true
                      },
                      "reference_id": {
                        "type": "string",
                        "description": "使用同一API Key上传的图片编号。"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "model",
                      "prompt"
                    ],
                    "properties": {
                      "model": {
                        "type": "string",
                        "const": "seedance-2.5-flash"
                      },
                      "prompt": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 5000
                      },
                      "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，图生必须auto；省略时按输入模式选择。"
                      },
                      "audio": {
                        "type": "boolean",
                        "const": false,
                        "description": "该模型不能通过CLI控制声音，省略或false不代表结果静音。"
                      },
                      "relax_mode": {
                        "type": "boolean",
                        "default": true
                      },
                      "reference_id": {
                        "type": "string",
                        "description": "使用同一API Key上传的图片编号。"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "model",
                      "prompt"
                    ],
                    "properties": {
                      "model": {
                        "type": "string",
                        "const": "minimax-h3"
                      },
                      "prompt": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 5000
                      },
                      "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
                      },
                      "reference_id": {
                        "type": "string",
                        "description": "使用同一API Key上传的图片编号。"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "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"
                    },
                    "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"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "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"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "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"
            }
          }
        ],
        "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"
                    },
                    "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/{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"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
