mcpField
A
api-reference

api-reference

github.com/runwaymlCreative & media7455 installsUpdated 2d ago
Repository

About api-reference

api-reference documents the Runway public API for developers integrating video, image, audio, and real-time Avatar features. It brings together model endpoints, task states, input requirements, and error-handling guidance.

Key features

  1. 01List video, image, and audio generation endpoints
  2. 02Explain Avatar and real-time session management
  3. 03Summarize document and task management endpoints
  4. 04Describe task polling and output handling
  5. 05Specify input formats, size limits, and URL requirements
  6. 06Document rate limits and error handling

Use cases

  1. 01Integrate text-to-video or image-to-video generation
  2. 02Build image generation or voice-processing flows
  3. 03Manage real-time Avatar sessions and linked documents
  4. 04Diagnose task states and API errors

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/runwayml/skills --skill api-reference

After installing, type/api-referencein Claude Code to confirm it loaded.

Details

From the project README

Runway Public API Reference

PREREQUISITE: Run +check-compatibility first to ensure the project has server-side capability.

Base URL: https://api.dev.runwayml.com

All requests require these headers:

Authorization: Bearer <RUNWAYML_API_SECRET>
X-Runway-Version: 2024-11-06

Models & Endpoints

Video Generation
ModelEndpointInputCost (credits/sec)
gen4.5POST /v1/image_to_video or POST /v1/text_to_videoText and/or Image12
gen4_turboPOST /v1/image_to_videoImage required5
gen4_alephPOST /v1/video_to_videoVideo + Text/Image15
act_twoPOST /v1/character_performanceImage/Video5
veo3POST /v1/image_to_video or POST /v1/text_to_videoText/Image40
veo3.1POST /v1/image_to_video or POST /v1/text_to_videoText/Image20-40
veo3.1_fastPOST /v1/image_to_video or POST /v1/text_to_videoText/Image10-15

Video duration: 2-10 seconds. Aspect ratios: 1280:720, 720:1280, 1104:832, etc.

Image Generation
ModelEndpointCost (credits)
gen4_imagePOST /v1/text_to_image5 (720p), 8 (1080p)
gen4_image_turboPOST /v1/text_to_image2
gemini_2.5_flashPOST /v1/text_to_image5
Audio Generation
ModelEndpointUse CaseCost
eleven_multilingual_v2POST /v1/text_to_speechText to speech1 credit/50 chars
eleven_text_to_sound_v2POST /v1/sound_effectSound effects1-2 credits
eleven_voice_isolationPOST /v1/voice_isolationIsolate voice from audio1 credit/6 sec
eleven_voice_dubbingPOST /v1/voice_dubbingDub audio to other languages1 credit/2 sec
eleven_multilingual_sts_v2POST /v1/speech_to_speechVoice conversion1 credit/3 sec
Characters (Real-Time Avatars)
ModelDescriptionSession Max Duration
gwm1_avatarsReal-time conversational avatars powered by GWM-15 minutes

Endpoints:

MethodEndpointDescription
POST/v1/avatarsCreate a new Avatar
GET/v1/avatars/{id}Retrieve an Avatar
PATCH/v1/avatars/{id}Update an Avatar (name, voice, personality, documentIds)
DELETE/v1/avatars/{id}Delete an Avatar
POST/v1/realtime_sessionsCreate a new real-time session
GET/v1/realtime_sessions/{id}Retrieve session status (poll until READY)
POST/v1/realtime_sessions/{id}/consumeConsume session credentials for WebRTC (one-time use)

Avatar creation parameters:

ParameterTypeDescription
namestringDisplay name for the avatar
referenceImagestringURL or runway:// URI of the character image
voiceobject{ type: 'runway-live-preset', presetId: 'clara' }
personalitystringSystem prompt / personality instructions
documentIdsstring[]Optional. IDs of knowledge base documents to attach

Voice presets: clara (soft), victoria (firm), vincent (authoritative). Preview all at dev.runwayml.com.

Session statuses: NOT_READY → READY → RUNNING → COMPLETED (or FAILED / CANCELLED)

Documents (Knowledge Base)
MethodEndpointDescription
POST/v1/documentsCreate a document (plain text or Markdown)
GET/v1/documents/{id}Retrieve a document
DELETE/v1/documents/{id}Delete a document

Each Avatar supports up to 50,000 tokens of knowledge. Link documents to an Avatar via client.avatars.update(id, { documentIds: [...] }).

