Skip to main content
POST
https://api.pikzels.com
/
v1
/
faceswap
curl --location --request POST 'https://api.pikzels.com/v1/faceswap' \
--header 'X-Api-Key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
  "image_url": "https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d",
  "face_url": "https://images.unsplash.com/photo-1438761681033-6461ffad8d80"
}'
{
  "output": "https://media.pikzels.com/temp/faceswap_3e4f5a6b7c8d.jpeg"
}
image_url
string
required
URL of the target image where face will be placed
face_url
string
required
URL of the source face image
persona
string
Optional persona ID from custom training. Use this instead of face_url to swap with your trained persona
curl --location --request POST 'https://api.pikzels.com/v1/faceswap' \
--header 'X-Api-Key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
  "image_url": "https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d",
  "face_url": "https://images.unsplash.com/photo-1438761681033-6461ffad8d80"
}'
{
  "output": "https://media.pikzels.com/temp/faceswap_3e4f5a6b7c8d.jpeg"
}

Common Errors

All errors return this JSON structure:
{
  "error": {
    "code": "ERROR_CODE_HERE",
    "message": "Human readable message",
    "details": "Additional context"
  }
}
Status CodeCodeDescription
400BAD_REQUESTInvalid or missing fields
400CONTENT_POLICY_VIOLATIONRequest violates content policy
401INVALID_AUTH_HEADERInvalid API Key
402INSUFFICIENT_BALANCENot enough credits
429CONCURRENT_LIMIT_EXCEEDEDToo many concurrent requests
500INTERNAL_ERRORServer problem
503MAINTENANCE_ACTIVEUnder maintenance

Endpoint-Specific Errors

Status CodeCodeDescription
400INVALID_ORIGINAL_IMAGETarget image is missing, corrupted, or contains no face
400INVALID_FACE_IMAGESource face image is missing, corrupted, or contains no face