From e86774a71011021dd669df96fb86b84ab628b749 Mon Sep 17 00:00:00 2001 From: Alexandre Breg Date: Mon, 19 Oct 2026 14:42:17 +0200 Subject: [PATCH] docs: describe Runway Dev, task waiting and coding-agent setup in README Point package metadata at dev.runway.com and add search keywords. Co-Authored-By: Claude Opus 5.5 --- README.md | 50 +++++++++++++++++++++++++++++++++++++++----------- package.json | 17 ++++++++++++++++- 2 files changed, 55 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 6e11a66..0885694 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# RunwayML TypeScript API Library +# Runway Dev TypeScript API Library [![NPM version]()](https://npmjs.org/package/@runwayml/sdk) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/@runwayml/sdk) -This library provides convenient access to the RunwayML REST API from server-side TypeScript or JavaScript. +The official Node.js and TypeScript SDK for [Runway Dev](https://dev.runway.com), Runway's API for video, image and audio generation and real-time conversational avatars. One API key calls Runway's own models and models from other labs, listed in the [model catalog](https://dev.runway.com/models/catalog), along with Model Routers, Recipes and published Workflows. Use it from server-side TypeScript or JavaScript. The REST API documentation can be found on [docs.dev.runwayml.com](https://docs.dev.runwayml.com). The full API of this library can be found in [api.md](api.md). @@ -14,28 +14,46 @@ It is generated with [Stainless](https://www.stainless.com/). npm install @runwayml/sdk ``` +Create an API key in [Runway Dev](https://dev.runway.com) and set it as `RUNWAYML_API_SECRET` in your server environment. + ## Usage The full API of this library can be found in [api.md](api.md). +Generation is asynchronous: a create call starts a task, and `waitForTaskOutput()` polls it until the output is ready. + ```js -import RunwayML from '@runwayml/sdk'; +import RunwayML, { TaskFailedError } from '@runwayml/sdk'; const client = new RunwayML({ apiKey: process.env['RUNWAYML_API_SECRET'], // This is the default and can be omitted }); -const imageToVideo = await client.imageToVideo.create({ - model: 'gen4_turbo', - promptImage: 'https://example.com/assets/bunny.jpg', - ratio: '1280:720', - promptText: 'The bunny is eating a carrot', -}); - -console.log(imageToVideo.id); +try { + const task = await client.imageToVideo + .create({ + model: 'gen4.5', + promptImage: 'https://example.com/assets/bunny.jpg', + promptText: 'The bunny is eating a carrot', + ratio: '1280:720', + duration: 5, + }) + .waitForTaskOutput(); + + // Output URLs are temporary, so download anything you want to keep. + console.log(task.output[0]); +} catch (error) { + if (error instanceof TaskFailedError) { + console.error(error.taskDetails); + } else { + throw error; + } +} ``` +To start a task without waiting, drop `.waitForTaskOutput()`, keep the returned `id` and check it later with `client.tasks.retrieve(id)`. + ### Request & Response types This library includes TypeScript definitions for all request params and response fields. You may import and use them like so: @@ -59,6 +77,16 @@ const imageToVideo: RunwayML.ImageToVideoCreateResponse = await client.imageToVi Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors. +## Build with a coding agent + +Runway Dev MCP gives Claude Code, Codex or Cursor live access to your Runway Dev account while it writes code with this SDK: the models, prices and limits available to your project, your Model Routers, and the cause of a failed task. To add it to Claude Code: + +```sh +claude mcp add --transport http --scope user runway-dev-mcp https://dev.runwayml.com/mcp +``` + +Sign-in is OAuth, so no API key goes into the configuration. Setup for other agents, and the Runway Dev skills that show your agent how to use this SDK, are in [runwayml/skills](https://github.com/runwayml/skills) and the [MCP guide](https://docs.dev.runwayml.com/guides/mcp/). + ## Handling errors When the library is unable to connect to the API, diff --git a/package.json b/package.json index c661a99..1e2e5e2 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,23 @@ { "name": "@runwayml/sdk", "version": "4.22.0", - "description": "The official TypeScript library for the RunwayML API", + "description": "The official Node.js and TypeScript SDK for Runway Dev, Runway's API for video, image and audio generation", "author": "RunwayML ", + "homepage": "https://dev.runway.com", + "keywords": [ + "runway", + "runway-dev", + "runwayml", + "ai-video", + "video-generation", + "image-generation", + "text-to-video", + "image-to-video", + "text-to-speech", + "generative-ai", + "api", + "sdk" + ], "types": "dist/index.d.ts", "main": "dist/index.js", "type": "commonjs",