API for Basic Face Swapper
Authentication
An API key is required for all requests. You can generate an API key from the developers tab in your dashboard.
Header Attributes
| Parameter | Value |
|---|---|
| X-source | web |
| X-api-key | YOUR_API_KEY |
Basic Face Swap
Request URL
| Method | URL |
|---|---|
| POST | http://aiapi.aiphotocraft.com/api/faceswap/basicswap (opens in a new tab) |
Body Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| srcimage | file | Your image with exactly one face | Yes* |
| targetimage | file | Your desired image with exactly one face | Yes* |
| enhance | string | Either 'true' or 'false'. Enhance the result after swap. | Yes* |
*Required parameters
Response
The API returns the processed image with the face swapped.
Response Content Type
application/json
Response Codes
| Code | Description |
|---|---|
| 201 | Swap successful |
| 400 | Bad request |
Example
curl -X POST \
http://aiapi.aiphotocraft.com/api/faceswap/basicswap \
-H 'X-source: web' \
-H 'X-api-key: YOUR_API_KEY' \
-F 'srcimage=@/path/to/source.jpg' \
-F 'targetimage=@/path/to/target.jpg' \
-F 'enhance=true'