Saltar al contenido principal
POST
/
face
/
swap
Face swap based on the provided image.
curl --request POST \
  --url https://api.acedata.cloud/face/swap \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "timeout": 123,
  "callback_url": "<string>",
  "async": true,
  "source_image_url": "https://i.ibb.co/m9BFL9J/ad61a39afd9079e57a5908c0bd9dd995.jpg",
  "target_image_url": "https://i.ibb.co/LnLYwhR/66f41e64b1922.jpg"
}
'
import requests

url = "https://api.acedata.cloud/face/swap"

payload = {
"timeout": 123,
"callback_url": "<string>",
"async": True,
"source_image_url": "https://i.ibb.co/m9BFL9J/ad61a39afd9079e57a5908c0bd9dd995.jpg",
"target_image_url": "https://i.ibb.co/LnLYwhR/66f41e64b1922.jpg"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
timeout: 123,
callback_url: '<string>',
async: true,
source_image_url: 'https://i.ibb.co/m9BFL9J/ad61a39afd9079e57a5908c0bd9dd995.jpg',
target_image_url: 'https://i.ibb.co/LnLYwhR/66f41e64b1922.jpg'
})
};

fetch('https://api.acedata.cloud/face/swap', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
{
  "success": true,
  "task_id": "<string>",
  "image_url": "<string>",
  "image_width": "<string>",
  "image_height": "<string>"
}
{
"error": {
"code": "token_mismatched",
"message": "The specified token is not matched with API."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}
{
"error": {
"code": "invalid_token",
"message": "The specified token is invalid or wrong."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}
{
"error": {
"code": "forbidden",
"message": "Sorry! Our Al moderators feel your prompt might be against our community standards."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}
{
"error": {
"code": "too_many_requests",
"message": "You have exceeded the rate limit."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}
{
"error": {
"code": "api_error",
"message": "Internal server error."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}
{
"error": {
"code": "timeout",
"message": "Timeout to generate the image."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}

Autorizaciones

Authorization
string
header
requerido

Encabezados

accept
enum<string>

Face Swap Param Accept

Opciones disponibles:
application/json,
application/x-ndjson

Cuerpo

application/json
timeout
number

Face Swap Timeout

callback_url
string

Face Swap Callback Url

async
boolean

Face Swap Async

source_image_url
string

Face Swap Source Image Url

Ejemplo:

"https://i.ibb.co/m9BFL9J/ad61a39afd9079e57a5908c0bd9dd995.jpg"

target_image_url
string

Face Swap Target Image Url

Ejemplo:

"https://i.ibb.co/LnLYwhR/66f41e64b1922.jpg"

Respuesta

Face Swap Response 200

success
boolean

Face Swap Response 200 Success

task_id
string

Face Swap Response 200 Task Id

image_url
string

Face Swap Response 200 Image Url

image_width
string

Face Swap Response 200 Image Width

image_height
string

Face Swap Response 200 Image Height