Introduction
The video-edit stage replaces only heads listed in swap_targets. Supply the analysis_task_id from your own head analysis and associate each object_index with one to three portraits of the same replacement person. For each Video Head Swap target, use one to three sharp photographs showing the same person’s entire head and hair. Similar viewing angles and lighting give the replacement a more compatible starting point.
| Field | Value |
|---|---|
| Input | Video |
| Output | Video |
| Calls | Two: video-analyze, then video-edit |
| Clip length | 5 to 30 seconds |
| Resolution | 480p or 720p, identical in both calls |
| References | One to three photos per head, up to 10 heads per request |
| Authorisation | Only likenesses you are authorised to process |
Key features & highlights
You choose who changes
A head replacement carries the reference hairstyle and head outline into the shot. Choose this scope when changing facial features alone would leave the wrong hair on the character; review the neck transition and the moving hair together.
Request parameters
| Parameter | Required | Description |
|---|---|---|
analysis_task_id | Yes | The video-edit stage replaces only heads listed in |
swap_targets | Yes | The edit stage replaces only the heads you select. Point it at your own head analysis, then give each chosen head one to three portraits of the same replacement person. at least 1 items · at most 10 items |
video_url | No | Keep the analyzed clip and its resolution together throughout Video Head Swap. at least 1 characters |
resolution | No | Choose 480p or 720p for head analysis and reuse that choice for the edited clip. |
seed | No | For Video Head Swap comparisons, keep seed fixed while changing a single reference choice. |
Pricing
Video Head Swap has two charges: a flat analysis fee and a separate duration charge for replacement at the selected resolution. Editing uses full 5-second blocks of source footage, so 6 seconds is billed as 10 seconds. For Video Head Swap editing, the estimate uses an uploaded clip’s measured duration or a 30-second maximum for a video URL. Any difference is reconciled when the task is settled.
| Specification | Price |
|---|---|
| $0.064 / second |
| $0.12 / second |
Use cases
Recast a shot that already works
Use Video Head Swap to change a performer’s head after the costume, camera move and setting have been chosen. Inspect turns and neck edges across the whole clip before accepting the recast.
Any subject matter, with a consented performer
Video Head Swap is listed as unrestricted for NSFW video on SpicyAPI; the platform adds no separate content filter to this head replacement workflow. That classification does not remove the adult-only and informed-consent requirements.
One person through a generated series
For a series with the same authorized character, analyze each shot separately and reuse that character’s head references. Preview indices belong to their own analysis and must not be carried from one shot into another.
Crowds where only one person changes
In a shared shot, use the head previews to select the intended performer and leave the other indices out of swap_targets. This gives Video Head Swap a specific replacement list instead of treating everyone as a target.
Prompt guide & pro tips
Confirm you hold the rights to every head involved
Use Video Head Swap only for adult likenesses and footage you are authorized to edit. Obtain informed consent for the intended context; a publicly accessible portrait does not grant permission to impersonate or defame its subject.
Analyse first, then read the preview order
In the Video Head Swap previews,
object_indexcounts from zero: the first preview identifies target 0 and the next identifies target 1. Match a portrait to its preview rather than assuming the order follows where people stand.Keep the video and the resolution identical
Keep the analyzed clip and its resolution together throughout Video Head Swap. Omitting
video_urlduring editing reuses the analyzed video; an explicit URL must match, and resolution must also remain unchanged.
video-edit — Video Head Swap
The video-edit stage replaces only heads listed in swap_targets. Supply the analysis_task_id from your own head analysis and associate each object_index with one to three portraits of the same replacement person.
For each Video Head Swap target, use one to three sharp photographs showing the same person’s entire head and hair. Similar viewing angles and lighting give the replacement a more compatible starting point.
Keep the analyzed clip and its resolution together throughout Video Head Swap. Omitting video_url during editing reuses the analyzed video; an explicit URL must match, and resolution must also remain unchanged.
Video Head Swap accepts 5–30 second clips and offers 480p or 720p output. Up to 10 selected heads can be submitted for replacement, each using its own reference set; there is no 1080p option in this package.
Video Head Swap retains the source audio while replacing the selected heads. It does not ask you for a new voice track or dialogue, so review the edited picture alongside the existing sound.
For Video Head Swap comparisons, keep seed fixed while changing a single reference choice. Matching seeds do not promise identical frames; leave seed empty or use 0 to request a random draw.
Video Head Swap has two charges: a flat analysis fee and a separate duration charge for replacement at the selected resolution. Editing uses full 5-second blocks of source footage, so 6 seconds is billed as 10 seconds.
For Video Head Swap editing, the estimate uses an uploaded clip’s measured duration or a 30-second maximum for a video URL. Any difference is reconciled when the task is settled.
Use Video Head Swap only for adult likenesses and footage you are authorized to edit. Obtain informed consent for the intended context; a publicly accessible portrait does not grant permission to impersonate or defame its subject.
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/head-swap-video-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.

