Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,10 @@ The skills generate framework-specific code for:

## API Reference

- **Base URL:** `https://api.dev.runwayml.com`
- **Auth header:** `Authorization: Bearer <RUNWAYML_API_SECRET>`
- **Version header:** `X-Runway-Version: 2024-11-06`
See [`runway.md`](runway.md) for authentication, request headers, base URLs, output URL expiry, task polling, and other shared platform rules.

- **Official docs:** [docs.dev.runwayml.com](https://docs.dev.runwayml.com/)
- **API Reference:** [docs.dev.runwayml.com/api](https://docs.dev.runwayml.com/api)
- **API reference:** [docs.dev.runwayml.com/api](https://docs.dev.runwayml.com/api)
- **Developer portal:** [dev.runwayml.com](https://dev.runwayml.com/)

## License
Expand Down
78 changes: 78 additions & 0 deletions runway.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Runway API — Shared Context

Durable platform rules that apply across all Runway API skills. Individual skills reference this document for common guidance instead of restating it.

## Authentication

- **Environment variable:** `RUNWAYML_API_SECRET`
- **Server-side only.** The API key must never appear in client-side code, browser bundles, or public repositories.
- Obtain a key at [dev.runwayml.com/settings/api-keys](https://dev.runwayml.com/settings/api-keys).
- For staging environments, also set `RUNWAYML_BASE_URL=https://api.dev-stage.runwayml.com`.

## Request Headers

All REST requests require:

```
Authorization: Bearer <RUNWAYML_API_SECRET>
X-Runway-Version: 2024-11-06
Content-Type: application/json
```

SDK clients (`@runwayml/sdk` for Node.js, `runwayml` for Python) set these automatically.

## Base URLs

| Environment | URL |
|-------------|-----|
| Production | `https://api.dev.runwayml.com` |
| Staging | `https://api.dev-stage.runwayml.com` |

## Output URLs and Storage

- Generated output URLs (video, image, audio) **expire within 24–48 hours**.
- `runway://` upload URIs expire after **24 hours**.
- Always download outputs to your own storage (S3, GCS, local filesystem) immediately after generation.
- Never serve signed output URLs directly to end users.

## Task Polling

Generation endpoints return a task ID. The task must be polled until it reaches a terminal status.

**SDK (recommended):**
```javascript
const task = await client.textToVideo.create({ ... }).waitForTaskOutput();
```

`waitForTaskOutput()` has a default 10-minute timeout. For long-running generations, implement a custom polling loop or increase the timeout.

**REST:**
```
GET /v1/tasks/{id}
```

Poll until `status` is `SUCCEEDED`, `FAILED`, or `CANCELLED`. Use 5-second intervals with exponential backoff.

## Credits and Billing

- A Runway developer account with **prepaid credits** is required (minimum $10).
- Credit costs vary by model — see individual skill docs or the `api-reference` skill for current pricing.
- Manage billing at [dev.runwayml.com](https://dev.runwayml.com/).

## Rate Limits

- Rate limits are per-organization and vary by tier and model.
- Check current limits via `GET /v1/organization`.
- On `429 Too Many Requests`, retry with exponential backoff.

## Content Moderation

- Both inputs and outputs are subject to content moderation.
- Safety-flagged inputs are **non-refundable** — credits are still consumed.
- If a generation is rejected, try a different prompt.

## API Reference

- **Official docs:** [docs.dev.runwayml.com](https://docs.dev.runwayml.com/)
- **API reference:** [docs.dev.runwayml.com/api](https://docs.dev.runwayml.com/api/)
- **Developer portal:** [dev.runwayml.com](https://dev.runwayml.com/)
3 changes: 2 additions & 1 deletion skills/integrate-audio/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ async def generate_sound(req: SoundRequest):

## Tips

- **Output URLs expire in 24-48 hours.** Download audio files to your own storage.
See `runway.md` in the repository root for shared platform rules (output URL expiry, task polling, credits). Model-specific tips:

- **For local audio files** (voice isolation, dubbing, speech-to-speech), upload via `+integrate-uploads` first.
- **Voice IDs** can be listed via the voices endpoint — see `+api-reference` for details.
- **Text-to-speech cost** scales with text length: 1 credit per 50 characters.
3 changes: 2 additions & 1 deletion skills/integrate-image/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ async def generate_image(req: ImageRequest):

## Tips

- **Output URLs expire in 24-48 hours.** Download images to your own storage immediately.
See `runway.md` in the repository root for shared platform rules (output URL expiry, task polling, credits). Model-specific tips:

- **Reference images use `@Tag` syntax** in the prompt — the tag must match the `tag` field in the `referenceImages` array.
- **For local files**, always upload via `+integrate-uploads` first, then use the `runway://` URI.
- **`gen4_image_turbo`** is the cheapest option at 2 credits per image — good for prototyping.
4 changes: 2 additions & 2 deletions skills/integrate-video/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,9 @@ async def generate_video(req: VideoRequest):

## Tips

- **Output URLs expire in 24-48 hours.** Download videos to your own storage (S3, GCS, local filesystem) immediately after generation.
See `runway.md` in the repository root for shared platform rules (output URL expiry, task polling, credits). Model-specific tips:

- **`gen4_turbo` requires an image** — it cannot do text-only generation.
- **`gen4_aleph` is the only video-to-video model** — use it for editing/transforming existing videos.
- **Duration range is 2-10 seconds.** Longer videos require chaining multiple generations.
- **`waitForTaskOutput()` has a default 10-minute timeout.** For long-running generations, you may want to implement your own polling loop or increase the timeout.
- **For local files**, always use `+integrate-uploads` to upload first, then pass the `runway://` URI.
7 changes: 2 additions & 5 deletions skills/recipe-full-setup/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,6 @@ Does the input come from a public HTTPS URL?

## Important Reminders

- **Never expose the API key in client-side code.** All API calls must happen server-side.
- **Output URLs expire.** Always download and store generated content.
- **Credits are required.** The API won't work without prepaid credits.
- **Rate limits exist.** Rate limits exist. You should always check what is the rate limit before attempting concurrent generations.
- **Content moderation applies** to both inputs and outputs. Safety-flagged inputs are non-refundable.
See `runway.md` in the repository root for shared platform rules (auth, output expiry, credits, rate limits, moderation). Key points for this workflow:

- **Be cost-conscious.** Help users pick the right model for their budget. Credit cost can be found on https://docs.dev.runwayml.com/guides/pricing/