Introduction
Recast the performer’s entire appearance while using the source shot as the motion and scene reference. Character Swap changes clothing and build as well as identity; Head Swap instead retains the original performer’s clothing and build. Character Swap carries the source audio into the edited video, preserving the existing dialogue or music rather than generating a new soundtrack.
| Field | Value |
|---|---|
| Input | Video |
| Output | Video |
| Calls | video-analyze → video-edit |
| Clip length | 5 to 30 seconds |
| Resolution | 480p / 720p; match the character analysis |
| References | 1–3 photos each; ≤10 replacement characters |
| Authorisation | Authorised adult likenesses only |
Key features & highlights
You choose who changes
Recast the performer’s entire appearance while using the source shot as the motion and scene reference. Character Swap changes clothing and build as well as identity; Head Swap instead retains the original performer’s clothing and build. Assign up to 10 detected people in swap_targets, with a separate set of 1–3 photos for each character. Omitted positions are outside the requested replacement set.
Request parameters
| Parameter | Required | Description |
|---|---|---|
analysis_task_id | Yes | The character analysis can be reused for replacement requests for 24 hours under the account that created it. After expiry, analyse the source again before trying another cast. at least 1 characters · at most 64 characters |
swap_targets | Yes | Assign up to 10 detected people in |
video_url | No | For a character replacement request, omit |
resolution | No | Character replacement requires the same source clip and matching resolution as its analysis; choose 480p or 720p for both stages. |
seed | No | For character-reference comparisons, keep seed fixed while changing one input; this does not guarantee identical frames. A seed of 0 asks for a random value. |
Pricing
Character replacement is charged against source duration in complete 5-second blocks at the selected resolution: 6 seconds is billed as 10 seconds. The initial estimate uses uploaded duration or the 30-second ceiling for a video URL; settlement releases any excess reservation.
| Specification | Price |
|---|---|
| $0.064 / second |
| $0.12 / second |
Use cases
Recast a shot without reshooting it
Try a different character design on an already planned walk or gesture, using the existing shot as the performance reference.
Any subject matter, with a consented performer
For authorised adult projects, review consent for the specific character replacement before attaching the reference photos.
One character through a generated series
To carry one character design through several clips, analyse each source separately and assign that character’s photos to the appropriate preview.
Crowds where only one person changes
In an ensemble shot, map only the performer being recast and inspect the finished video for continuity around neighbouring people.
Prompt guide & pro tips
Confirm you hold the rights to every person involved
Only recast adults whose likeness you are authorised to use, with consent covering the source footage, reference images and intended use. Keep that permission with the project; a publicly available photograph does not grant it, and impersonation or defamatory use is prohibited.
Analyse first, then read the preview order
For Character Swap, analyze the video before editing it: look through the returned previews and pick the people to replace by their place in that list. The first preview is number 0, not necessarily the person furthest left.
Show the replacement character’s outfit
Use reference photos that show the replacement character’s clothing and overall appearance from useful angles. A tightly cropped portrait gives Character Swap little information about the rest of the figure.
Video Character Swap · video-edit
Recast the performer’s entire appearance while using the source shot as the motion and scene reference. Character Swap changes clothing and build as well as identity; Head Swap instead retains the original performer’s clothing and build.
For Character Swap, run video-analyze before video-edit: inspect the returned previews and assign their zero-based positions in swap_targets. Position 0 means the first returned preview, not necessarily the person furthest left.
Use reference photos that show the replacement character’s clothing and overall appearance from useful angles. A tightly cropped portrait gives Character Swap little information about the rest of the figure.
Assign up to 10 detected people in swap_targets, with a separate set of 1–3 photos for each character. Omitted positions are outside the requested replacement set.
For a character replacement request, omit video_url to inherit the analysed footage. If supplied, its URL must match the analysis; use the same unmodified file rather than a new export.
Character replacement is charged against source duration in complete 5-second blocks at the selected resolution: 6 seconds is billed as 10 seconds. The initial estimate uses uploaded duration or the 30-second ceiling for a video URL; settlement releases any excess reservation.
Character Swap carries the source audio into the edited video, preserving the existing dialogue or music rather than generating a new soundtrack.
Only recast adults whose likeness you are authorised to use, with consent covering the source footage, reference images and intended use. Keep that permission with the project; a publicly available photograph does not grant it, and impersonation or defamatory use is prohibited.
For character-reference comparisons, keep seed fixed while changing one input; this does not guarantee identical frames. A seed of 0 asks for a random value.
API quick start
# Generate the idempotency key once; reuse it when retrying after a lost response.
export SPICY_IDEMPOTENCY_KEY="${SPICY_IDEMPOTENCY_KEY:-$(uuidgen)}"
curl -X POST https://api.spicyapi.ai/api/v1/jobs/createTask \
-H "Authorization: Bearer $SPICY_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $SPICY_IDEMPOTENCY_KEY" \
-d '{
"model": "spicyapi/character-swap-v1/video-edit",
"input": {
"analysis_task_id": "example",
"resolution": "720p",
"swap_targets": [
{
"image_urls": [
"example"
],
"object_index": 0
}
]
}
}'
# Copy data.taskId from the response into TASK_ID, then poll the status.
TASK_ID="TASK_ID_FROM_RESPONSE"
curl "https://api.spicyapi.ai/api/v1/jobs/recordInfo?taskId=$TASK_ID" \
-H "Authorization: Bearer $SPICY_API_KEY"
See the API reference for authentication, the complete schema, polling, and error handling.
