From runway-api
Uploads local images, videos, and audio files to Runway ephemeral storage for AI generation model inputs via Node.js/Python SDKs or REST API. Use for local files exceeding data URI limits or lacking public HTTPS URLs.
How this skill is triggered — by the user, by Claude, or both
Slash command
/runway-api:rw-integrate-uploadsThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
> **PREREQUISITE:** Run `+rw-check-compatibility` first. Run `+rw-fetch-api-reference` to load the latest API reference before integrating. Requires `+rw-setup-api-key` for API credentials.
PREREQUISITE: Run
+rw-check-compatibilityfirst. Run+rw-fetch-api-referenceto load the latest API reference before integrating. Requires+rw-setup-api-keyfor API credentials.
Help users upload local files (images, videos, audio) to Runway's ephemeral storage for use as inputs to generation models.
Use the Uploads API when:
You do NOT need uploads when:
runway:// URI as input to any generation endpointrunway:// URIs are valid for 24 hours.
import RunwayML from '@runwayml/sdk';
import fs from 'fs';
const client = new RunwayML();
// Upload from a file stream
const upload = await client.uploads.createEphemeral(
fs.createReadStream('/path/to/image.jpg')
);
// Use the runway:// URI in any generation call
const task = await client.imageToVideo.create({
model: 'gen4.5',
promptImage: upload.runwayUri,
promptText: 'The scene comes to life',
ratio: '1280:720',
duration: 5
}).waitForTaskOutput();
The Node.js SDK accepts:
fs.ReadStream — file streamsFile objects — from web APIsBlob objectsBuffer / ArrayBuffer / typed arraysResponse objects — from fetch()from runwayml import RunwayML
from pathlib import Path
client = RunwayML()
# Upload from a file path
upload = client.uploads.create_ephemeral(
Path('/path/to/image.jpg')
)
# Use the runway:// URI
task = client.image_to_video.create(
model='gen4.5',
prompt_image=upload.runway_uri,
prompt_text='The scene comes to life',
ratio='1280:720',
duration=5
).wait_for_task_output()
The Python SDK accepts:
pathlib.Path objectsIOBase objects (file-like objects)(filename, content)If not using the SDK, the upload flow has three steps:
const response = await fetch('https://api.dev.runwayml.com/v1/uploads', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.RUNWAYML_API_SECRET}`,
'X-Runway-Version': '2024-11-06',
'Content-Type': 'application/json'
},
body: JSON.stringify({
filename: 'image.jpg',
type: 'ephemeral'
})
});
const { uploadUrl, fields, runwayUri } = await response.json();
const formData = new FormData();
// Add all presigned form fields first
for (const [key, value] of Object.entries(fields)) {
formData.append(key, value);
}
// Add the file last
formData.append('file', fileBuffer, 'image.jpg');
await fetch(uploadUrl, {
method: 'POST',
body: formData
});
runway:// URIconst task = await fetch('https://api.dev.runwayml.com/v1/image_to_video', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.RUNWAYML_API_SECRET}`,
'X-Runway-Version': '2024-11-06',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'gen4.5',
promptImage: runwayUri,
promptText: 'Animate this scene',
ratio: '1280:720',
duration: 5
})
});
| Constraint | Value |
|---|---|
| Minimum file size | 512 bytes |
| Maximum file size | 200 MB |
| URI validity | 24 hours |
| Requires credits | Yes (must have purchased credits) |
import RunwayML from '@runwayml/sdk';
import express from 'express';
import multer from 'multer';
const client = new RunwayML();
const app = express();
const upload = multer({ storage: multer.memoryStorage() });
app.post('/api/image-to-video', upload.single('image'), async (req, res) => {
try {
// Upload the user's file to Runway
const runwayUpload = await client.uploads.createEphemeral(req.file.buffer);
// Use the uploaded file for video generation
const task = await client.imageToVideo.create({
model: 'gen4.5',
promptImage: runwayUpload.runwayUri,
promptText: req.body.prompt || 'Animate this image',
ratio: '1280:720',
duration: 5
}).waitForTaskOutput();
res.json({ videoUrl: task.output[0] });
} catch (error) {
console.error('Generation failed:', error);
res.status(500).json({ error: error.message });
}
});
// app/api/image-to-video/route.ts
import RunwayML from '@runwayml/sdk';
import { NextRequest, NextResponse } from 'next/server';
const client = new RunwayML();
export async function POST(request: NextRequest) {
const formData = await request.formData();
const imageFile = formData.get('image') as File;
const prompt = formData.get('prompt') as string;
try {
// Upload file to Runway
const upload = await client.uploads.createEphemeral(imageFile);
// Generate video from the uploaded image
const task = await client.imageToVideo.create({
model: 'gen4.5',
promptImage: upload.runwayUri,
promptText: prompt || 'Animate this image',
ratio: '1280:720',
duration: 5
}).waitForTaskOutput();
return NextResponse.json({ videoUrl: task.output[0] });
} catch (error) {
return NextResponse.json(
{ error: error instanceof Error ? error.message : 'Failed' },
{ status: 500 }
);
}
}
from fastapi import FastAPI, UploadFile, Form, HTTPException
from runwayml import RunwayML
app = FastAPI()
client = RunwayML()
@app.post("/api/image-to-video")
async def image_to_video(image: UploadFile, prompt: str = Form("Animate this image")):
try:
# Upload to Runway
content = await image.read()
upload = client.uploads.create_ephemeral((image.filename, content))
# Generate video
task = client.image_to_video.create(
model="gen4.5",
prompt_image=upload.runway_uri,
prompt_text=prompt,
ratio="1280:720",
duration=5
).wait_for_task_output()
return {"video_url": task.output[0]}
except Exception as e:
raise HTTPException(status_code=500, detail=str(e))
runway:// URIs expire after 24 hours. If you need to re-use an asset, upload it again.runway:// URI.npx claudepluginhub anthropics/claude-plugins-official --plugin runway-apiIntegrates RunwayML video generation APIs into server-side code, covering text-to-video, image-to-video, and video-to-video with Node.js SDK examples and model recommendations.
Integrates RunwayML Python SDK for AI video generation from prompts/images. Polls tasks, handles auth/credits errors, for creative AI workflows.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.