Runway Tasks API

Poll and cancel asynchronous generation tasks.

OpenAPI Specification

runwayml-tasks-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Runway Character Performance Tasks API
  description: 'The Runway (RunwayML) developer API for generative AI media. All generation is asynchronous: a POST to a generation endpoint creates a task and returns a task id, which the client polls on GET /tasks/{id} until the task reaches SUCCEEDED or FAILED. Every request must include an Authorization Bearer API secret and a dated X-Runway-Version header (for example 2024-11-06). Usage is billed in credits (roughly $0.01 per credit) against a developer organization. This description was authored by API Evangelist from Runway''s public documentation and is not an official Runway artifact; verify shapes against docs.dev.runwayml.com.'
  version: '2024-11-06'
  contact:
    name: Runway
    url: https://docs.dev.runwayml.com
servers:
- url: https://api.dev.runwayml.com/v1
  description: Runway developer API
security:
- bearerAuth: []
tags:
- name: Tasks
  description: Poll and cancel asynchronous generation tasks.
paths:
  /tasks/{id}:
    get:
      operationId: getTask
      tags:
      - Tasks
      summary: Get task detail
      description: Retrieve the status and output of a generation task. Do not poll more often than once every five seconds per task.
      parameters:
      - name: id
        in: path
        required: true
        description: The task id returned by a generation endpoint.
        schema:
          type: string
      responses:
        '200':
          description: The task detail.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Task'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: Task not found.
    delete:
      operationId: cancelTask
      tags:
      - Tasks
      summary: Cancel or delete a task
      description: Cancel a running task or delete a completed task's record.
      parameters:
      - name: id
        in: path
        required: true
        description: The task id.
        schema:
          type: string
      responses:
        '204':
          description: The task was cancelled / deleted.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: Task not found.
components:
  schemas:
    Task:
      type: object
      properties:
        id:
          type: string
        status:
          type: string
          enum:
          - PENDING
          - RUNNING
          - SUCCEEDED
          - FAILED
          - CANCELLED
        createdAt:
          type: string
          format: date-time
        progress:
          type: number
          description: Completion fraction between 0 and 1 while RUNNING.
        output:
          type: array
          description: Output asset URLs when SUCCEEDED.
          items:
            type: string
        failure:
          type: string
          description: Failure reason when FAILED.
        failureCode:
          type: string
  responses:
    Unauthorized:
      description: Missing or invalid API secret.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API secret created in the Runway developer portal (dev.runwayml.com), passed as Authorization Bearer YOUR_API_SECRET. Requests must also send a dated X-Runway-Version header.