{
  "openapi": "3.1.0",
  "info": {
    "title": "Video to Video Style Redraw API",
    "version": "1.0.0",
    "description": "Create a Runway compatibility-format video-to-video style-transfer task."
  },
  "servers": [
    {
      "url": "https://api.cometapi.com"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/runway/pro/video2video": {
      "post": {
        "summary": "Video to Video Style Redraw",
        "operationId": "video_to_video_style_redraw",
        "parameters": [
          {
            "name": "X-Runway-Version",
            "in": "header",
            "required": false,
            "description": "Optional Runway version header, for example `2024-11-06`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "callback_url",
                  "video",
                  "model",
                  "prompt",
                  "options"
                ],
                "properties": {
                  "callback_url": {
                    "type": "string",
                    "description": "Webhook URL that receives a POST request with the result when the task completes.",
                    "default": "https://example.com/webhook"
                  },
                  "video": {
                    "type": "string",
                    "description": "URL of the source video to restyle.",
                    "default": "https://your-video-host/source.mp4"
                  },
                  "model": {
                    "type": "string",
                    "description": "Model version to use, e.g. `gen4`.",
                    "default": "gen4"
                  },
                  "prompt": {
                    "type": "string",
                    "description": "Text prompt describing the target style for the redraw.",
                    "default": "Apply a pixel-art redraw style."
                  },
                  "options": {
                    "type": "object",
                    "description": "Additional processing options.",
                    "required": [
                      "seconds",
                      "structure_transformation",
                      "flip"
                    ],
                    "properties": {
                      "seconds": {
                        "type": "integer",
                        "description": "Output duration in seconds. Use 5 or 10 for standard Runway video generations.",
                        "default": 5
                      },
                      "structure_transformation": {
                        "type": "number",
                        "description": "How much of the original video structure to preserve. Range: 0.0 (fully creative) to 1.0 (preserve structure)."
                      },
                      "flip": {
                        "type": "boolean",
                        "description": "Set `true` for landscape output, usually a 1280x720 target; set `false` for portrait output, usually a 720x1280 target."
                      }
                    },
                    "default": {
                      "structure_transformation": 1,
                      "flip": true,
                      "seconds": 5
                    }
                  }
                },
                "default": {
                  "callback_url": "https://example.com/webhook",
                  "video": "https://your-video-host/source.mp4",
                  "model": "gen4",
                  "prompt": "Apply a pixel-art redraw style.",
                  "options": {
                    "structure_transformation": 0.5,
                    "flip": true,
                    "seconds": 5
                  }
                }
              },
              "examples": {
                "Default": {
                  "summary": "Default",
                  "value": {
                    "callback_url": "https://example.com/webhook",
                    "video": "https://your-video-host/source.mp4",
                    "model": "gen4",
                    "prompt": "pixelated style",
                    "options": {
                      "structure_transformation": 0.5,
                      "flip": true,
                      "seconds": 5
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "code",
                    "data"
                  ],
                  "properties": {
                    "code": {
                      "type": "integer",
                      "description": "HTTP status code returned by the task service."
                    },
                    "data": {
                      "type": "object",
                      "required": [
                        "task_id"
                      ],
                      "properties": {
                        "task_id": {
                          "type": "string",
                          "description": "Task ID returned by the create endpoint."
                        }
                      }
                    },
                    "message": {
                      "type": "string",
                      "description": "Empty on success."
                    },
                    "msg": {
                      "type": "string",
                      "description": "Result message."
                    }
                  },
                  "example": {
                    "code": 200,
                    "message": "",
                    "msg": "success",
                    "data": {
                      "task_id": "196642a0-05e1-441a-981e-eb0c1f5d983b"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Bearer token authentication. Use your CometAPI key."
      }
    }
  }
}
