- Get Started
- Endpoints
- Song(Udio)
- Kling
- Hailuo
- Flux
- AI Hug
- LLM
- Midjourney
- Faceswap
- TTS
- Trellis
- Luma Dream Machine
- WanX
- Skyreels
- Framepack
- Hunyuan Video
- Mmaudio
- DiffRhythm
- Tools
- PiAPI Account Management
- Resources
- Legacy Documentation
Multi-face-swap
POST
https://api.piapi.ai/api/face_swap/v1/async
legacy/Face Swap
Overview#
This async endpoint from PiAPI's Faceswap API swaps the face from the
swap_image
to the target_image
.API | Task-type | Model | Description | Input Limitation |
---|---|---|---|---|
Multi-faceswap API | multi-face-swap | Qubico/image-toolkit | Swap faces in the target image sequentially using the chosen images. | Max 10MB, resolution under 2048x2048. |
Pricing#
Task-type | Pricing |
---|---|
multi-face-swap | $0.015 per use |
Request
Header Params
X-API-Key
string
required
Example:
{{x-api-key}}
Body Params application/json
target_image
string
required
swap_image
face.swap_image
string
required
target_image
face.result_type
string
optional
Example
{
"target_image": "Superman.png",
"swap_image": "Leonardo_Dicaprio.png",
"result_type": "url"
}
Request samples
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.piapi.ai/api/face_swap/v1/async' \
--header 'X-API-Key: {{x-api-key}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"target_image": "Superman.png",
"swap_image": "Leonardo_Dicaprio.png",
"result_type": "url"
}'
Responses
🟢200OK
application/json
Body
code
integer
optional
data
object
optional
task_id
string
optional
message
string
optional
Example
{
"code": 200,
"data": {
"task_id": "7a7ba527************1974d4316e22"
},
"message": "success"
}
🟠400Bad Request
🟠401Unauthorized
🔴500Server Error