Management Endpoints
MethodEndpointDescription
GET/v1/tasks/{id}Get task status and output
DELETE/v1/tasks/{id}Cancel/delete a task
POST/v1/uploadsCreate ephemeral upload
GET/v1/organizationOrganization info & credit balance
POST/v1/organization/usageCredit usage history (up to 90 days)

Task Lifecycle

All generation endpoints return a task object. The flow is:

  1. Submit — POST /v1/<endpoint> → returns { "id": "task_xxx" }
  2. Poll — GET /v1/tasks/{id} → returns task with status
  3. Retrieve output — When status === "SUCCEEDED", the output array contains signed URLs
Task Statuses
StatusMeaning
PENDINGQueued, waiting to start
RUNNINGCurrently generating
SUCCEEDEDComplete — output URLs available
FAILEDGeneration failed — check failure field
THROTTLEDConcurrency limit hit — auto-queued
SDK Polling (Recommended)

The SDKs provide a waitForTaskOutput() method that handles polling automatically:

// Node.js — polls until complete (default 10 min timeout)
const task = await client.imageToVideo.create({
  model: 'gen4.5',
  promptImage: 'https://example.com/image.jpg',
  promptText: 'A sunset timelapse',
  ratio: '1280:720',
  duration: 5
}).waitForTaskOutput();

console.log(task.output); // Array of signed URLs
# Python
task = client.image_to_video.create(
    model='gen4.5',
    prompt_image='https://example.com/image.jpg',
    prompt_text='A sunset timelapse',
    ratio='1280:720',
    duration=5
).wait_for_task_output()

print(task.output)
Manual Polling (REST)
async function pollTask(taskId) {
  while (true) {
    const response = await fetch(`https://api.dev.runwayml.com/v1/tasks/${taskId}`, {
      headers: {
        'Authorization': `Bearer ${process.env.RUNWAYML_API_SECRET}`,
        'X-Runway-Version': '2024-11-06'
      }
    });
    const task = await response.json();

    if (task.status === 'SUCCEEDED') return task;
    if (task.status === 'FAILED') throw new Error(task.failure);

    await new Promise(r => setTimeout(r, 5000)); // poll every 5 seconds
  }
}

Output Handling

  • Successful tasks return an output array with signed URLs to generated content
  • Output URLs expire within 24-48 hours
  • Download and store outputs in your own storage — do not serve signed URLs to end users
  • Video outputs are MP4, image outputs are PNG/JPEG

Input Requirements

Size Limits
TypeVia URLVia Data URIVia Upload
Image16 MB5 MB200 MB
Video32 MB16 MB200 MB
Audio32 MB16 MB200 MB
Supported Formats
  • Images: JPEG, PNG, WebP (no GIF)
  • Video codecs: H.264, H.265/HEVC, AV1, VP8/VP9, Apple ProRes, Theora
  • Audio: MP3, AAC, FLAC, PCM, ALAC
URL Requirements

If providing assets via URL:

  • HTTPS only (no HTTP)
  • Domain names only (no IP addresses)
  • No redirects
  • Must support HTTP HEAD requests
  • Must return valid Content-Type and Content-Length headers
  • Max URL length: 2,048 characters

Rate Limits & Tiers

TierConcurrencyDaily GensMonthly CapUnlock
1 (default)1-250-200$100—
23500-1,000$5001 day + $50
351,000-2,000$2,0007 days + $100
4105,000-10,000$20,00014 days + $1,000
52025,000-30,000$100,0007 days + $5,000
  • No requests-per-minute limit — only daily generation quotas
  • Exceeding concurrency → THROTTLED status (auto-queued, not rejected)
  • Exceeding daily limit → 429 Too Many Requests
  • Daily limits use a rolling 24-hour window

Error Handling

HTTP Errors
CodeMeaningAction
400Input validation failureFix input, do not retry
401Invalid API keyCheck key, do not retry
429Rate limitedRetry with exponential backoff + jitter
502/503/504Server overloadRetry with exponential backoff + jitter
Task Failure Codes
CodeMeaningRetry?
SAFETY.INPUT.*Input content moderationNo — not refundable
SAFETY.OUTPUT.*Output content moderationYes — try different prompt
INTERNAL.BAD_OUTPUTQuality issueYes
ASSET.INVALIDBad input formatFix input
INTERNALServer errorYes

The SDKs handle retries for transient errors automatically.


Data URI Support

Base64-encoded images can be passed instead of URLs:

data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...

Useful for small images or when you don't want to host the file. Subject to the data URI size limits above.

Comments

Markdown supported