runway-ml

Runway ML API for AI video generation and editing, including Gen-3 Alpha Turbo, image-to-video, and video-to-video capabilities. Suitable for generating videos from text or images, applying AI video effects, or automating creative video production workflows.

Last repository push
GitHub Stars
219
Forks
38
Issues / PRs
1

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "runway-ml" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-5a1f1e3c81afc0e893efe4169953f7e4de0d431d55eb222aa06bc3f605601442. Verify the upstream source and version against https://github.com/TerminalSkills/skills before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

github.com

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Runway ML API for AI video generation and editing, including Gen-3 Alpha Turbo, image-to-video, and video-to-video capabilities. Suitable for generating videos from text or images, applying AI video effects, or automating creative video production workflows.

0 Downloads

Introduction source: third_party · TerminalSkills · 1.0.0 Reference

SkillPi interpretation

Software, accounts and paid services
Base URL: `https://api.dev.runwayml.com/v1` API docs: https://docs.runwayml.com
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: runway-ml
description: >-
  Runway ML API for AI video generation and editing — Gen-3 Alpha Turbo,
  image-to-video, and video-to-video. Use when generating video from text or
  images, applying AI video effects, or automating creative video production
  pipelines.
license: Apache-2.0
compatibility: "Requires Python 3.9+ or Node.js 18+. Runway API key required."
metadata:
  author: terminal-skills
  version: "1.0.0"
  category: data-ai
  tags: ["runway", "video-generation", "gen-3", "text-to-video", "ai-video"]
  use-cases:
    - "Generate cinematic video clips from text descriptions"
    - "Animate a product photo into a dynamic video for ads"
    - "Automate B-roll video generation for content pipelines"
  agents: [claude-code, openai-codex, gemini-cli, cursor]

Runway ML API

Overview

Runway's Gen-3 Alpha Turbo model generates high-quality video from text prompts or images. The REST API follows an async task pattern: create a task, poll for completion, then download the result. Use it to produce cinematic clips, animate images, or build automated video content pipelines.

Setup

pip install requests python-dotenv
export RUNWAY_API_KEY="your_api_key_here"

Base URL: https://api.dev.runwayml.com/v1
API docs: https://docs.runwayml.com

Core Concepts

  • Task: An async video generation job. Returns a task_id immediately.
  • Gen-3 Alpha Turbo: Fastest Gen-3 model — best for production pipelines.
  • image-to-video (gen3a_turbo): Animate a still image into motion.
  • text-to-video: Generate video purely from a text prompt.
  • Duration: 5 or 10 seconds.
  • Ratio: 1280:720 (landscape), 720:1280 (portrait), 1104:832, 832:1104, 960:960 (square).

Instructions

Step 1: Set up the client

import os
import time
import requests

API_KEY = os.environ["RUNWAY_API_KEY"]
BASE_URL = "https://api.dev.runwayml.com/v1"
HEADERS = {
    "Authorization": f"Bearer {API_KEY}",
    "Content-Type": "application/json",
    "X-Runway-Version": "2024-11-06"
}

Step 2: Text-to-video generation

def text_to_video(
    prompt_text: str,
    duration: int = 5,
    ratio: str = "1280:720",
    seed: int = None
) -> str:
    """Submit a text-to-video task and return the task_id."""
    payload = {
        "model": "gen3a_turbo",
        "promptText": prompt_text,
        "duration": duration,
        "ratio": ratio
    }
    if seed is not None:
        payload["seed"] = seed

    r = requests.post(f"{BASE_URL}/image_to_video", json=payload, headers=HEADERS)
    r.raise_for_status()
    return r.json()["id"]

task_id = text_to_video(
    prompt_text="A drone shot flying over a misty mountain valley at golden hour, cinematic, slow motion",
    duration=5,
    ratio="1280:720"
)
print(f"Task submitted: {task_id}")

Step 3: Image-to-video generation

import base64
from pathlib import Path

def image_to_video(
    image_path: str,
    prompt_text: str = "",
    duration: int = 5,
    ratio: str = "1280:720",
    seed: int = None
) -> str:
    """Animate an image into video. image_path can be a local file or URL."""

    if image_path.startswith("http"):
        prompt_image = image_path
    else:
        # Encode local file as data URI
        img_bytes = Path(image_path).read_bytes()
        ext = Path(image_path).suffix.lstrip(".").lower()
        mime = {"jpg": "image/jpeg", "jpeg": "image/jpeg", "png": "image/png", "webp": "image/webp"}.get(ext, "image/png")
        b64 = base64.b64encode(img_bytes).decode()
        prompt_image = f"data:{mime};base64,{b64}"

    payload = {
        "model": "gen3a_turbo",
        "promptImage": prompt_image,
        "promptText": prompt_text,
        "duration": duration,
        "ratio": ratio
    }
    if seed is not None:
        payload["seed"] = seed

    r = requests.post(f"{BASE_URL}/image_to_video", json=payload, headers=HEADERS)
    r.raise_for_status()
    return r.json()["id"]

task_id = image_to_video(
    image_path="product_shot.png",
    prompt_text="The product slowly rotates, sparkling particles float around it, luxury feel",
    duration=5,
    ratio="1280:720"
)
print(f"Task submitted: {task_id}")

Step 4: Poll for task status

