{
  "openapi": "3.1.0",
  "info": {
    "title": "Upscale a Video API",
    "version": "1.0.0",
    "description": "Create a Runway video-upscale task through the official-format CometAPI route."
  },
  "servers": [
    {
      "url": "https://api.cometapi.com"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/runwayml/v1/video_upscale": {
      "post": {
        "summary": "Create a Runway video-upscale task",
        "operationId": "upscale_a_video",
        "description": "Submit a source video URL and receive a task id for later polling.",
        "parameters": [
          {
            "name": "X-Runway-Version",
            "in": "header",
            "required": true,
            "description": "Runway version header, for example `2024-11-06`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "videoUri",
                  "model"
                ],
                "properties": {
                  "videoUri": {
                    "type": "string",
                    "description": "A HTTPS URL pointing to a video or a data URI containing a video.",
                    "default": "https://your-video-host/source.mp4"
                  },
                  "model": {
                    "type": "string",
                    "description": "The model variant to use. Must be upscale_v1.",
                    "default": "upscale_v1"
                  }
                },
                "default": {
                  "videoUri": "https://your-video-host/source.mp4",
                  "model": "upscale_v1"
                }
              },
              "examples": {
                "Default": {
                  "summary": "Default",
                  "value": {
                    "videoUri": "https://your-video-host/source.mp4",
                    "model": "upscale_v1"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Task accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "Default",
            "source": "curl https://api.cometapi.com/runwayml/v1/video_upscale \\\n  -H \"Authorization: Bearer $COMETAPI_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n      \"videoUri\": \"https://your-video-host/source.mp4\",\n      \"model\": \"upscale_v1\"\n    }'\n"
          },
          {
            "lang": "Python",
            "label": "Default",
            "source": "import os\nimport requests\n\nresponse = requests.post(\n    \"https://api.cometapi.com/runwayml/v1/video_upscale\",\n    headers={\"Authorization\": \"Bearer \" + os.environ[\"COMETAPI_KEY\"]},\n    json={\n            \"videoUri\": \"https://your-video-host/source.mp4\",\n            \"model\": \"upscale_v1\"\n    },\n)\n\ntask = response.json()\nprint(task[\"id\"])  # poll GET /runwayml/v1/tasks/{id} until the output array appears\n"
          },
          {
            "lang": "JavaScript",
            "label": "Default",
            "source": "const response = await fetch(\"https://api.cometapi.com/runwayml/v1/video_upscale\", {\n    method: \"POST\",\n    headers: {\n        Authorization: `Bearer ${process.env.COMETAPI_KEY}`,\n        \"Content-Type\": \"application/json\",\n    },\n    body: JSON.stringify({\n            \"videoUri\": \"https://your-video-host/source.mp4\",\n            \"model\": \"upscale_v1\"\n        }),\n});\n\nconst task = await response.json();\nconsole.log(task.id); // poll GET /runwayml/v1/tasks/{id} until the output array appears\n"
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Bearer token authentication. Use your CometAPI key."
      }
    }
  }
}
