Photo Head Swap
POST /api/v1/head-swap/submit
targetImageUrl is required and referenceImageUrls is required.
Required inputs
targetImageUrlstring- Publicly reachable URL of the target photo.
referenceImageUrlsstring[]- One to 4 publicly reachable head-reference image URLs, ordered to match the requested people.
Edit the sample inputs for your own task before submitting.
# Set VIDMAGE_IDEMPOTENCY_KEY to a unique value for this task; preserve it for transport retries.
curl -X POST "https://vidmage.ai/api/v1/head-swap/submit" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: ${VIDMAGE_IDEMPOTENCY_KEY}" \
-H "Content-Type: application/json" \
-d '{"targetImageUrl":"https://vidmage.ai/assets/images/samples/blue-eyed-woman-sunlight.webp","referenceImageUrls":["https://vidmage.ai/assets/images/samples/smiling-man-sweater.webp"],"aspectRatio":"1:1"}'
# -> { "success": true, "taskId": "...", "creditsConsumed": ... }Parameters and input rules4 fields
| Field | Type | Required | Default | Meaning and limits |
|---|---|---|---|---|
targetImageUrl | string | Yes | Not specified | Publicly reachable URL of the target photo. No additional field constraint listed. |
referenceImageUrls | string[] | Yes | Not specified | One to 4 publicly reachable head-reference image URLs, ordered to match the requested people. Minimum items: 1 · Maximum items: 4 |
customPrompt | string | No | Not specified | Optional targeting instructions that identify which person or people to replace and map them to Reference 1 through Reference 4. Maximum length: 1000 |
aspectRatio | string | No | "1:1" | Output aspect ratio. Values: "3:2", "2:3", "16:9", "9:16", "4:3", "3:4", "1:1" · Default: "1:1" |
Retrieve the result
Save taskId from the accepted submission and send it to this endpoint:
POST /api/v1/head-swap/query
Use the same Bearer API key. On completion, read the imageUrl result field.
curl -X POST "https://vidmage.ai/api/v1/head-swap/query" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "taskId": "TASK_ID_FROM_SUBMIT" }'
# -> { "success": true, "data": { "status": "...", "imageUrl": "https://..." } }