def get_task(task_id: str) -> dict:
    r = requests.get(f"{BASE_URL}/tasks/{task_id}", headers=HEADERS)
    r.raise_for_status()
    return r.json()

def wait_for_task(task_id: str, poll_interval: int = 5, timeout: int = 600) -> list[str]:
    """Poll until task completes; return list of output video URLs."""
    start = time.time()
    while True:
        task = get_task(task_id)
        status = task["status"]
        progress = task.get("progress", 0)
        print(f"[{int(time.time()-start)}s] Status: {status} ({int(progress*100)}%)")

        if status == "SUCCEEDED":
            return task["output"]  # list of video URLs
        elif status in ("FAILED", "CANCELLED"):
            raise RuntimeError(f"Task {status}: {task.get('failure', '')}")
        elif time.time() - start > timeout:
            raise TimeoutError(f"Task not done after {timeout}s")

        time.sleep(poll_interval)

output_urls = wait_for_task(task_id)
print(f"Video(s) ready: {output_urls}")

Step 5: Download the result

def download_video(url: str, output_path: str = "output.mp4") -> str:
    r = requests.get(url, stream=True)
    r.raise_for_status()
    with open(output_path, "wb") as f:
        for chunk in r.iter_content(chunk_size=8192):
            f.write(chunk)
    size_mb = os.path.getsize(output_path) / 1024 / 1024
    print(f"Saved: {output_path} ({size_mb:.1f} MB)")
    return output_path

download_video(output_urls[0], "mountain_valley.mp4")

Full pipeline example

def generate_and_download(prompt: str, output_path: str = "output.mp4", **kwargs) -> str:
    """One-shot: generate video from text and download it."""
    print(f"Generating: {prompt[:80]}...")
    task_id = text_to_video(prompt, **kwargs)
    urls = wait_for_task(task_id)
    return download_video(urls[0], output_path)

# Generate a product ad clip
generate_and_download(
    prompt="Close-up of a sleek smartphone on a white desk, screen lights up, smooth camera pull-back",
    output_path="product_ad.mp4",
    duration=5,
    ratio="1280:720"
)

Parameters reference

Parameter Values Description
model gen3a_turbo Use Gen-3 Alpha Turbo (fastest)
duration 5, 10 Video length in seconds
ratio 1280:720, 720:1280, 1104:832, 832:1104, 960:960 Resolution aspect ratio
seed integer Reproducibility seed for deterministic outputs
promptText string Text prompt describing the desired video
promptImage URL or data URI Starting image for image-to-video

Guidelines

  • Runway tasks take 30–120 seconds depending on duration and load.
  • Output URLs expire after a period — download videos promptly after generation.
  • Keep prompts descriptive and cinematic: include camera movement, lighting, mood.
  • Use seed to reproduce the same result when iterating on prompts.
  • For batch generation, queue tasks in parallel but respect rate limits (check HTTP 429 and retry after the Retry-After header value).
  • Store API keys in environment variables — never hardcode them.
  • Check https://docs.runwayml.com for the latest model names and endpoints as they evolve rapidly.

Current listing version

1.0.0

Verify the source revision ↗

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value90/100

Highlights

  • 提供完整的AI视频生成解决方案,支持文本转视频和图像转视频两种核心功能
  • 适用于实际商业场景如广告制作、内容创作、自动化视频生产等高频需求
  • 集成了完整的异步任务处理流程,从提交到下载形成闭环体验
Trigger Precision90/100

Highlights

  • 触发描述清晰完整,明确说明了适用场景:根据文本或图像生成视频、应用AI视频特效、自动化创意视频制作流程
  • 支持多种使用变体,包括Gen-3 Alpha Turbo、image-to-video、video-to-video等不同模式
  • 边界清晰,不会与其他AI工具产生混淆
Structure and Standards90/100

Highlights

  • 结构完整,包含Overview、Setup、Core Concepts、Instructions、Parameters reference等标准章节
  • 提供了从环境配置到完整pipeline的端到端示例,步骤清晰且有明确的出口条件
  • frontmatter完整,包含必要的元数据信息如license、compatibility、metadata等
Execution Reliability90/100

Highlights

  • API来源明确,提供了完整的认证和请求头配置
  • 覆盖了主要异常情况处理,包括任务失败、超时等场景
  • 提供了完整的错误处理机制和重试策略,确保执行可靠性
Evidence Verifiability (mean of the first four)90/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

  • Read local files

    Limit access to selected files or the project directory. Avoid unrelated private records, secrets and configuration files.

    Mentioned in main document · lines 115
  • Save or modify files

    Confirm the output directory and whether existing files will be replaced. Back up important files and prefer a new output directory.

    Mentioned in main document · lines 180
  • Install or fetch external dependencies

    Use official sources and pin versions. Check install scripts in an isolated environment. This document check does not cover code downloaded later.

    Mentioned in main document · lines 31
  • Accounts, secrets or authorization

    Use a dedicated least-privilege account. Keep secrets out of public content and command logs; verify the receiving service and tenant.

    Mentioned in main document · lines 9, 56, 59
Domains or addresses referenced in the document

These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.

  • api.dev.runwayml.com
  • docs.runwayml.com

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Base URL: `https://api.dev.runwayml.com/v1` API docs: https://docs.runwayml.com

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.