Switchx Video To Video
Model Overview
SwitchX is a video-to-video compositing model by Beeble that replaces a scene element while preserving the original subject, with automatic subject detection and seamless relighting to match a reference image. Does not support tools/function calling.
Setup your API Key
If you don't have an API key yet, use our Quickstart guide.
How to Make a Call
API Schemas
Create a video generation task and send it to the server
URL of the source video to recomposite. Allowed formats: MP4, MOV (H.264 or HEVC), up to 240 frames. Source must not exceed 2,770,000 total pixels.
URL of the alpha mask. Required when alpha_mode is "custom" or "select"; ignored for "auto" and "fill". A mask video for video-to-video, a mask image for image-to-image.
URL of the reference image defining the target look and lighting for the replaced region. Allowed formats: JPEG, PNG, WEBP. At least one of reference_image_url or prompt must be provided.
Subject masking strategy: "auto" (AI auto-detects the subject), "fill" (no masking), "select" (propagate a mask from one keyframe), or "custom" (frame-by-frame mask supplied via alpha_url). Defaults to "auto".
autoPossible values: Maximum output resolution (longer side) in pixels: 720 or 1080. Defaults to 1080. 1080 costs more than 720.
1080Possible values: Frame index (0-based) whose mask is propagated when alpha_mode is "select" on a video. Defaults to the first frame. Ignored for image generation and for the auto, fill, and custom modes.
Random seed (0–4294967295) for reproducibility. Omit for a random seed. The seed used is always returned in the response.
Text description of the desired output to guide the generation (max 2000 characters). At least one of prompt or reference_image_url must be provided.
Successful response.
The ID of the generated video.
60ac7c34-3224-4b14-8e7d-0aa0db708325The current status of the generation task.
completedPossible values: curl --request POST \
--url 'https://api.aimlapi.com/v2/video/generations' \
--header 'Authorization: Bearer <YOUR_AIMLAPI_KEY>' \
--header 'Content-Type: application/json' \
--data '{"model": "beeble/switchx-video-to-video", "video_url": "https://example.com/input.jpg", "prompt": "Describe what you want the model to generate."}'Successful response.
{
"id": "60ac7c34-3224-4b14-8e7d-0aa0db708325",
"status": "completed",
"video": {
"url": "https://cdn.aimlapi.com/generations/hedgehog/1759866285599-0cdfb138-c03a-49d4-a601-4f6413e27b15.mp4"
},
"error": {
"name": "text",
"message": "text"
},
"meta": {
"usage": {
"credits_used": 120000,
"usd_spent": 0.06
}
}
}Retrieve the generated video from the server
Poll this endpoint with the generation_id returned by the submit request. When the status is completed, the response includes the generated video URL.
Bearer key
<REPLACE_WITH_YOUR_GENERATION_ID>The ID of the generated video.
60ac7c34-3224-4b14-8e7d-0aa0db708325The current status of the generation task.
completedPossible values: curl -L \
--request GET \
--url 'https://api.aimlapi.com/v2/video/generations?generation_id=<REPLACE_WITH_YOUR_GENERATION_ID>' \
--header 'Authorization: Bearer <YOUR_AIMLAPI_KEY>'{
"id": "60ac7c34-3224-4b14-8e7d-0aa0db708325",
"status": "completed",
"video": {
"url": "https://cdn.aimlapi.com/generations/hedgehog/1759866285599-0cdfb138-c03a-49d4-a601-4f6413e27b15.mp4"
},
"error": {
"name": "text",
"message": "text"
},
"meta": {
"usage": {
"credits_used": 120000
}
}
}Code Example
The examples submit a generation task and poll every 15 seconds until the final result is available.
Last updated
Was this helpful?