{
  "openapi": "3.1.0",
  "info": {
    "title": "Feed Get Task API",
    "version": "1.0.0",
    "description": "Poll a Runway compatibility-format task through CometAPI and read the task state."
  },
  "servers": [
    {
      "url": "https://api.cometapi.com"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Bearer token authentication. Use your CometAPI key."
      }
    }
  },
  "paths": {
    "/runway/feed": {
      "post": {
        "summary": "Poll a Runway compatibility-format task",
        "operationId": "feed_get_task",
        "description": "Use the task id returned by a compatibility-format Runway create endpoint. Fresh task ids can briefly return `task_not_exist` before the system begins returning task state.",
        "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": [
                  "task_id"
                ],
                "properties": {
                  "task_id": {
                    "type": "string",
                    "description": "Runway task id returned by the create endpoint."
                  }
                },
                "default": {
                  "task_id": "3d957031-9a2a-45e2-9dc7-bc8513059c50"
                }
              },
              "examples": {
                "Default": {
                  "summary": "Default",
                  "value": {
                    "task_id": "4156043d-9ea5-47c5-9e38-3f8446a0b20d"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Current task state.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "task_id"
                  ],
                  "properties": {
                    "task_id": {
                      "type": "string",
                      "description": "Task ID returned by the create endpoint."
                    },
                    "action": {
                      "type": "string",
                      "description": "Task action."
                    },
                    "status": {
                      "type": "string",
                      "description": "Task status."
                    },
                    "fail_reason": {
                      "type": "string",
                      "description": "Failure reason, when available."
                    },
                    "result_url": {
                      "type": "string",
                      "description": "Result URL, when available."
                    },
                    "submit_time": {
                      "type": "integer",
                      "description": "Task submission timestamp."
                    },
                    "start_time": {
                      "type": "integer",
                      "description": "Task start timestamp."
                    },
                    "finish_time": {
                      "type": "integer",
                      "description": "Task finish timestamp."
                    },
                    "progress": {
                      "type": "string",
                      "description": "Task progress."
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Task metadata."
                    }
                  },
                  "additionalProperties": true,
                  "example": {
                    "task_id": "4156043d-9ea5-47c5-9e38-3f8446a0b20d"
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}