{
  "openapi": "3.1.0",
  "info": {
    "title": "创建视频生成任务",
    "version": "1.0.0",
    "description": "提交视频生成任务，支持文生视频和图生视频。\n\n返回任务 ID，可通过 GET 接口查询任务状态。\n"
  },
  "tags": [
    {
      "name": "视频（Videos）"
    }
  ],
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "使用 Bearer Token 认证。\n格式: `Authorization: Bearer sk-xxxxxx`\n"
      }
    }
  },
  "paths": {
    "/v1/video/generations": {
      "post": {
        "tags": [
          "视频（Videos）"
        ],
        "summary": "创建视频生成任务",
        "description": "提交视频生成任务，支持文生视频和图生视频。\n\n返回任务 ID，可通过 GET 接口查询任务状态。\n",
        "operationId": "createvideogeneration",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "视频生成请求",
                "properties": {
                  "model": {
                    "type": "string",
                    "description": "模型/风格 ID",
                    "examples": [
                      "kling-v1"
                    ]
                  },
                  "prompt": {
                    "type": "string",
                    "description": "文本描述提示词",
                    "examples": [
                      "宇航员站起身走了"
                    ]
                  },
                  "image": {
                    "type": "string",
                    "description": "图片输入 (URL 或 Base64)",
                    "examples": [
                      "https://example.com/image.jpg"
                    ]
                  },
                  "duration": {
                    "type": "number",
                    "description": "视频时长（秒）",
                    "examples": [
                      5
                    ]
                  },
                  "width": {
                    "type": "integer",
                    "description": "视频宽度",
                    "examples": [
                      1280
                    ]
                  },
                  "height": {
                    "type": "integer",
                    "description": "视频高度",
                    "examples": [
                      720
                    ]
                  },
                  "fps": {
                    "type": "integer",
                    "description": "视频帧率",
                    "examples": [
                      30
                    ]
                  },
                  "seed": {
                    "type": "integer",
                    "description": "随机种子",
                    "examples": [
                      20231234
                    ]
                  },
                  "n": {
                    "type": "integer",
                    "description": "生成视频数量",
                    "examples": [
                      1
                    ]
                  },
                  "response_format": {
                    "type": "string",
                    "description": "响应格式",
                    "examples": [
                      "url"
                    ]
                  },
                  "user": {
                    "type": "string",
                    "description": "用户标识",
                    "examples": [
                      "user-1234"
                    ]
                  },
                  "metadata": {
                    "type": "object",
                    "description": "扩展参数 (如 negative_prompt, style, quality_level 等)",
                    "additionalProperties": true,
                    "properties": {},
                    "x-apifox-orders": []
                  }
                },
                "x-apifox-orders": [
                  "model",
                  "prompt",
                  "image",
                  "duration",
                  "width",
                  "height",
                  "fps",
                  "seed",
                  "n",
                  "response_format",
                  "user",
                  "metadata"
                ]
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "成功创建视频生成任务",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "视频生成任务提交响应",
                  "properties": {
                    "task_id": {
                      "type": "string",
                      "description": "任务 ID",
                      "examples": [
                        "abcd1234efgh"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "description": "任务状态",
                      "examples": [
                        "queued"
                      ]
                    }
                  },
                  "x-apifox-orders": [
                    "task_id",
                    "status"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "请求参数错误",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "description": "错误信息"
                        },
                        "type": {
                          "type": "string",
                          "description": "错误类型"
                        },
                        "param": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "相关参数"
                        },
                        "code": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "错误代码"
                        }
                      },
                      "x-apifox-orders": [
                        "message",
                        "type",
                        "param",
                        "code"
                      ]
                    }
                  },
                  "x-apifox-orders": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    }
  },
  "servers": [
    {
      "url": "https://api.xiexus.cn",
      "description": "固定生产地址"
    }
  ]
}
