Submit
Create an image task
The response contains a task ID, not the final media. Parse it, then call the matching route with a taskId query parameter.
- Use
--fail-with-bodyto retain API error details. - Keep the key in an environment variable.
- Send actual file parts with
@path. - Do not retry a generation POST blindly after an ambiguous network failure.
curl --fail-with-body --request POST \
https://faceswapai.com/api/v1/face-swap/image \
--header "Authorization: Bearer $FACESWAPAI_API_KEY" \
--form "sourceImage=@source.jpg" \
--form "targetImage=@target.jpg" \
--form "consent=true"
Poll
Read task state from the matching route
curl --fail-with-body \
"https://faceswapai.com/api/v1/face-swap/image?taskId=TASK_ID" \
--header "Authorization: Bearer $FACESWAPAI_API_KEY"