POST/api/v1/character-swap

Identity Swapper

Rebuild the whole person across a clip, not just the face.

Give it a reference video and an image of a person. The person in the video is replaced (face, hair, clothes and build) while the reference's motion and scene are kept.

  • Returns a jobPoll it, or get a webhook
  • Failed jobs are freeThe whole hold comes back
  • Safe to retrySend an Idempotency-Key
curl -X POST https://api.kreatorsfactory.com/api/v1/character-swap \  -H "Authorization: Bearer $KREATORSFACTORY_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "video_key": "api/videos/…/scene.mp4",    "character_key": "api/images/…/person.png",    "resolution": "1k"  }'
The same scene before and after: the whole person has been replaced.
OriginalResult

How it works

  1. 1Upload your filesPOST /uploads returns a file_key for each one.
  2. 2Start the jobYou get an id and a status_url straight away.
  3. 3Wait for itPoll status_url, or let your callback_url hear about it.
  4. 4Download the resultoutput_url is a signed link. Keep your own copy.

Request parameters

Send JSON with Content-Type: application/json. Job endpoints also accept an optional Idempotency-Key header. See Safe Retries.

FieldTypeRequiredDescription
video_keystringYesfile_key of the reference video. Its motion is kept.
character_keystringYesfile_key of the image of the person to put in the video.
resolutionstringNo1k or 2k. Defaults to 1k.
callback_urlstringNoWe POST the result here when the job finishes, signed with your webhook secret. See Webhooks.

Response

Response200
{  "id": "7f3c2a9e-5b1d-4c8e-9a0f-2d6b1e4c7a31",  "status": "queued",  "status_url": "/api/v1/jobs/7f3c2a9e-5b1d-4c8e-9a0f-2d6b1e4c7a31"}

Every job endpoint answers with the same three fields. Poll status_url rather than building the path yourself; see Job Status for what it returns.

Errors

Every error arrives as {"error": {"code", "message"}}. Branch on code; the message may change. All errors.

HTTPCodeWhat it means
401unauthorizedMissing, unknown or revoked key.
402insufficient_balanceYour balance won't cover the estimated hold. Top up to continue.
400invalid_inputA field failed validation, or a file_key doesn't start with api/.
400capability_unavailableThis capability is switched off right now.
429rate_limitedYou're sending too fast. Back off and retry.
429at_capacityThe platform is briefly full. Retry shortly.
502 / 500internal_errorFailed on our side. Nothing is charged; retry, and tell us if it keeps happening.

These arrive inside error on a job that finished as failed, not as an HTTP status. A failed job is refunded in full.

Code on the jobWhat it means
face_not_detectedNo face was found in the input.
unsupported_formatThe file couldn't be decoded once work started.
input_too_largeOver a size or duration limit found during processing.
content_rejectedThe input or the result failed a content check.
processing_failedThe render didn't complete.

The whole round trip

Upload, start the job, and poll until it’s done.

# 1 · Upload each input (repeat per file) and keep its file_keyKEY=$(curl -s https://api.kreatorsfactory.com/api/v1/uploads \  -H "Authorization: Bearer $KREATORSFACTORY_API_KEY" \  -F "file=@input.mp4" | jq -r .file_key) # 2 · Start the job, with your file_keys in place of the …JOB=$(curl -s -X POST https://api.kreatorsfactory.com/api/v1/character-swap \  -H "Authorization: Bearer $KREATORSFACTORY_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "video_key": "api/videos/…/scene.mp4",    "character_key": "api/images/…/person.png",    "resolution": "1k"  }') # 3 · Poll status_url until status is succeeded or failedcurl -s "https://api.kreatorsfactory.com$(echo "$JOB" | jq -r .status_url)" \  -H "Authorization: Bearer $KREATORSFACTORY_API_KEY"