# Runway Video Generation API

> Runway Video Generation — high-quality AI video generation.

- **Provider**: Runway
- **Model id**: `runway`
- **Modality**: video
- **Price**: 15.71–78.55 credits

## Overview

Runway Video Generation is called in two steps: create a generation task, then poll the task until the result is ready.

## Authentication

All requests require a Bearer Token in the request header:

```
Authorization: Bearer YOUR_API_KEY
```

## Create Task

`POST https://you.bot/api/v1/generate`

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| modelId | string | Yes | Model id: `runway` |
| input | object | Yes | Input parameters object (see below) |
| callbackUrl | string | No | https URL to receive a signed webhook on completion |

### input object parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| prompt | string | Yes | Descriptive text that guides the AI video generation. Be specific about subject, action, style, and setting. (default: A french bulldog in a tiny raincoat chases soap bubbles across a rainy plaza in slow motion.) |
| imageUrl | string | No | Optional reference image URL. When provided, the AI will animate or extend this image. (image URL) |
| duration | string | Yes | Video duration. Note: 10s videos cannot use 1080p quality. (options: 5 | 8 | 10) (default: 5) |
| quality | string | Yes | Video resolution. Note: 1080p is only available for 5s and 8s videos. (options: 720p | 1080p) (default: 720p) |
| aspectRatio | string | No | Video aspect ratio. Required for text-to-video; determined by image if imageUrl is provided. (options: 16:9 | 4:3 | 1:1 | 3:4 | 9:16) (default: 16:9) |
| waterMark | string | No | Optional watermark text. Non-empty string displays text in the bottom right corner. |

### Request example

```json
{
  "modelId": "runway",
  "input": {
    "prompt": "A cinematic aerial shot of a coastal town at golden hour, gentle waves rolling onto the shore, warm light, slow camera push-in.",
    "imageUrl": "https://example.com/input.jpg",
    "duration": "5",
    "quality": "720p",
    "aspectRatio": "16:9",
    "waterMark": "example"
  }
}
```

### Response example

```json
{
  "taskId": "281e5b0…f39b9",
  "creditsCharged": 24
}
```

## Query Task

`GET https://you.bot/api/v1/task/{taskId}?model=runway`

When `state` is `success`, the output is in `resultUrls`: `{ "state": "success", "resultUrls": [ ... ] }`. (Text models return inline in the create response.)

## Error Codes

| Code | Description |
|------|-------------|
| 200 | Request successful |
| 400 | Invalid request parameters |
| 401 | Authentication failed, check API Key |
| 402 | Insufficient account balance |
| 422 | Parameter validation failed |
| 429 | Request rate limit exceeded |
| 500 | Internal server error |
