Skip to main content
Base URL: https://platform.runblob.io

POST /v1/kling/o3-video/generate

Creates a video generation task using Kling 3.0-omni (O3 Video) model.
prompt
string
required
Text description of the video (1-2500 characters)
images_url
array
Array of image URLs for image-to-video generation (max 5 images, cannot mix with images_base64)
images_base64
array
Array of base64-encoded images for image-to-video generation (max 5 images, cannot mix with images_url)
duration
string
default:"5"
Video duration in seconds: "5", "10", or "15"
aspect_ratio
string
default:"16:9"
Video aspect ratio:
  • "16:9" - Landscape (YouTube, Desktop) - default
  • "9:16" - Portrait (Stories, TikTok, Reels)
  • "1:1" - Square (Instagram Feed)
model
string
default:"kling_o3"
Quality mode:
  • "kling_o3" - Standard 720p quality (faster, cheaper) - default
  • "kling_o3_pro" - Pro 1080p quality (higher quality)
keep_original_sound
boolean
default:"true"
Keep original sound from input video/images (if applicable)
callback_url
string
Webhook URL for completion notifications
Image Input Restrictions:
  • Provide either images_url OR images_base64, not both
  • Maximum 5 images total
  • Maximum 10 MB per image
  • Supported formats: JPEG, PNG, GIF, WEBP
curl -X POST https://platform.runblob.io/v1/kling/o3-video/generate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A cat walking in a garden"
  }'

Response

{
  "generation_id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "pending",
  "price": "0.1500"
}
generation_id
string
UUID of the generation task for status checking
status
string
Initial status, always "pending"
price
string
Amount charged in USD (varies by duration and mode)
Video generation typically takes 2-10 minutes depending on duration and mode. Use the generation_id to check status or set up webhooks for notifications.Check status: GET /v1/kling/o3-video/generations/{generation_id}

Generation Modes

Generate video from text description only:
  • No input images required
  • AI creates entire video from scratch
  • Best for creative scenes, animations, concepts
{
  "prompt": "Sunset over ocean with waves",
  "duration": "10"
}
Animate existing images:
  • Provide 1-5 reference images
  • AI animates and brings images to life
  • Best for character animation, product demos
{
  "prompt": "Make the person smile and wave",
  "images_url": ["https://example.com/photo.jpg"],
  "duration": "5"
}

Video Parameters

Choose video length:
  • 5 seconds: Quick clips, fast generation (default)
  • 10 seconds: Standard videos, moderate generation time
  • 15 seconds: Longer content, extended generation time
Longer durations cost more and take longer to generate
Standard vs Pro:
ModelResolutionSpeedBest For
kling_o3720pFasterQuick previews, social media
kling_o3_pro1080pSlowerProfessional use, high quality
Pro mode costs approximately 2x more than Standard mode
3 aspect ratio options:
RatioFormatUse Case
16:9LandscapeYouTube, Desktop (default)
9:16PortraitStories, TikTok, Reels
1:1SquareInstagram Feed
Keep original sound:
  • keep_original_sound: true - Preserve audio from input (default)
  • keep_original_sound: false - Generate silent video
Only applicable for image-to-video with audio-enabled images/videos

Error Responses

{
  "detail": "Maximum 5 images allowed, got 6"
}
Invalid request parameters

Request Validation

function validateO3VideoRequest(request) {
  // Check prompt length
  if (request.prompt.length < 1 || request.prompt.length > 2500) {
    throw new Error("Prompt must be between 1 and 2500 characters");
  }
  
  // Check image count
  const totalImages = (request.images_url?.length || 0) + 
                     (request.images_base64?.length || 0);
  if (totalImages > 5) {
    throw new Error("Maximum 5 images allowed");
  }
  
  // Check that methods aren't mixed
  if (request.images_base64 && request.images_url) {
    throw new Error("Cannot provide both images_base64 and images_url");
  }
  
  // Validate duration
  if (request.duration && !["5", "10", "15"].includes(request.duration)) {
    throw new Error("Duration must be 5, 10, or 15 seconds");
  }
  
  // Validate model
  if (request.model && !["kling_o3", "kling_o3_pro"].includes(request.model)) {
    throw new Error("Model must be 'kling_o3' or 'kling_o3_pro'");
  }
  
  // Validate aspect ratio
  const validRatios = ["16:9", "9:16", "1:1"];
  if (request.aspect_ratio && !validRatios.includes(request.aspect_ratio)) {
    throw new Error("Invalid aspect ratio");
  }
  
  return true;
}