Runway AI API for video generation via curl. Use this skill to generate videos from images, text, or other videos.
/plugin marketplace add vm0-ai/api0/plugin install api0@api0This skill inherits all available tools. When active, it can use any tool Claude has access to.
Use the Runway API via direct curl calls to generate AI videos from images, text, or video inputs.
Official docs:
https://docs.dev.runwayml.com/
Use this skill when you need to:
RUNWAY_API_KEYexport RUNWAY_API_KEY="your-api-key"
Important: When using
$VARin a command that pipes to another command, wrap the command containing$VARinbash -c '...'. Due to a Claude Code bug, environment variables are silently cleared when pipes are used directly.bash -c 'curl -s "https://api.example.com" -H "Authorization: Bearer $API_KEY"' | jq .
All examples below assume you have RUNWAY_API_KEY set.
Base URL: https://api.dev.runwayml.com/v1
Required headers for all requests:
Authorization: Bearer ${RUNWAY_API_KEY}X-Runway-Version: 2024-11-06Content-Type: application/jsonCheck your credit balance:
bash -c 'curl -s -X GET "https://api.dev.runwayml.com/v1/organization" --header "Authorization: Bearer ${RUNWAY_API_KEY}" --header "X-Runway-Version: 2024-11-06"' | jq .
Generate a video from an image:
bash -c 'curl -s -X POST "https://api.dev.runwayml.com/v1/image_to_video" --header "Authorization: Bearer ${RUNWAY_API_KEY}" --header "X-Runway-Version: 2024-11-06" --header "Content-Type: application/json" -d '"'"'{
"model": "gen4_turbo",
"promptImage": "https://example.com/your-image.jpg",
"promptText": "A timelapse of clouds moving across the sky",
"ratio": "1280:720",
"duration": 5
}'"'"' | jq .'
Response:
{
"id": "task-id-here"
}
Generate a video from text only:
Note: Text-to-video only supports duration values of 4, 6, or 8 seconds (not arbitrary values like image-to-video).
bash -c 'curl -s -X POST "https://api.dev.runwayml.com/v1/text_to_video" --header "Authorization: Bearer ${RUNWAY_API_KEY}" --header "X-Runway-Version: 2024-11-06" --header "Content-Type: application/json" -d '"'"'{
"model": "veo3.1",
"promptText": "A serene forest with sunlight filtering through the trees",
"ratio": "1280:720",
"duration": 6
}'"'"' | jq .'
Transform an existing video:
bash -c 'curl -s -X POST "https://api.dev.runwayml.com/v1/video_to_video" --header "Authorization: Bearer ${RUNWAY_API_KEY}" --header "X-Runway-Version: 2024-11-06" --header "Content-Type: application/json" -d '"'"'{
"model": "gen4_aleph",
"videoUri": "https://example.com/source-video.mp4",
"promptText": "Add magical sparkles and fairy dust effects"
}'"'"' | jq .'
Generate images from text:
bash -c 'curl -s -X POST "https://api.dev.runwayml.com/v1/text_to_image" --header "Authorization: Bearer ${RUNWAY_API_KEY}" --header "X-Runway-Version: 2024-11-06" --header "Content-Type: application/json" -d '"'"'{
"model": "gen4_image_turbo",
"promptText": "A futuristic cityscape at sunset",
"ratio": "16:9"
}'"'"' | jq .'
Poll for task completion:
TASK_ID="your-task-id"
bash -c 'curl -s -X GET "https://api.dev.runwayml.com/v1/tasks/${TASK_ID}" --header "Authorization: Bearer ${RUNWAY_API_KEY}" --header "X-Runway-Version: 2024-11-06"' | jq .
Response when complete:
{
"id": "task-id",
"status": "SUCCEEDED",
"output": ["https://cdn.runwayml.com/generated-video.mp4"]
}
Possible statuses: PENDING, RUNNING, SUCCEEDED, FAILED
Cancel a running task:
TASK_ID="your-task-id"
curl -s -X DELETE "https://api.dev.runwayml.com/v1/tasks/${TASK_ID}" --header "Authorization: Bearer ${RUNWAY_API_KEY}" --header "X-Runway-Version: 2024-11-06"
Upscale video resolution:
bash -c 'curl -s -X POST "https://api.dev.runwayml.com/v1/video_upscale" --header "Authorization: Bearer ${RUNWAY_API_KEY}" --header "X-Runway-Version: 2024-11-06" --header "Content-Type: application/json" -d '"'"'{
"model": "upscale_v1",
"videoUri": "https://example.com/low-res-video.mp4"
}'"'"' | jq .'
Generate audio from text:
bash -c 'curl -s -X POST "https://api.dev.runwayml.com/v1/sound_effect" --header "Authorization: Bearer ${RUNWAY_API_KEY}" --header "X-Runway-Version: 2024-11-06" --header "Content-Type: application/json" -d '"'"'{
"model": "eleven_text_to_sound_v2",
"promptText": "Thunder rumbling in the distance"
}'"'"' | jq .'
| Endpoint | Models |
|---|---|
| Image to Video | gen4_turbo, gen3a_turbo, veo3.1, veo3 |
| Text to Video | veo3.1, veo3.1_fast, veo3 |
| Video to Video | gen4_aleph |
| Text to Image | gen4_image_turbo, gen4_image |
| Video Upscale | upscale_v1 |
Common ratios for video generation:
1280:720 (16:9 landscape)720:1280 (9:16 portrait)1024:1024 (1:1 square)/tasks/{id} until status is SUCCEEDEDgen4_turbo is faster, gen4_aleph for video-to-video/organization endpoint to track usage