Pixverse Swap overview
Pixverse Swap by PixVerse
Pixverse built Swap for subject replacement in existing footage. It uses a reference image to replace a subject or selected region and preserves the original video's motion and sound.
Pixverse Swap specs
- Model ID
pixverse/swap- Developer
- PixVerse
- Input
- Image, Video
- Output
- Video
- Endpoint
POST https://api.aimlapi.com/v2/video/generations
Limits of the source video
Pixverse states that the source video can be up to 30 seconds long and 100 MB in size. The longest side may be at most 1920 pixels.
Pixverse also states that 1080p output is not supported for Swap. Plan for a final resolution at or below 720p, and upscale elsewhere if you need more.
Pick the frame and the resolution
Keyframe time sets the second of the source video whose frame is used to find the subject. It accepts 0 to 30 and defaults to the first frame. Start with a second where the subject is fully visible, unobstructed and facing the camera. If the first frame shows the subject only partly, move the keyframe later.
Resolution accepts 360p, 540p or 720p. Start with 540p to check that the right subject is replaced, then render the final version at 720p.
Where the mask workflow fits
Pixverse recommends a video mask workflow to identify the region before applying Subject Replacement. Check the output for the edges of the replaced subject and for whether the original motion and sound still line up with the new subject.
Use cases
Replace the actor in a short clip with a person from a reference photo while keeping the original movement.
Swap a product in a demo video for a newer version shown in a photo.
Change the background of a recorded scene to the location shown in an image.
Test several reference photos against the same source video at 540p before choosing one.
Pixverse Swap API pricing
| Usage | Price | Unit |
|---|---|---|
| Video generation | $0.040449 | second |
Prices from the AI/ML API price list, checked on Nov 23, 2026.
Pixverse Swap vs other video models: prices
AI/ML API rates for 5 models, per second.
| Model | Per second |
|---|---|
| $0.040449 | |
| $0.04 | |
| $0.04 | |
| $0.05 | |
| $0.05 |
How to use the Pixverse Swap API
View docsBuild with your agent
Give your agent the model details, code and documentation.
1Get your API key
Create API keyexport AIMLAPI_KEY="8f2b4c7d9a1e6b3f…"2Make your first request
curl 'https://api.aimlapi.com/v2/video/generations' \
-H "Authorization: Bearer $AIMLAPI_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "pixverse/swap",
"video_url": "https://example.com/input.mp3",
"image_url": "https://example.com/input.jpg"
}'import os
import requests
headers = {
"Authorization": f"Bearer {os.environ['AIMLAPI_KEY']}",
"Content-Type": "application/json",
}
payload = {
"model": "pixverse/swap",
"video_url": "https://example.com/input.mp3",
"image_url": "https://example.com/input.jpg"
}
response = requests.post("https://api.aimlapi.com/v2/video/generations", headers=headers, json=payload, timeout=120)
response.raise_for_status()
print(response.json())const response = await fetch("https://api.aimlapi.com/v2/video/generations", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AIMLAPI_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"model": "pixverse/swap",
"video_url": "https://example.com/input.mp3",
"image_url": "https://example.com/input.jpg"
}),
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.json());The request returns a generation id. Poll GET https://api.aimlapi.com/v2/video/generations?generation_id=<id> until the status is completed.
Related articles
Pixverse Swap FAQ
How much does Pixverse Swap cost?
Pixverse Swap costs $0.040449 / sec on AI/ML API.
What inputs does Pixverse Swap need?
It needs a source video and a reference image. The image provides the person, object or background that replaces the original.
How long can the source video be?
Pixverse states up to 30 seconds and 100 MB, with a longest side of at most 1920 pixels.
Can I get 1080p output?
No. Resolution accepts 360p, 540p or 720p, and Pixverse states that 1080p is not supported for Swap.
How do I control which subject is replaced?
Set keyframe time to a second of the source video, from 0 to 30, where the subject is clearly visible. It defaults to the first frame.
What is the Pixverse Swap model ID?
Use pixverse/swap as the model parameter. Requests go to https://api.aimlapi.com/v2/video/generations with your AI/ML API key.

