{
  "openapi": "3.1.0",
  "info": {
    "title": "视频 API 文档",
    "version": "1.3.0",
    "description": "本站公开接口。GET /v1/models 仅返回模型广场当前展示且当前 API Key 有权限调用的公开 ID。视频、文本、图片按分类独立说明。使用本站域名和本站 Key。"
  },
  "servers": [
    {
      "url": "https://www.v6k.top",
      "description": "本站域名，不含 /v1；下列 paths 已包含 /v1。自部署时替换域名。"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Video",
      "description": "视频提交、查询和二进制下载"
    },
    {
      "name": "Models",
      "description": "模型广场公开模型 ID"
    },
    {
      "name": "Media",
      "description": "临时参考素材上传"
    }
  ],
  "paths": {
    "/v1/models": {
      "get": {
        "tags": ["Models"],
        "operationId": "listModels",
        "summary": "查询当前令牌可用模型",
        "responses": {
          "200": {
            "description": "模型列表",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "object": {
                            "type": "string"
                          },
                          "owned_by": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "参数错误、配置问题、额度不足或任务未完成",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "密钥无效",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "请求错误，检查HTTP状态与错误体",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "无权限",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "任务或路由不存在",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "请求错误，检查HTTP状态与错误体",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "请求限流",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "请求错误，检查HTTP状态与错误体",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "服务暂不可用",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "服务繁忙",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "请求超时",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/videos": {
      "post": {
        "tags": ["Video"],
        "operationId": "createVideo",
        "summary": "创建视频任务",
        "description": "本站所有用户共用的 OpenAI 兼容视频入口。当前在线视频适配器共用客户端输入解析，接受 JSON、URL 编码表单和 multipart；素材类型、首帧能力、时长、分辨率和数量受所选模型限制。URL 必须无需登录即可直接访问。成功受理返回非空 id；超时或结果不明确时先查询任务，避免重复生成。 参考视频通过 videos 或兼容字段 video_refs/reference_videos 提交实际地址。后台摘要中的 video_refs_count、image_refs_count、audio_refs_count 不是完整请求体。支持数量提示的模型仅在其与实际素材数量一致时接受，不能只提交数量替代素材。支持三种用途的模型可使用 omni_reference_task_type；不要根据名称推断模型能力。 支持参考音频的模型可在 audios 中提交 MP3（audio/mpeg）公网直链；本地 MP3 先通过 POST /v1/media 上传，再使用返回的 url。本站上传素材保留 24 小时，大小、时长和数量仍须符合所选模型限制。 本地图片、视频、音频均可先通过 POST /v1/media 上传，再将每次返回的 url 分别放入 images、videos、audios，仅发送模型支持的素材类型。ratio/aspect_ratio 是宽高比（如 9:16）；resolution 是分辨率标记（如 720p）；size 是像素尺寸（如 720x1280），不能混填。所有参数范围以模型广场为准，示例秒数不是固定限制。",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VideoRequest"
              },
              "examples": {
                "unified": {
                  "summary": "本站统一视频格式；ID 和时长以模型广场为准",
                  "value": {
                    "model": "YOUR_VIDEO_MODEL_ID",
                    "prompt": "A cat in a garden",
                    "seconds": 30,
                    "ratio": "16:9",
                    "images": []
                  }
                },
                "compatible": {
                  "summary": "OpenAI 兼容格式；仅用于支持 size 的模型",
                  "value": {
                    "model": "YOUR_VIDEO_MODEL_ID",
                    "prompt": "A cat in a garden",
                    "seconds": "30",
                    "size": "1280x720"
                  }
                },
                "aspect_ratio": {
                  "summary": "aspect_ratio 等价示例；与 ratio 使用相同参数规则",
                  "value": {
                    "model": "YOUR_VIDEO_MODEL_ID",
                    "prompt": "A cat in a garden",
                    "seconds": 30,
                    "images": [],
                    "aspect_ratio": "16:9"
                  }
                },
                "referenceVideo": {
                  "summary": "参考图片和视频",
                  "value": {
                    "model": "YOUR_VIDEO_MODEL_ID",
                    "prompt": "参考图片1的人物和视频1的动作，生成花园镜头。",
                    "seconds": 5,
                    "ratio": "9:16",
                    "resolution": "480p",
                    "omni_reference_task_type": "reference",
                    "images": ["https://example.com/person.jpg"],
                    "videos": ["https://example.com/motion.mp4"]
                  }
                },
                "editVideo": {
                  "summary": "视频编辑（仅限支持的模型）",
                  "value": {
                    "model": "YOUR_VIDEO_MODEL_ID",
                    "prompt": "替换视频1中的人物并保留动作。",
                    "seconds": -1,
                    "omni_reference_task_type": "edit",
                    "videos": ["https://example.com/source.mp4"]
                  }
                },
                "referenceAudio": {
                  "summary": "MP3 参考音频；仅限支持参考音频的模型",
                  "value": {
                    "model": "YOUR_VIDEO_MODEL_ID",
                    "prompt": "参考音频1的节奏，生成与音乐氛围匹配的新视频。",
                    "seconds": 5,
                    "audios": ["https://example.com/reference.mp3"]
                  }
                },
                "portraitParameters": {
                  "summary": "竖屏参数示例：仅供支持对应参数的模型使用",
                  "value": {
                    "model": "YOUR_VIDEO_MODEL_ID",
                    "prompt": "竖屏画面，镜头缓慢推进。",
                    "seconds": 5,
                    "ratio": "9:16",
                    "resolution": "720p"
                  }
                },
                "uploadedReferences": {
                  "summary": "使用上传返回的素材 URL：仅保留所选模型支持的素材类型",
                  "value": {
                    "model": "YOUR_VIDEO_MODEL_ID",
                    "prompt": "参考图片1的人物、视频1的动作和音频1的节奏，生成新视频。",
                    "seconds": 5,
                    "ratio": "9:16",
                    "resolution": "720p",
                    "images": [
                      "https://www.v6k.top/v1/media/0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef.png"
                    ],
                    "videos": [
                      "https://www.v6k.top/v1/media/0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef.mp4"
                    ],
                    "audios": [
                      "https://www.v6k.top/v1/media/0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef.mp3"
                    ]
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": ["model", "prompt"],
                "properties": {
                  "model": {
                    "type": "string"
                  },
                  "prompt": {
                    "type": "string"
                  },
                  "seconds": {
                    "type": "integer",
                    "description": "视频时长，单位为整数秒，例如 5。这只是示例，不是固定时长；范围、可选档位和默认值均以所选模型为准。只有明确支持自动时长或编辑用途的模型才可以传 -1。"
                  },
                  "ratio": {
                    "type": "string",
                    "description": "画面宽高比，格式为 宽:高。常见比例有 16:9（横屏）、9:16（竖屏）、1:1（方形）、4:3、3:4、21:9、9:21、3:2、2:3。ratio 与 aspect_ratio 二选一，具体可用比例以所选模型为准。 auto/adaptive 仅限明确支持的模型；不可相互替换。像素尺寸请用 size，不要写入比例字段。",
                    "examples": [
                      "16:9",
                      "9:16",
                      "1:1",
                      "4:3",
                      "3:4",
                      "21:9",
                      "9:21",
                      "3:2",
                      "2:3"
                    ]
                  },
                  "resolution": {
                    "type": "string",
                    "description": "分辨率标记例如 480p、720p、768p、1080p，各模型支持范围不同。固定分辨率模型可能不接受此字段，不能一律发送。",
                    "examples": ["480p", "720p", "768p", "1080p"]
                  },
                  "image": {
                    "type": "string",
                    "format": "binary"
                  },
                  "video": {
                    "type": "string",
                    "format": "binary"
                  },
                  "audio": {
                    "type": "string",
                    "format": "binary",
                    "description": "参考音频文件，可使用 MP3（audio/mpeg）；仅在所选模型支持参考音频和对应上传方式时使用。"
                  },
                  "input_reference": {
                    "type": "string",
                    "format": "binary",
                    "description": "单张输入图片；模型须支持对应方式。"
                  },
                  "images": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "binary"
                    },
                    "description": "重复图片上传；也可用文本字段提交 URL 数组，以模型支持为准。"
                  },
                  "size": {
                    "type": "string",
                    "description": "像素尺寸使用小写 x，例如 1280x720（横屏）或 720x1280（竖屏），不是比例。仅在模型支持时发送 size；不要把 720p 填进 size，也不要把 720x1280 填进 ratio/aspect_ratio。",
                    "examples": ["1280x720", "720x1280"]
                  },
                  "aspect_ratio": {
                    "type": "string",
                    "description": "画面宽高比，格式为 宽:高。常见比例有 16:9（横屏）、9:16（竖屏）、1:1（方形）、4:3、3:4、21:9、9:21、3:2、2:3。ratio 与 aspect_ratio 二选一，具体可用比例以所选模型为准。 auto/adaptive 仅限明确支持的模型；不可相互替换。像素尺寸请用 size，不要写入比例字段。",
                    "examples": [
                      "16:9",
                      "9:16",
                      "1:1",
                      "4:3",
                      "3:4",
                      "21:9",
                      "9:21",
                      "3:2",
                      "2:3"
                    ]
                  }
                },
                "description": "仅在所选模型支持上传时使用；由客户端生成 Content-Type 和 boundary。"
              },
              "description": "仅在模型支持时上传参考素材；支持的字段、素材类型、数量和大小以模型广场当前说明为准。Content-Type 与 boundary 由客户端自动生成。"
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/VideoRequest"
              },
              "description": "标量按字段提交；素材数组可使用重复字段、images[] 等字段名或 JSON 数组字符串。标量不能重复。"
            }
          }
        },
        "responses": {
          "200": {
            "description": "任务已受理，不代表已完成",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Video"
                },
                "example": {
                  "id": "task_example",
                  "object": "video",
                  "model": "YOUR_VIDEO_MODEL_ID",
                  "status": "queued",
                  "progress": 0,
                  "created_at": 1790467200
                }
              }
            }
          },
          "400": {
            "description": "参数错误、配置问题、额度不足或任务未完成",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "密钥无效",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "请求错误，检查HTTP状态与错误体",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "无权限",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "任务或路由不存在",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "请求错误，检查HTTP状态与错误体",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "请求限流",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "请求错误，检查HTTP状态与错误体",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "服务暂不可用",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "服务繁忙",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "请求超时",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/videos/{id}": {
      "get": {
        "tags": ["Video"],
        "operationId": "retrieveVideo",
        "summary": "查询当前账户的视频任务",
        "description": "使用创建响应的本站id。建议每20秒查询，限流或暂时错误时退避。HTTP200也可能status=failed，必须检查status。",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "创建接口返回的本站任务 ID"
          }
        ],
        "responses": {
          "200": {
            "description": "任务状态",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Video"
                },
                "example": {
                  "id": "task_example",
                  "object": "video",
                  "model": "YOUR_VIDEO_MODEL_ID",
                  "status": "completed",
                  "progress": 100,
                  "created_at": 1790467200,
                  "completed_at": 1790467800
                }
              }
            }
          },
          "400": {
            "description": "参数错误、配置问题、额度不足或任务未完成",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "密钥无效",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "请求错误，检查HTTP状态与错误体",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "无权限",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "任务或路由不存在",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "请求错误，检查HTTP状态与错误体",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "请求限流",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "请求错误，检查HTTP状态与错误体",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "服务暂不可用",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "服务繁忙",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "请求超时",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/videos/{id}/content": {
      "get": {
        "tags": ["Video"],
        "operationId": "downloadVideo",
        "summary": "下载已完成的视频",
        "description": "任务 completed 后返回视频二进制。支持的 Range 分段请求返回 206 和 Content-Range。结果不可用时返回本站错误。",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "创建接口返回的本站任务 ID"
          },
          {
            "name": "Range",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "example": "bytes=0-1023",
            "description": "可选的字节范围；最终支持情况取决于媒体服务"
          }
        ],
        "responses": {
          "200": {
            "description": "视频二进制",
            "content": {
              "video/mp4": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "206": {
            "description": "部分视频内容，参见 Content-Range"
          },
          "304": {
            "description": "条件请求内容未修改"
          },
          "400": {
            "description": "参数错误、配置问题、额度不足或任务未完成",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "密钥无效",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "请求错误，检查HTTP状态与错误体",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "无权限",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "任务或路由不存在",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "请求错误，检查HTTP状态与错误体",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "视频地址已不可用且无法刷新",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "416": {
            "description": "字节范围不满足"
          },
          "429": {
            "description": "请求限流",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "请求错误，检查HTTP状态与错误体",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "服务暂不可用",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "服务繁忙",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "请求超时",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "head": {
        "tags": ["Video"],
        "operationId": "headVideo",
        "summary": "查询视频响应头",
        "description": "任务 completed 后返回视频二进制。支持的 Range 分段请求返回 206 和 Content-Range。结果不可用时返回本站错误。",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "创建接口返回的本站任务 ID"
          },
          {
            "name": "Range",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "example": "bytes=0-1023",
            "description": "可选的字节范围；最终支持情况取决于媒体服务"
          }
        ],
        "responses": {
          "200": {
            "description": "视频响应头",
            "content": {
              "video/mp4": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "206": {
            "description": "部分视频内容，参见 Content-Range"
          },
          "304": {
            "description": "条件请求内容未修改"
          },
          "400": {
            "description": "参数错误、配置问题、额度不足或任务未完成",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "密钥无效",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "请求错误，检查HTTP状态与错误体",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "无权限",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "任务或路由不存在",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "请求错误，检查HTTP状态与错误体",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "视频地址已不可用且无法刷新",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "416": {
            "description": "字节范围不满足"
          },
          "429": {
            "description": "请求限流",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "请求错误，检查HTTP状态与错误体",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "服务暂不可用",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "服务繁忙",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "请求超时",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/media": {
      "post": {
        "tags": ["Media"],
        "operationId": "uploadReferenceMedia",
        "summary": "上传参考图片、视频、音频",
        "description": "本地素材先上传：使用本站 API Key，向 POST /v1/media 发送 multipart/form-data，文件字段名为 file，每次上传一个原始文件。Content-Type 和 boundary 由客户端自动生成。上传素材不等于创建视频任务。 上传服务可识别 PNG/JPEG/WebP/GIF 图片、MP4/WebM 视频和 MP3/M4A/AAC/FLAC/OGG/WAV 音频。上传成功不代表模型支持所有格式；素材数量、文件大小、时长、费用仍须符合所选模型与本站上传限制。 读取每次上传返回的顶层 url，不是 data.url。expires_at 是 Unix 秒级到期时间，素材上传后保留 24 小时，请在过期前使用。返回的素材直链无需附加 API Key 即可读取，只向生成流程提供需要使用的链接。 随后向 POST /v1/videos 提交 JSON：图片 url 放 images，视频 url 放 videos，音频 url 放 audios；只保留模型支持的素材类型。只有一个文件也要用数组。已有公开素材直链可直接使用，无需重复上传；本地路径、需要浏览器登录的链接和网页分享页都不能代替素材直链。",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": ["file"],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "单个原始文件，例如 reference.png、reference.mp4、reference.mp3；不要上传 ZIP。实际签名须与格式相符。上传大小以上传服务配置为准，生成仍须符合所选模型限制。"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "上传成功；不代表视频任务已创建",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["url", "expires_at"],
                  "properties": {
                    "url": {
                      "type": "string",
                      "format": "uri",
                      "description": "临时公开素材直链，无需额外 API Key。按素材类型放入视频请求的 images、videos 或 audios 数组。返回在顶层，不是 data.url。"
                    },
                    "expires_at": {
                      "type": "integer",
                      "format": "int64",
                      "description": "上传后 24 小时的过期时间，Unix 秒级时间戳。"
                    }
                  }
                },
                "examples": {
                  "image": {
                    "summary": "图片上传成功；此时尚未创建生成任务",
                    "value": {
                      "url": "https://www.v6k.top/v1/media/0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef.png",
                      "expires_at": 1794578400
                    }
                  },
                  "video": {
                    "summary": "视频上传成功；此时尚未创建生成任务",
                    "value": {
                      "url": "https://www.v6k.top/v1/media/0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef.mp4",
                      "expires_at": 1794578400
                    }
                  },
                  "audio": {
                    "summary": "音频上传成功；此时尚未创建生成任务",
                    "value": {
                      "url": "https://www.v6k.top/v1/media/0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef.mp3",
                      "expires_at": 1794578400
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "素材为空、超出站点上限或真实格式不支持",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "密钥无效",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "创建素材地址或保存文件失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "素材存储盘暂不可用",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "填写本站签发的 API 令牌"
      }
    },
    "schemas": {
      "VideoRequest": {
        "type": "object",
        "required": ["model", "prompt"],
        "properties": {
          "model": {
            "type": "string",
            "minLength": 1,
            "description": "原样填写 GET /v1/models 返回的本站公开模型 ID。"
          },
          "prompt": {
            "type": "string",
            "minLength": 1,
            "description": "非空视频描述；参考素材标记由所选模型决定，不支持的模型请勿使用 @图1 等专用标记。"
          },
          "seconds": {
            "oneOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 3600
              },
              {
                "type": "string",
                "pattern": "^[1-9][0-9]{0,3}$"
              },
              {
                "type": "integer",
                "const": -1
              },
              {
                "type": "string",
                "const": "-1"
              }
            ],
            "description": "视频时长，单位为整数秒，例如 5。这只是示例，不是固定时长；范围、可选档位和默认值均以所选模型为准。只有明确支持自动时长或编辑用途的模型才可以传 -1。"
          },
          "ratio": {
            "type": "string",
            "description": "画面宽高比，格式为 宽:高。常见比例有 16:9（横屏）、9:16（竖屏）、1:1（方形）、4:3、3:4、21:9、9:21、3:2、2:3。ratio 与 aspect_ratio 二选一，具体可用比例以所选模型为准。 auto/adaptive 仅限明确支持的模型；不可相互替换。像素尺寸请用 size，不要写入比例字段。",
            "examples": [
              "16:9",
              "9:16",
              "1:1",
              "4:3",
              "3:4",
              "21:9",
              "9:21",
              "3:2",
              "2:3"
            ]
          },
          "images": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "type": "string"
                },
                {
                  "type": "object",
                  "required": ["url"],
                  "properties": {
                    "url": {
                      "type": "string"
                    },
                    "duration_seconds": {
                      "type": "number",
                      "exclusiveMinimum": 0,
                      "maximum": 3600
                    }
                  }
                }
              ]
            },
            "description": "参考图片 URL 数组。可先将本地原始文件逐个上传至 POST /v1/media，读取每次返回的顶层 url 后填入此数组；已有公开素材直链也可使用。只有一个素材也使用数组。格式、数量、时长、大小及费用以所选模型为准；上传成功不等于模型支持。保留签名参数，不要填本地路径或网页分享链接。"
          },
          "resolution": {
            "type": "string",
            "description": "分辨率标记例如 480p、720p、768p、1080p，各模型支持范围不同。固定分辨率模型可能不接受此字段，不能一律发送。",
            "examples": ["480p", "720p", "768p", "1080p"]
          },
          "videos": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "type": "string"
                },
                {
                  "type": "object",
                  "required": ["url"],
                  "properties": {
                    "url": {
                      "type": "string"
                    },
                    "duration_seconds": {
                      "type": "number",
                      "exclusiveMinimum": 0,
                      "maximum": 3600
                    }
                  }
                }
              ]
            },
            "description": "参考视频 URL 数组。可先将本地原始文件逐个上传至 POST /v1/media，读取每次返回的顶层 url 后填入此数组；已有公开素材直链也可使用。只有一个素材也使用数组。格式、数量、时长、大小及费用以所选模型为准；上传成功不等于模型支持。保留签名参数，不要填本地路径或网页分享链接。"
          },
          "audios": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "type": "string"
                },
                {
                  "type": "object",
                  "required": ["url"],
                  "properties": {
                    "url": {
                      "type": "string"
                    },
                    "duration_seconds": {
                      "type": "number",
                      "exclusiveMinimum": 0,
                      "maximum": 3600
                    }
                  }
                }
              ]
            },
            "description": "参考音频 URL 数组。可先将本地原始文件逐个上传至 POST /v1/media，读取每次返回的顶层 url 后填入此数组；已有公开素材直链也可使用。只有一个素材也使用数组。格式、数量、时长、大小及费用以所选模型为准；上传成功不等于模型支持。保留签名参数，不要填本地路径或网页分享链接。"
          },
          "metadata": {
            "type": "object",
            "description": "仅在所选模型的接入示例要求时使用，不要覆盖模型和计费时长。"
          },
          "size": {
            "type": "string",
            "description": "像素尺寸使用小写 x，例如 1280x720（横屏）或 720x1280（竖屏），不是比例。仅在模型支持时发送 size；不要把 720p 填进 size，也不要把 720x1280 填进 ratio/aspect_ratio。",
            "examples": ["1280x720", "720x1280"]
          },
          "input_reference": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string"
                  },
                  "image_url": {
                    "oneOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "url": {
                            "type": "string"
                          }
                        }
                      }
                    ]
                  }
                }
              },
              {
                "type": "array",
                "maxItems": 1,
                "items": {
                  "oneOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "url": {
                          "type": "string"
                        },
                        "image_url": {
                          "oneOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "object",
                              "properties": {
                                "url": {
                                  "type": "string"
                                }
                              }
                            }
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            ],
            "description": "单张输入图/首帧 URL 或 URL 对象；multipart 可上传文件。它与 images 参考图保持独立，模型没有首帧能力时不会自动改成其他生成方式。多图请用 images。部分模型按其已有输入图契约映射为参考图。"
          },
          "aspect_ratio": {
            "type": "string",
            "description": "画面宽高比，格式为 宽:高。常见比例有 16:9（横屏）、9:16（竖屏）、1:1（方形）、4:3、3:4、21:9、9:21、3:2、2:3。ratio 与 aspect_ratio 二选一，具体可用比例以所选模型为准。 auto/adaptive 仅限明确支持的模型；不可相互替换。像素尺寸请用 size，不要写入比例字段。",
            "examples": [
              "16:9",
              "9:16",
              "1:1",
              "4:3",
              "3:4",
              "21:9",
              "9:21",
              "3:2",
              "2:3"
            ]
          },
          "duration": {
            "oneOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 3600
              },
              {
                "type": "string",
                "pattern": "^[1-9][0-9]{0,3}$"
              },
              {
                "type": "integer",
                "const": -1
              },
              {
                "type": "string",
                "const": "-1"
              }
            ],
            "description": "seconds 的等价写法；同时填写时必须数值相同，实际时长须符合模型限制。 -1 仅用于明确支持智能时长的模型；视频编辑使用 edit、-1 和恰好一段参考视频，其他模型不可使用。"
          },
          "duration_seconds": {
            "oneOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 3600
              },
              {
                "type": "string",
                "pattern": "^[1-9][0-9]{0,3}$"
              },
              {
                "type": "integer",
                "const": -1
              },
              {
                "type": "string",
                "const": "-1"
              }
            ],
            "description": "seconds 的等价写法；同时填写时必须数值相同，实际时长须符合模型限制。 -1 仅用于明确支持智能时长的模型；视频编辑使用 edit、-1 和恰好一段参考视频，其他模型不可使用。"
          },
          "durationSeconds": {
            "oneOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 3600
              },
              {
                "type": "string",
                "pattern": "^[1-9][0-9]{0,3}$"
              },
              {
                "type": "integer",
                "const": -1
              },
              {
                "type": "string",
                "const": "-1"
              }
            ],
            "description": "seconds 的等价写法；同时填写时必须数值相同，实际时长须符合模型限制。 -1 仅用于明确支持智能时长的模型；视频编辑使用 edit、-1 和恰好一段参考视频，其他模型不可使用。"
          },
          "video_duration": {
            "oneOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 3600
              },
              {
                "type": "string",
                "pattern": "^[1-9][0-9]{0,3}$"
              },
              {
                "type": "integer",
                "const": -1
              },
              {
                "type": "string",
                "const": "-1"
              }
            ],
            "description": "seconds 的等价写法；同时填写时必须数值相同，实际时长须符合模型限制。 -1 仅用于明确支持智能时长的模型；视频编辑使用 edit、-1 和恰好一段参考视频，其他模型不可使用。"
          },
          "reference_image_urls": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "type": "string"
                },
                {
                  "type": "object",
                  "required": ["url"],
                  "properties": {
                    "url": {
                      "type": "string"
                    },
                    "duration_seconds": {
                      "type": "number",
                      "exclusiveMinimum": 0,
                      "maximum": 3600
                    }
                  }
                }
              ]
            },
            "description": "images 的等价素材列表写法。URL 字符串和 URL 对象由公共入口解析；多个同类字段须内容相同。"
          },
          "reference_video_urls": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "type": "string"
                },
                {
                  "type": "object",
                  "required": ["url"],
                  "properties": {
                    "url": {
                      "type": "string"
                    },
                    "duration_seconds": {
                      "type": "number",
                      "exclusiveMinimum": 0,
                      "maximum": 3600
                    }
                  }
                }
              ]
            },
            "description": "videos 的等价素材列表写法。URL 字符串和 URL 对象由公共入口解析；多个同类字段须内容相同。"
          },
          "reference_audio_urls": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "type": "string"
                },
                {
                  "type": "object",
                  "required": ["url"],
                  "properties": {
                    "url": {
                      "type": "string"
                    },
                    "duration_seconds": {
                      "type": "number",
                      "exclusiveMinimum": 0,
                      "maximum": 3600
                    }
                  }
                }
              ]
            },
            "description": "audios 的等价素材列表写法。URL 字符串和 URL 对象由公共入口解析；多个同类字段须内容相同。"
          },
          "image_refs": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "type": "string"
                },
                {
                  "type": "object",
                  "required": ["url"],
                  "properties": {
                    "url": {
                      "type": "string"
                    },
                    "duration_seconds": {
                      "type": "number",
                      "exclusiveMinimum": 0,
                      "maximum": 3600
                    }
                  }
                }
              ]
            },
            "description": "images 的兼容别名，提交实际素材 URL 列表，不能用数量代替。仅限所选模型支持的素材类型。"
          },
          "reference_images": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "type": "string"
                },
                {
                  "type": "object",
                  "required": ["url"],
                  "properties": {
                    "url": {
                      "type": "string"
                    },
                    "duration_seconds": {
                      "type": "number",
                      "exclusiveMinimum": 0,
                      "maximum": 3600
                    }
                  }
                }
              ]
            },
            "description": "images 的兼容别名，提交实际素材 URL 列表，不能用数量代替。仅限所选模型支持的素材类型。"
          },
          "video_refs": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "type": "string"
                },
                {
                  "type": "object",
                  "required": ["url"],
                  "properties": {
                    "url": {
                      "type": "string"
                    },
                    "duration_seconds": {
                      "type": "number",
                      "exclusiveMinimum": 0,
                      "maximum": 3600
                    }
                  }
                }
              ]
            },
            "description": "videos 的兼容别名，提交实际素材 URL 列表，不能用数量代替。仅限所选模型支持的素材类型。"
          },
          "reference_videos": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "type": "string"
                },
                {
                  "type": "object",
                  "required": ["url"],
                  "properties": {
                    "url": {
                      "type": "string"
                    },
                    "duration_seconds": {
                      "type": "number",
                      "exclusiveMinimum": 0,
                      "maximum": 3600
                    }
                  }
                }
              ]
            },
            "description": "videos 的兼容别名，提交实际素材 URL 列表，不能用数量代替。仅限所选模型支持的素材类型。"
          },
          "audio_refs": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "type": "string"
                },
                {
                  "type": "object",
                  "required": ["url"],
                  "properties": {
                    "url": {
                      "type": "string"
                    },
                    "duration_seconds": {
                      "type": "number",
                      "exclusiveMinimum": 0,
                      "maximum": 3600
                    }
                  }
                }
              ]
            },
            "description": "audios 的兼容别名，提交实际素材 URL 列表，不能用数量代替。仅限所选模型支持的素材类型。"
          },
          "reference_audios": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "type": "string"
                },
                {
                  "type": "object",
                  "required": ["url"],
                  "properties": {
                    "url": {
                      "type": "string"
                    },
                    "duration_seconds": {
                      "type": "number",
                      "exclusiveMinimum": 0,
                      "maximum": 3600
                    }
                  }
                }
              ]
            },
            "description": "audios 的兼容别名，提交实际素材 URL 列表，不能用数量代替。仅限所选模型支持的素材类型。"
          },
          "omni_reference_task_type": {
            "type": "string",
            "enum": ["reference", "edit", "extend"],
            "description": "仅限明确支持这些用途的模型。reference 参考生成（默认）；edit 视频编辑，恰好 1 段参考视频且 duration/seconds 为 -1；extend 视频延长，恰好 1 段参考视频且时长为正数。不接受 auto。编辑建议不传固定 ratio、aspect_ratio 或 size。"
          }
        }
      },
      "Video": {
        "type": "object",
        "required": [
          "id",
          "object",
          "model",
          "status",
          "progress",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "本站任务 ID，保持字符串，不要转换为数字。"
          },
          "object": {
            "type": "string",
            "const": "video"
          },
          "model": {
            "type": "string",
            "description": "本站公开模型 ID"
          },
          "status": {
            "type": "string",
            "enum": ["queued", "in_progress", "completed", "failed", "unknown"]
          },
          "progress": {
            "type": "number",
            "minimum": 0,
            "maximum": 100
          },
          "created_at": {
            "type": "integer",
            "description": "Unix 秒级时间戳"
          },
          "completed_at": {
            "type": "integer",
            "description": "仅成功时返回"
          },
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            }
          },
          "url": {
            "type": "string",
            "description": "可选的本站成品地址。也可使用固定的 /v1/videos/{id}/content 下载。"
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              },
              "type": {
                "type": "string"
              },
              "code": {
                "type": ["string", "null"]
              }
            }
          },
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "data": {
            "description": "兼容旧版任务错误响应的可选数据"
          }
        },
        "description": "本站统一错误，不包含服务商地址、服务商模型 ID 或密钥"
      }
    }
  }
}
