Face Swap & Head Swap
face-swap and head-swap transplant a face — or a whole head — from a source photo onto the person
in a target photo. No prompt is needed.
https://llm.siraya.ai/v1/images/generations
Use /v1/images/generations
Both models take their images on the generations endpoint, not /v1/images/edits. The finished
image comes back in the same response — no polling. Generation typically takes 10–60 seconds.
Supported Models
| Model ID | Replaces | Source field | Output size |
|---|---|---|---|
face-swap |
the face | face_image |
follows the target image |
head-swap |
the whole head | head_image |
follows the target image |
Header
Bearer <API_KEY>).
Body
face-swap or head-swap.
0, for a random seed.
import requests
url = "https://llm.siraya.ai/v1/images/generations"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer <API_KEY>"
}
data = {
"model": "face-swap",
"image": "https://your-domain.com/target.jpg",
"face_image": "https://your-domain.com/source_face.jpg"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
Example Response
Behavior worth knowing
Both images need a real, detectable human face. Face detection runs on both inputs; cartoon or illustration-style faces fail it and the request ends in an error. Use photographs of people.
Image URLs must be public. Inputs are fetched by the model service itself; a URL behind authentication fails with a download error.
Prefer URLs over base64. The request-body size limit applies to the whole payload, and two base64 photos can exceed it.
Errors
A request-time refusal is final — retrying the same body won't help.
| Status | Meaning |
|---|---|
400 |
Parameter validation — a missing image, face_image or head_image — or no detectable face in an input |
401 |
Invalid API key |
404 |
Unrecognized model code |