Perfect AI API (2.0)

Download OpenAPI specification:Download

API Document

The Perfect AI APIs are a series of AI effects that let you beautify your photos, as well as generate amazing aesthetic creations beyond human imagination. Let the magic begin.

PLEASE NOTE that by reading this API documentation, or by setting up code pursuant to the instructions in this API documentation, you acknowledge it adheres to Perfect Corp's Privacy policy, and Terms of Service. If you have any issues, please contact our customer success team. We are very glad to help.

Perfect AI API

Introduction

Perfect AI API is a powerful and easy-to-use AI platform that provides beautiful and true-to-life visual effects thanks to the latest AI technology. This API document will briefly introduce how to integrate these awesome AI effects into your business. Perfect AI APIs are standard RESTful APIs to let you easily integrate into your website, e-commerce platforms, iOS/Android apps, applets, mini-programs, and more.

Perfect AI API

API Server

The Perfect AI APIs are built on top of RESTful web APIs. The API server is the host of all APIs. Once you complete the authentication, you can start your AI tasks through the API Server.

Rate Limit

To ensure fair usage and prevent abuse, our API implements rate limiting. There are two types of rate limits:

  • Per IP Address

    Each IP address is allowed a maximum of 100 requests per 5 minutes. If this limit is exceeded, subsequent requests will receive a 429 Too Many Requests error.

  • Per Access Token

    Each access token is allowed a maximum of 100 requests per minute. If this limit is exceeded, subsequent requests will receive a 429 Too Many Requests error.

Both conditions must be met for a request to be accepted. If either condition is not met, the request will receive a 429 Too Many Requests error. Please note that each query related to credit will be processed in real-time. Other APIs can use the access token until expires.

It is recommended that you handle rate limit errors gracefully in your application by implementing the appropriate backoff and retry mechanisms.

Quick start guide

First, you need to go to the Perfect Console to get your API keys to start using the Perfect AI API.

Once you generate your API Key, you can use the API key and Secret key to complete the authentication and start using the AI APIs as defined in the later sections. The available credits to be used to query APIs are determined by your business plan. Please find our customer success team if there is any question. Please note that your credits will be consumed when the resulting image is successfully generated.

Let's consider an example usage flow of an AI Hairstyle Virtual Try-On API calling sequence. After successfully authorizing and getting the access_token, you can call 'file/hair-style' to acquire the upload URL and a File ID associated with it. So that You can upload your photo to the upload URL and use the File ID to run an AI task.

AI Hairstyle Virtual Try-On

You can either list the style groups and styles inside a style group or obtain a style ID from the Perfect Console to get a specific style ID to be applied virtually.

Subsequently, calling POST 'task/hair-style' with the File ID and a style ID executes the AI hairstyle generator task and obtains a task ID.

This task ID is used to monitor the task's status by polling GET 'task/hair-style' to retrieve the current engine status. Until the engine completes the task, the status will remain 'running', and no credits will be consumed during this stage.

AI Wig Virtual Try-On

The task will change to the 'success' status after the engine successfully processes your input file and generates the resulting image. Your credits will only be consumed in this case. If the engine fails to process the task, the task's status will change to 'error' and no credits will be consumed.

When deducting credits, the system will prioritize those nearing expiration. If the expiration date is the same, it will deduct the credits obtained on the earliest date.

File Retention Period

All uploaded files are kept on the server for one day and deleted automatically after they are expired. The resulting files generated by the system are kept on the server for 30 days and deleted automatically after they are generated.

Supported Formats & Dimensions

AI Editing & Enhance Supported Dimensions Supported File Size Supported Formats
AI Photo Enhance 4096x4096 (long side <= 4096) < 10MB jpg/png/heic
AI Video Enhance input: long side <= 1920; output: max 2x input resolution <100MB container: mov, mp4; video codec: MPEG-4, H.264 AVC; audio codec: aac, mp3
AI Object Removal 4096x4096 (long side <= 4096) < 10MB jpg/png/heic
Al Photo Background Removal 4096x4096 (long side <= 4096) < 10MB jpg/png/heic
AI Photo Background Change 4096x4096 (long side <= 4096) < 10MB jpg/png/heic
AI Photo Background Blur 4096x4096 (long side <= 4096) < 10MB jpg/png/heic
AI Photo Colorize 4096x4096 (long side <= 4096) < 10MB jpg/png
AI Photo Lighting 4096x4096 (long side <= 4096, short side >= 256) < 10MB jpg/png
AI Photo Color Correction 4096x4096 (long side <= 4096) < 10MB jpg/png
AI Replace long side <= 2048, short side <= 1024 < 10MB jpg/png
Generative AI Supported Dimensions Supported File Size Supported Formats
AI Image Generator 1024x1024 (long side <= 1024) < 10MB jpg/png
AI Hairstyle Generator long side <= 1024, face width >= 128, face pose: -10 < pitch < +10, -45 < yaw < +45, -15 < roll < +15 < 10MB jpg
AI Hair Extension long side <= 1024, face width >= 128, face pose: -10 < pitch < +10, -45 < yaw < +45, -15 < roll < +15 < 10MB jpg/png
AI Hair Bang Generator long side <= 1024, face width >= 128, face pose: -10 < pitch < +10, -45 < yaw < +45, -15 < roll < +15 < 10MB jpg/png
AI Hair Volume Generator long side <= 1024, face width >= 128, face pose: -10 < pitch < +10, -45 < yaw < +45, -15 < roll < +15 < 10MB jpg/png
Face AI Supported Dimensions Supported File Size Supported Formats
AI Makeup Transfer 1024x1024 (long side <= 1024) < 10MB jpg/png/heic
AI Face Swap 4096x4096 (long side <= 4096) < 10MB jpg/png

Error Codes

  • Successful responses (100 - 399)
  • Client error responses (400 - 499)
  • Server error response (500 - 599)
Error Code description
exceed_max_filesize Input file size exceeds the maximum limit
invalid_parameter Invalid parameter value
error_download_image Download source image error
error_download_mask Download mask image error
error_decode_image Decode source image error
error_decode_mask Decode mask image error
error_nsfw_content_detected NSFW content detected in source image
error_no_face No face detected on source image
error_pose Failed to detect pose on source image
error_face_parsing Failed to do face segmentation on source image
error_inference Inference pipeline error
exceed_nsfw_retry_limits Exceed the retry limits to avoid generated NSFW image
error_upload Upload result image error
error_multiple_people Multiple people detected in the source image
error_no_shoulder Shoulders are not visible in the source image
error_large_face_angle The face angle in the uploaded image is too large
unknown_internal_error Others

FAQ

For more information and questions, please refer to our blog page for reference. Or send an e-mail to our customer success team. We are very happy to help. ;)

Last modified: Jan. 10 2025 e526e25

Authentication

Authentication with Perfect API server.

Authenticate and obtain access_token

Request Body schema: application/json
required
client_id
required
string

The name of api key

id_token
required
string

Encrypted client_id=<client_id>&timestamp=<timestamp in millisecond> with RSA X.509 format Base64 encoded client_secret to obtain id_token

Responses

Response Schema: application/json
status
integer

Response status

object
access_token
string

The access token valid for 2 hours. Pass this as Bearer token to call other APIs

Request samples

Content type
application/json
{
  • "client_id": "BMIL1PIJjCV96JlSl64RlVksHK1cD0PQ",
  • "id_token": "dMtD+7WpLVe8Z1sdJAQ6GhuJBI+YeR79+FVNspLjEsfMIpfiXmdyskjAPEFgCwseJJozqZeIPjtZi8f5ttSHjCYjnZaYI5mhGU4IGdGofAVcwIBA5UJ/FQcoXh29S2ZG66uKUcnyNnbEW9iu1vha/juy7IRvafOQ3Yx4nxbmrEM="
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

AI Hairstyle Generator

AI Hairstyle Generator

This AI API allows you to experiment with hairstyles virtually using your web browser.

You can find all supported hairstyles on the Perfect Console first. The API also provides the ability to list all predefined style groups like women's, short, long etc. And you can list styles under one specific style group as well. You can then run an AI Hairstyle Generator task with a style ID. Finally, you can retrieve the download URL of the generated result through the response of a check the status query.

Want to see more Hair styles? Please refer to https://yce.perfectcorp.com/ai-hairstyle-generator.

Use case: AI Hairstyle Generator

AI Hairstyle Generator

Suggestions for How to Shoot: Suggestions for How to Shoot

Create a new file.

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
required
Array of objects
Array
content_type
required
string
Enum: "image/jpg" "image/jpeg" "image/png"

Content MIME type for this file. Currently available values are listed in the enum.

file_name
required
string

Name of this file

Responses

Response Schema: application/json
status
integer

Response status

object
Array of objects
Array
content_type
string

Content MIME type for this file.

file_name
string

Name of this file

file_id
string

ID of this file. Other run task API will need this file_id.

Array of objects

Using upload url, headers, method below to upload file. After completion, the file_id is used to proceed with calling run task API.

Array
headers
object

Headers to include when uploading the file

url
string

URL to upload this file

method
string

HTTP method to upload this file

Request samples

Content type
application/json
{
  • "files": [
    ]
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

List predefined style groups for AI Hairstyle Generator task

Authorizations:
BearerAuthentication
query Parameters
page_size
integer
Example: page_size=20

Number of results to return in this page. Valid value should be between 1 and 20. Default 20.

starting_token
string
Example: starting_token=13045969587275114

Token for current page. Start with null for the first page, and use next_token from the previous response to start next page

Responses

Response Schema: application/json
status
integer

Response status

object
next_token
string

Token to query next page.

Array of objects
Array
id
integer

ID of style group

object
title
string

Title of this style group

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

List predefined style for AI Hairstyle Generator task

Authorizations:
BearerAuthentication
query Parameters
page_size
integer
Example: page_size=20

Number of results to return in this page. Valid value should be between 1 and 20. Default 20.

starting_token
string
Example: starting_token=13045969587275114

Token for current page. Start with null for the first page, and use next_token from the previous response to start next page

style_group_id
integer
Example: style_group_id=18213963761051864

The id of style group

Responses

Response Schema: application/json
status
integer

Response status

object
next_token
string

Token to query next page.

Array of objects
Array
id
integer

ID of style

object
title
string

Title of this style

thumb
string

Thumbnail url for this parameter

Response samples

Content type
application/json
{}

Run a AI Hairstyle Generator task

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
request_id
required
integer

Incremental request number starting from 0. Requests with the same request_id will be ignored by the server. request_id should remain the same if the API client needs to retry the API due to a connection issue. This is to prevent duplicate deduction of credits caused by running the same task repeatedly. For instance, if the same file_id is sent with the same request_id, the engine won't re-run the task, nor will duplicate consume credits. However, if a client wants to generate multiple different results using the same file_id, the client needs to increment the request_id then the engine will re-run the task and consume the credit accordingly.

required
object
required
object
src_ids
required
Array of strings

ID of file to apply hair style. File ID from upload file API. For hair style task, only accept 1 file.

required
Array of objects

Only accept 1 action.

Array
id
required
integer

ID of this action, start with 0. The client needs to generate an id for each action. This action id has to be unique per task. In the response from the get status API, these action id will be used to let the client know which results correspond to each action.

required
object
style_group_id
required
integer

Id of style group

style_ids
required
Array of numbers

Id of style to run the task. Only accept 1 style.

output_ext
string
Value: "jpg"

The format of the output file.

Responses

Response Schema: application/json
status
integer

Response status

object
task_id
string

ID of this task. This task_id will only valid if client continue polling check status API with interval polling_interval defined in check status API response. Otherwise, engine might consider client have leave and will not process the task. No credit will be consumed in this case.

Request samples

Content type
application/json
{
  • "request_id": 0,
  • "payload": {
    }
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Check the status of a AI Hairstyle Generator task

Authorizations:
BearerAuthentication
query Parameters
task_id
string
Example: task_id=SX9ALF1Z+KIiNa+GaFRp4bI5gijoc/ckI2teebLq35Bo1Nwc++3iXXdKqnU4/LID

ID of task to check

Responses

Response Schema: application/json
status
integer

Response status

object
polling_interval
integer

Milliseconds waiting time for start next polling. Note that the task will lose if no polling in 10 seconds

status
string
Enum: "running" "success" "error"

Status of this task

error
string

Error of this task. Available only when the task status is error

Array of objects
Array
id
integer

ID of action

Array of objects
Array
dst_id
string

File ID of the result file is used for integrating other task. No need to reupload file.

url
string

URL to download this result. Valid for 2 hours

Response samples

AI Wig Generator

AI Wig Generator

AI Wig Generator is an API to lets you explore long, short and middle lengths, bangs, as well as different hair types - from straight, wavy and curly to coily.

AI Wig Generator

Create a new file.

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
required
Array of objects
Array
content_type
required
string
Enum: "image/jpg" "image/jpeg" "image/png"

Content MIME type for this file. Currently available values are listed in the enum.

file_name
required
string

Name of this file

Responses

Response Schema: application/json
status
integer

Response status

object
Array of objects
Array
content_type
string

Content MIME type for this file.

file_name
string

Name of this file

file_id
string

ID of this file. Other run task API will need this file_id.

Array of objects

Using upload url, headers, method below to upload file. After completion, the file_id is used to proceed with calling run task API.

Array
headers
object

Headers to include when uploading the file

url
string

URL to upload this file

method
string

HTTP method to upload this file

Request samples

Content type
application/json
{
  • "files": [
    ]
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

List predefined style groups for AI Wig Generator task

Authorizations:
BearerAuthentication
query Parameters
page_size
integer
Example: page_size=20

Number of results to return in this page. Valid value should be between 1 and 20. Default 20.

starting_token
string
Example: starting_token=13045969587275114

Token for current page. Start with null for the first page, and use next_token from the previous response to start next page

Responses

Response Schema: application/json
status
integer

Response status

object
next_token
string

Token to query next page.

Array of objects
Array
id
integer

ID of style group

object
title
string

Title of this style group

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

List predefined style for AI Wig Generator task

Authorizations:
BearerAuthentication
query Parameters
page_size
integer
Example: page_size=20

Number of results to return in this page. Valid value should be between 1 and 20. Default 20.

starting_token
string
Example: starting_token=13045969587275114

Token for current page. Start with null for the first page, and use next_token from the previous response to start next page

style_group_id
integer
Example: style_group_id=18213963761051864

The id of style group

Responses

Response Schema: application/json
status
integer

Response status

object
next_token
string

Token to query next page.

Array of objects
Array
id
integer

ID of style

object
title
string

Title of this style

thumb
string

Thumbnail url for this parameter

Response samples

Content type
application/json
{}

Run a AI Wig Generator task

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
request_id
required
integer

Incremental request number starting from 0. Requests with the same request_id will be ignored by the server. request_id should remain the same if the API client needs to retry the API due to a connection issue. This is to prevent duplicate deduction of credits caused by running the same task repeatedly. For instance, if the same file_id is sent with the same request_id, the engine won't re-run the task, nor will duplicate consume credits. However, if a client wants to generate multiple different results using the same file_id, the client needs to increment the request_id then the engine will re-run the task and consume the credit accordingly.

required
object
required
object
src_ids
required
Array of strings

ID of file to apply wig style. File ID from upload file API. For wig task, only accept 1 file.

required
Array of objects

Only accept 1 action.

Array
id
required
integer

ID of this action, start with 0. The client needs to generate an id for each action. This action id has to be unique per task. In the response from the get status API, these action id will be used to let the client know which results correspond to each action.

required
object
style_group_id
required
integer

Id of style group

style_ids
required
Array of numbers

Id of style to run the task. Only accept 1 style.

output_ext
string
Value: "jpg"

The format of the output file.

Responses

Response Schema: application/json
status
integer

Response status

object
task_id
string

ID of this task. This task_id will only valid if client continue polling check status API with interval polling_interval defined in check status API response. Otherwise, engine might consider client have leave and will not process the task. No credit will be consumed in this case.

Request samples

Content type
application/json
{
  • "request_id": 0,
  • "payload": {
    }
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Check the status of a AI Wig Generator task

Authorizations:
BearerAuthentication
query Parameters
task_id
string
Example: task_id=SX9ALF1Z+KIiNa+GaFRp4bI5gijoc/ckI2teebLq35Bo1Nwc++3iXXdKqnU4/LID

ID of task to check

Responses

Response Schema: application/json
status
integer

Response status

object
polling_interval
integer

Milliseconds waiting time for start next polling. Note that the task will lose if no polling in 10 seconds

status
string
Enum: "running" "success" "error"

Status of this task

error
string

Error of this task. Available only when the task status is error

Array of objects
Array
id
integer

ID of action

Array of objects
Array
dst_id
string

File ID of the result file is used for integrating other task. No need to reupload file.

url
string

URL to download this result. Valid for 2 hours

Response samples

AI Hair Extension

AI Hair Extension

Discover Your Perfect Hair Extension Match with AI​ Experiment with a variety of lengths—from long to extra-long—styles, colors, and bangs, all from the comfort of your device. No more guessing games—see exactly how each hair extension style looks on you with the advanced Generative AI. Make informed styling decisions before committing to a new look.​ With the advanced Hair Extension Try-On, which naturally blends with your current hair length, it’s the perfect time to experiment with super-long styles.

Use case: AI Hair Extension

AI Hair Extension

Suggestions for How to Shoot: Suggestions for How to Shoot

Create a new file.

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
required
Array of objects
Array
content_type
required
string
Enum: "image/jpg" "image/jpeg" "image/png"

Content MIME type for this file. Currently available values are listed in the enum.

file_name
required
string

Name of this file

Responses

Response Schema: application/json
status
integer

Response status

object
Array of objects
Array
content_type
string

Content MIME type for this file.

file_name
string

Name of this file

file_id
string

ID of this file. Other run task API will need this file_id.

Array of objects

Using upload url, headers, method below to upload file. After completion, the file_id is used to proceed with calling run task API.

Array
headers
object

Headers to include when uploading the file

url
string

URL to upload this file

method
string

HTTP method to upload this file

Request samples

Content type
application/json
{
  • "files": [
    ]
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

List predefined style groups for AI Hair Extension task

Authorizations:
BearerAuthentication
query Parameters
page_size
integer
Example: page_size=20

Number of results to return in this page. Valid value should be between 1 and 20. Default 20.

starting_token
string
Example: starting_token=13045969587275114

Token for current page. Start with null for the first page, and use next_token from the previous response to start next page

Responses

Response Schema: application/json
status
integer

Response status

object
next_token
string

Token to query next page.

Array of objects
Array
id
integer

ID of style group

object
title
string

Title of this style group

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

List predefined style for AI Hair Extension task

Authorizations:
BearerAuthentication
query Parameters
page_size
integer
Example: page_size=20

Number of results to return in this page. Valid value should be between 1 and 20. Default 20.

starting_token
string
Example: starting_token=13045969587275114

Token for current page. Start with null for the first page, and use next_token from the previous response to start next page

style_group_id
integer
Example: style_group_id=18213963761051864

The id of style group

Responses

Response Schema: application/json
status
integer

Response status

object
next_token
string

Token to query next page.

Array of objects
Array
id
integer

ID of style

object
title
string

Title of this style

thumb
string

Thumbnail url for this parameter

Response samples

Content type
application/json
{}

Run a AI Hair Extension task

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
request_id
integer

Incremental request number starting from 0. Requests with the same request_id will be ignored by the server. request_id should remain the same if the API client needs to retry the API due to a connection issue. This is to prevent duplicate deduction of credits caused by running the same task repeatedly. For instance, if the same file_id is sent with the same request_id, the engine won't re-run the task, nor will duplicate consume credits. However, if a client wants to generate multiple different results using the same file_id, the client needs to increment the request_id then the engine will re-run the task and consume the credit accordingly.

object
required
Array of objects

Only accept 1 action.

Array
id
required
integer

ID of this action, start with 0. The client needs to generate an id for each action. This action id has to be unique per task. In the response from the get status API, these action id will be used to let the client know which results correspond to each action.

required
object
style_group_id
required
integer

Id of style group

style_ids
required
Array of numbers

Id of style to run the task. Only accept 1 style.

required
object
src_ids
required
Array of strings

ID of file to apply hair extension. File ID from upload file API

output_ext
string
Value: "jpg"

The format of the output file.

Responses

Response Schema: application/json
status
integer

Response status

object
task_id
string

ID of this task. This task_id will only valid if client continue polling check status API with interval polling_interval defined in check status API response. Otherwise, engine might consider client have leave and will not process the task. No credit will be consumed in this case.

Request samples

Content type
application/json
{
  • "request_id": 0,
  • "payload": {
    }
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Check the status of a AI Hair Extension task

Authorizations:
BearerAuthentication
query Parameters
task_id
string
Example: task_id=SX9ALF1Z+KIiNa+GaFRp4bI5gijoc/ckI2teebLq35Bo1Nwc++3iXXdKqnU4/LID

ID of task to check

Responses

Response Schema: application/json
status
integer

Response status

object
polling_interval
integer

Milliseconds waiting time for start next polling. Note that the task will lose if no polling in 10 seconds

status
string
Enum: "running" "success" "error"

Status of this task

error
string

Error of this task. Available only when the task status is error

Array of objects
Array
id
integer

ID of action

Array of objects
Array
dst_id
string

File ID of the result file is used for integrating other task. No need to reupload file.

url
string

URL to download this result. Valid for 2 hours

Response samples

AI Hair Bang Generator

AI Hair Bang Generator

Try on Your Perfect Hair Bangs with AI Realistic Looks: Experiment with realistic bangs and discover the style that best complements your face.​ Versatile Styling Options: Explore a wide range of bangs styles to suit every personality and occasion.​ Effortless Experience: Enjoy a user-friendly interface that makes trying new bangs easy and fun​.

Want to see more Hair Bang styles? Please refer to https://yce.perfectcorp.com/bangs-filter.

Use case:

AI Hair Bang Generator

AI Hair Bang Generator

Suggestions for How to Shoot: Suggestions for How to Shoot

Create a new file.

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
required
Array of objects
Array
content_type
required
string
Enum: "image/jpg" "image/jpeg" "image/png"

Content MIME type for this file. Currently available values are listed in the enum.

file_name
required
string

Name of this file

Responses

Response Schema: application/json
status
integer

Response status

object
Array of objects
Array
content_type
string

Content MIME type for this file.

file_name
string

Name of this file

file_id
string

ID of this file. Other run task API will need this file_id.

Array of objects

Using upload url, headers, method below to upload file. After completion, the file_id is used to proceed with calling run task API.

Array
headers
object

Headers to include when uploading the file

url
string

URL to upload this file

method
string

HTTP method to upload this file

Request samples

Content type
application/json
{
  • "files": [
    ]
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

List predefined style groups for AI Hair Bang Generator task

Authorizations:
BearerAuthentication
query Parameters
page_size
integer
Example: page_size=20

Number of results to return in this page. Valid value should be between 1 and 20. Default 20.

starting_token
string
Example: starting_token=13045969587275114

Token for current page. Start with null for the first page, and use next_token from the previous response to start next page

Responses

Response Schema: application/json
status
integer

Response status

object
next_token
string

Token to query next page.

Array of objects
Array
id
integer

ID of style group

object
title
string

Title of this style group

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

List predefined style for AI Hair Bang Generator task

Authorizations:
BearerAuthentication
query Parameters
page_size
integer
Example: page_size=20

Number of results to return in this page. Valid value should be between 1 and 20. Default 20.

starting_token
string
Example: starting_token=13045969587275114

Token for current page. Start with null for the first page, and use next_token from the previous response to start next page

style_group_id
integer
Example: style_group_id=18213963761051864

The id of style group

Responses

Response Schema: application/json
status
integer

Response status

object
next_token
string

Token to query next page.

Array of objects
Array
id
integer

ID of style

object
title
string

Title of this style

thumb
string

Thumbnail url for this parameter

Response samples

Content type
application/json
{}

Run a AI Hair Bang Generator task

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
request_id
integer

Incremental request number starting from 0. Requests with the same request_id will be ignored by the server. request_id should remain the same if the API client needs to retry the API due to a connection issue. This is to prevent duplicate deduction of credits caused by running the same task repeatedly. For instance, if the same file_id is sent with the same request_id, the engine won't re-run the task, nor will duplicate consume credits. However, if a client wants to generate multiple different results using the same file_id, the client needs to increment the request_id then the engine will re-run the task and consume the credit accordingly.

object
required
Array of objects

Only accept 1 action.

Array
id
required
integer

ID of this action, start with 0. The client needs to generate an id for each action. This action id has to be unique per task. In the response from the get status API, these action id will be used to let the client know which results correspond to each action.

required
object
style_group_id
required
integer

Id of style group

style_ids
required
Array of numbers

Id of style to run the task. Only accept 1 style.

required
object
src_ids
required
Array of strings

ID of file to apply hair bang generator. File ID from upload file API

output_ext
string
Value: "jpg"

The format of the output file.

Responses

Response Schema: application/json
status
integer

Response status

object
task_id
string

ID of this task. This task_id will only valid if client continue polling check status API with interval polling_interval defined in check status API response. Otherwise, engine might consider client have leave and will not process the task. No credit will be consumed in this case.

Request samples

Content type
application/json
{
  • "request_id": 0,
  • "payload": {
    }
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Check the status of a AI Hair Bang Generator task

Authorizations:
BearerAuthentication
query Parameters
task_id
string
Example: task_id=SX9ALF1Z+KIiNa+GaFRp4bI5gijoc/ckI2teebLq35Bo1Nwc++3iXXdKqnU4/LID

ID of task to check

Responses

Response Schema: application/json
status
integer

Response status

object
polling_interval
integer

Milliseconds waiting time for start next polling. Note that the task will lose if no polling in 10 seconds

status
string
Enum: "running" "success" "error"

Status of this task

error
string

Error of this task. Available only when the task status is error

Array of objects
Array
id
integer

ID of action

Array of objects
Array
dst_id
string

File ID of the result file is used for integrating other task. No need to reupload file.

url
string

URL to download this result. Valid for 2 hours

Response samples

AI Hair Volume Generator

AI Hair Volume Generator

Enhance Your Look with Fuller, More Voluminous Hair Instantly!​ Add natural volume to fine or thinning hair. Seamlessly fill gaps or add hair with AI. Works for all hair types: straight, curly, thin. Perfect for dating profiles, resumes & more. Our AI tool helps you achieve perfect hair volume and density in all your photos, whether for personal, professional, or social use. Say goodbye to bad hair days in pictures and hello to fresh, voluminous hair every time.

Use case: AI Hair Volume Generator

AI Hair Volume Generator

Suggestions for How to Shoot: Suggestions for How to Shoot

Create a new file.

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
required
Array of objects
Array
content_type
required
string
Enum: "image/jpg" "image/jpeg" "image/png"

Content MIME type for this file. Currently available values are listed in the enum.

file_name
required
string

Name of this file

Responses

Response Schema: application/json
status
integer

Response status

object
Array of objects
Array
content_type
string

Content MIME type for this file.

file_name
string

Name of this file

file_id
string

ID of this file. Other run task API will need this file_id.

Array of objects

Using upload url, headers, method below to upload file. After completion, the file_id is used to proceed with calling run task API.

Array
headers
object

Headers to include when uploading the file

url
string

URL to upload this file

method
string

HTTP method to upload this file

Request samples

Content type
application/json
{
  • "files": [
    ]
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

List predefined style groups for AI Hair Volume task

Authorizations:
BearerAuthentication
query Parameters
page_size
integer
Example: page_size=20

Number of results to return in this page. Valid value should be between 1 and 20. Default 20.

starting_token
string
Example: starting_token=13045969587275114

Token for current page. Start with null for the first page, and use next_token from the previous response to start next page

Responses

Response Schema: application/json
status
integer

Response status

object
next_token
string

Token to query next page.

Array of objects
Array
id
integer

ID of style group

object
title
string

Title of this style group

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

List predefined style for AI Hair Volume Generator task

Authorizations:
BearerAuthentication
query Parameters
page_size
integer
Example: page_size=20

Number of results to return in this page. Valid value should be between 1 and 20. Default 20.

starting_token
string
Example: starting_token=13045969587275114

Token for current page. Start with null for the first page, and use next_token from the previous response to start next page

style_group_id
integer
Example: style_group_id=18213963761051864

The id of style group

Responses

Response Schema: application/json
status
integer

Response status

object
next_token
string

Token to query next page.

Array of objects
Array
id
integer

ID of style

object
title
string

Title of this style

thumb
string

Thumbnail url for this parameter

Response samples

Content type
application/json
{}

Run a AI Hair Volume Generator task

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
request_id
integer

Incremental request number starting from 0. Requests with the same request_id will be ignored by the server. request_id should remain the same if the API client needs to retry the API due to a connection issue. This is to prevent duplicate deduction of credits caused by running the same task repeatedly. For instance, if the same file_id is sent with the same request_id, the engine won't re-run the task, nor will duplicate consume credits. However, if a client wants to generate multiple different results using the same file_id, the client needs to increment the request_id then the engine will re-run the task and consume the credit accordingly.

object
required
Array of objects

Only accept 1 action.

Array
id
required
integer

ID of this action, start with 0. The client needs to generate an id for each action. This action id has to be unique per task. In the response from the get status API, these action id will be used to let the client know which results correspond to each action.

required
object
style_group_id
required
integer

Id of style group

style_ids
required
Array of numbers

Id of style to run the task. Only accept 1 style.

required
object
src_ids
required
Array of strings

ID of file to apply hair volume generator. File ID from upload file API

output_ext
string
Value: "jpg"

The format of the output file.

Responses

Response Schema: application/json
status
integer

Response status

object
task_id
string

ID of this task. This task_id will only valid if client continue polling check status API with interval polling_interval defined in check status API response. Otherwise, engine might consider client have leave and will not process the task. No credit will be consumed in this case.

Request samples

Content type
application/json
{
  • "request_id": 0,
  • "payload": {
    }
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Check the status of a AI Hair Volume Generator task

Authorizations:
BearerAuthentication
query Parameters
task_id
string
Example: task_id=SX9ALF1Z+KIiNa+GaFRp4bI5gijoc/ckI2teebLq35Bo1Nwc++3iXXdKqnU4/LID

ID of task to check

Responses

Response Schema: application/json
status
integer

Response status

object
polling_interval
integer

Milliseconds waiting time for start next polling. Note that the task will lose if no polling in 10 seconds

status
string
Enum: "running" "success" "error"

Status of this task

error
string

Error of this task. Available only when the task status is error

Array of objects
Array
id
integer

ID of action

Array of objects
Array
dst_id
string

File ID of the result file is used for integrating other task. No need to reupload file.

url
string

URL to download this result. Valid for 2 hours

Response samples

AI Aging Generator

AI Aging Generator

AI aging generator utilizing generative AI model to generate a series of photos from youth to age from a single selfie image. With the help of AI technology, not only can it measure your current age, but it also lets you see yourself in the future or the past.

AI Aging Generator

The AI aging generator can generate a series of photos based on one single input selfie image. A sample generated photos are shown below as a quick reference of this feature. AI Aging Generator

Create a new file.

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
required
Array of objects
Array
content_type
required
string
Enum: "image/jpg" "image/jpeg" "image/png"

Content MIME type for this file. Currently available values are listed in the enum.

file_name
required
string

Name of this file

Responses

Response Schema: application/json
status
integer

Response status

object
Array of objects
Array
content_type
string

Content MIME type for this file.

file_name
string

Name of this file

file_id
string

ID of this file. Other run task API will need this file_id.

Array of objects

Using upload url, headers, method below to upload file. After completion, the file_id is used to proceed with calling run task API.

Array
headers
object

Headers to include when uploading the file

url
string

URL to upload this file

method
string

HTTP method to upload this file

Request samples

Content type
application/json
{
  • "files": [
    ]
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Run a AI Aging Generator task

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
request_id
required
integer

Incremental request number starting from 0. Requests with the same request_id will be ignored by the server. request_id should remain the same if the API client needs to retry the API due to a connection issue. This is to prevent duplicate deduction of credits caused by running the same task repeatedly. For instance, if the same file_id is sent with the same request_id, the engine won't re-run the task, nor will duplicate consume credits. However, if a client wants to generate multiple different results using the same file_id, the client needs to increment the request_id then the engine will re-run the task and consume the credit accordingly.

required
object
required
object
src_ids
required
Array of strings

ID of file to apply aging style. File ID from upload file API. For aging task, only accept 1 file.

required
Array of objects

Only accept 1 action.

Array
id
required
integer

ID of this action, start with 0. The client needs to generate an id for each action. This action id has to be unique per task. In the response from the get status API, these action id will be used to let the client know which results correspond to each action.

output_ext
string
Value: "jpg"

The format of the output file.

Responses

Response Schema: application/json
status
integer

Response status

object
task_id
string

ID of this task. This task_id will only valid if client continue polling check status API with interval polling_interval defined in check status API response. Otherwise, engine might consider client have leave and will not process the task. No credit will be consumed in this case.

Request samples

Content type
application/json
{
  • "request_id": 0,
  • "payload": {
    }
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Check the status of a AI Aging Generator task

Authorizations:
BearerAuthentication
query Parameters
task_id
string
Example: task_id=SX9ALF1Z+KIiNa+GaFRp4bI5gijoc/ckI2teebLq35Bo1Nwc++3iXXdKqnU4/LID

ID of task to check

Responses

Response Schema: application/json
status
integer

Response status

object
polling_interval
integer

Milliseconds waiting time for start next polling. Note that the task will lose if no polling in 10 seconds

status
string
Enum: "running" "success" "error"

Status of this task

error
string

Error of this task. Available only when the task status is error

Array of objects
Array
id
integer

ID of action

Array of objects

Result data of this task. This includes both the uploaded file and the resulting files. These files are arranged in ascending order based on the 'res_age' value.

Array
dst_id
string

File ID of the result file is used for integrating other task. No need to reupload file.

url
string

URL to download this result. Valid for 2 hours

res_age
integer

Age of the result that the AI engine attempts to generate. Please note that the 'res_age' of the uploaded file may not correspond to the 'age' in the 'custom_info' of the result.

object

Custom information for this task

age
integer

Estimation of the age of the uploaded file by AI engine. Please be aware that the 'res_age' of the uploaded file, as found in the 'data' section, may not align with this 'age' value.

age_idx
integer

Index of the uploaded file in the 'data'. Index is starting from 0. The first file has index 0, the second file has index 1, and so on.

age_min
integer

Minimum age among files in 'data'

age_max
integer

Maximum age among files in 'data'

num_of_photos
integer

Number of photos in 'data'

Response samples

Content type
application/json
{}

AI Makeup Transfer

AI Makeup Transfer

Just Upload a Desired Photo with the Look You Like! AI Makeup Transfer makes it easy and fun to experiment with different looks by letting you to upload desired photo to try them one by one. Have any makeup look you want to try now? Let us amaze you with AI Makeup Transfer!

First, upload a photo of yourself where your face and its features are clearly visible as the target image.

Then, upload a photo of your favorite makeup look as the reference image.

There you have it - an AI Makeup Transferred photo.

Samples:

Create a new file.

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
required
Array of objects
Array
content_type
required
string
Enum: "image/jpg" "image/jpeg" "image/png" "image/tiff" "image/gif"

Content MIME type for this file. Currently available values are listed in the enum.

file_name
required
string

Name of this file

Responses

Response Schema: application/json
status
integer

Response status

object
Array of objects
Array
content_type
string

Content MIME type for this file.

file_name
string

Name of this file

file_id
string

ID of this file. Other run task API will need this file_id.

Array of objects

Using upload url, headers, method below to upload file. After completion, the file_id is used to proceed with calling run task API.

Array
headers
object

Headers to include when uploading the file

url
string

URL to upload this file

method
string

HTTP method to upload this file

Request samples

Content type
application/json
{
  • "files": [
    ]
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Run a AI Makeup Transfer task

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
request_id
required
integer

Incremental request number starting from 0. Requests with the same request_id will be ignored by the server. request_id should remain the same if the API client needs to retry the API due to a connection issue. This is to prevent duplicate deduction of credits caused by running the same task repeatedly. For instance, if the same file_id is sent with the same request_id, the engine won't re-run the task, nor will duplicate consume credits. However, if a client wants to generate multiple different results using the same file_id, the client needs to increment the request_id then the engine will re-run the task and consume the credit accordingly.

required
object
required
object
src_ids
required
Array of strings

ID of source file to apply makeup. File ID from upload file API. For makeup transfer recommendation task, only accept 1 file.

ref_ids
required
Array of strings

ID of reference file to detect the makeup from. File ID from upload file API. For makeup transfer recommendation task, only accept 1 file.

required
Array of objects

Only accept 1 action.

Array
id
required
integer

ID of this action, start with 0. The client needs to generate an id for each action. This action id has to be unique per task. In the response from the get status API, these action id will be used to let the client know which results correspond to each action.

output_ext
string
Value: "jpg"

The format of the output file.

Responses

Response Schema: application/json
status
integer

Response status

object
task_id
string

ID of this task. This task_id will only valid if client continue polling check status API with interval polling_interval defined in check status API response. Otherwise, engine might consider client have leave and will not process the task. No credit will be consumed in this case.

Request samples

Content type
application/json
{
  • "request_id": 0,
  • "payload": {
    }
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Check the status of a AI Makeup Transfer task

Authorizations:
BearerAuthentication
query Parameters
task_id
string
Example: task_id=SX9ALF1Z+KIiNa+GaFRp4bI5gijoc/ckI2teebLq35Bo1Nwc++3iXXdKqnU4/LID

ID of task to check

Responses

Response Schema: application/json
status
integer

Response status

object
polling_interval
integer

Milliseconds waiting time for start next polling. Note that the task will lose if no polling in 10 seconds

status
string
Enum: "running" "success" "error"

Status of this task

error
string

Error of this task. Available only when the task status is error

Array of objects
Array
id
integer

ID of action

Array of objects
Array
dst_id
string

File ID of the result file is used for integrating other task. No need to reupload file.

url
string

URL to download this result. Valid for 2 hours

object

Product recommendation information for the makeup

Response samples

Content type
application/json
{}

AI Object Removal

AI Object Removal

Remove unwanted objects with precision from your photos while preserving intricate details.

AI Object Removal

Create a new file.

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
required
Array of objects
Array
content_type
required
string
Enum: "image/jpg" "image/jpeg" "image/png"

Content MIME type for this file. Currently available values are listed in the enum.

file_name
required
string

Name of this file

Responses

Response Schema: application/json
status
integer

Response status

object
Array of objects
Array
content_type
string

Content MIME type for this file.

file_name
string

Name of this file

file_id
string

ID of this file. Other run task API will need this file_id.

Array of objects

Using upload url, headers, method below to upload file. After completion, the file_id is used to proceed with calling run task API.

Array
headers
object

Headers to include when uploading the file

url
string

URL to upload this file

method
string

HTTP method to upload this file

Request samples

Content type
application/json
{
  • "files": [
    ]
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Run an AI Object Removal task

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
request_id
required
integer

Incremental request number starting from 0. Requests with the same request_id will be ignored by the server. request_id should remain the same if the API client needs to retry the API due to a connection issue. This is to prevent duplicate deduction of credits caused by running the same task repeatedly. For instance, if the same file_id is sent with the same request_id, the engine won't re-run the task, nor will duplicate consume credits. However, if a client wants to generate multiple different results using the same file_id, the client needs to increment the request_id then the engine will re-run the task and consume the credit accordingly.

required
object
required
object
src_ids
required
Array of strings

ID of the file to run object removal. File ID from upload file API.

mask_ids
required
Array of strings

ID of the file to run object removal. This should be a grey scale mask image with the exact same width and hight with the input image where white pixels indicate foregroud and black pixels represent background. File ID from upload file API.

required
Array of objects

Only accept 1 action.

Array
id
required
integer

ID of this action, start with 0. The client needs to generate an id for each action. This action id has to be unique per task. In the response from the get status API, these action id will be used to let the client know which results correspond to each action.

output_ext
string
Enum: "jpg" "webp"

The format of the output file.

Responses

Response Schema: application/json
status
integer

Response status

object
task_id
string

ID of this task. This task_id will only valid if client continue polling check status API with interval polling_interval defined in check status API response. Otherwise, engine might consider client have leave and will not process the task. No credit will be consumed in this case.

Request samples

Content type
application/json
{
  • "request_id": 0,
  • "payload": {
    }
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Check an AI Object Removal task status

Authorizations:
BearerAuthentication
query Parameters
task_id
string
Example: task_id=SX9ALF1Z+KIiNa+GaFRp4bI5gijoc/ckI2teebLq35Bo1Nwc++3iXXdKqnU4/LID

ID of task to check

Responses

Response Schema: application/json
status
integer

Response status

object
polling_interval
integer

Milliseconds waiting time for start next polling. Note that the task will lose if no polling in 10 seconds

status
string
Enum: "running" "success" "error"

Status of this task

error
string (EngineErrorCode)
Enum: "exceed_max_filesize" "invalid_parameter" "error_download_image" "error_download_mask" "error_decode_image" "error_decode_mask" "error_nsfw_content_detected" "error_no_face" "error_pose" "error_face_parsing" "error_inference" "exceed_nsfw_retry_limits" "error_upload" "unknown_internal_error"

Errors:

  • exceed_max_filesize - Input file size exceeds the maximum limit
  • invalid_parameter - Invalid parameter value
  • error_download_image - Download source image error
  • error_download_mask - Download mask image error
  • error_decode_image - Decode source image error
  • error_decode_mask - Decode mask image error
  • error_nsfw_content_detected - NSFW content detected in source image
  • error_no_face - No face detected on source image
  • error_pose - Failed to detect pose on source image
  • error_face_parsing - Failed to do face segmentation on source image
  • error_inference - Inference pipeline error
  • exceed_nsfw_retry_limits - Exceed the retry limits to avoid generated NSFW image
  • error_upload - Upload result image error
  • unknown_internal_error - Others
Array of objects
Array
id
integer

ID of action

Array of objects
Array
dst_id
string

File ID of the result file is used for integrating other task. No need to reupload file.

url
string

URL to download this result. URL only valid for 2 hours

Response samples

AI Photo Colorize

AI Photo Colorize

Using the latest AI technology to colorize black and white photos, old images, or repair them.

AI Photo Colorize

Create a new file.

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
required
Array of objects
Array
content_type
required
string
Enum: "image/jpg" "image/jpeg" "image/png"

Content MIME type for this file. Currently available values are listed in the enum.

file_name
required
string

Name of this file

Responses

Response Schema: application/json
status
integer

Response status

object
Array of objects
Array
content_type
string

Content MIME type for this file.

file_name
string

Name of this file

file_id
string

ID of this file. Other run task API will need this file_id.

Array of objects

Using upload url, headers, method below to upload file. After completion, the file_id is used to proceed with calling run task API.

Array
headers
object

Headers to include when uploading the file

url
string

URL to upload this file

method
string

HTTP method to upload this file

Request samples

Content type
application/json
{
  • "files": [
    ]
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Run a AI Photo Colorize task

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
request_id
required
integer

Incremental request number starting from 0. Requests with the same request_id will be ignored by the server. request_id should remain the same if the API client needs to retry the API due to a connection issue. This is to prevent duplicate deduction of credits caused by running the same task repeatedly. For instance, if the same file_id is sent with the same request_id, the engine won't re-run the task, nor will duplicate consume credits. However, if a client wants to generate multiple different results using the same file_id, the client needs to increment the request_id then the engine will re-run the task and consume the credit accordingly.

required
object
required
object
src_ids
required
Array of strings

ID of the file to run colorize. File ID from upload file API.

required
Array of objects

Only accept 1 action.

Array
id
required
integer

ID of this action, start with 0. The client needs to generate an id for each action. This action id has to be unique per task. In the response from the get status API, these action id will be used to let the client know which results correspond to each action.

output_ext
string
Enum: "jpg" "webp"

The format of the output file.

Responses

Response Schema: application/json
status
integer

Response status

object
task_id
string

ID of this task. This task_id will only valid if client continue polling check status API with interval polling_interval defined in check status API response. Otherwise, engine might consider client have leave and will not process the task. No credit will be consumed in this case.

Request samples

Content type
application/json
{
  • "request_id": 0,
  • "payload": {
    }
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Check a AI Photo Colorize task status

Authorizations:
BearerAuthentication
query Parameters
task_id
string
Example: task_id=SX9ALF1Z+KIiNa+GaFRp4bI5gijoc/ckI2teebLq35Bo1Nwc++3iXXdKqnU4/LID

ID of task to check

Responses

Response Schema: application/json
status
integer

Response status

object
polling_interval
integer

Milliseconds waiting time for start next polling. Note that the task will lose if no polling in 10 seconds

status
string
Enum: "running" "success" "error"

Status of this task

error
string (EngineErrorCode)
Enum: "exceed_max_filesize" "invalid_parameter" "error_download_image" "error_download_mask" "error_decode_image" "error_decode_mask" "error_nsfw_content_detected" "error_no_face" "error_pose" "error_face_parsing" "error_inference" "exceed_nsfw_retry_limits" "error_upload" "unknown_internal_error"

Errors:

  • exceed_max_filesize - Input file size exceeds the maximum limit
  • invalid_parameter - Invalid parameter value
  • error_download_image - Download source image error
  • error_download_mask - Download mask image error
  • error_decode_image - Decode source image error
  • error_decode_mask - Decode mask image error
  • error_nsfw_content_detected - NSFW content detected in source image
  • error_no_face - No face detected on source image
  • error_pose - Failed to detect pose on source image
  • error_face_parsing - Failed to do face segmentation on source image
  • error_inference - Inference pipeline error
  • exceed_nsfw_retry_limits - Exceed the retry limits to avoid generated NSFW image
  • error_upload - Upload result image error
  • unknown_internal_error - Others
Array of objects
Array
id
integer

ID of action

Array of objects
Array
dst_id
string

File ID of the result file is used for integrating other task. No need to reupload file.

url
string

URL to download this result. URL only valid for 2 hours

Response samples

Al Photo Background Removal

AI Photo Background Removal

Remove background from photo with impeccable accuracy, ensuring the high quality of images.

AI Photo Background Removal

Create a new file.

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
required
Array of objects
Array
content_type
required
string
Enum: "image/jpg" "image/jpeg" "image/png"

Content MIME type for this file. Currently available values are listed in the enum.

file_name
required
string

Name of this file

Responses

Response Schema: application/json
status
integer

Response status

object
Array of objects
Array
content_type
string

Content MIME type for this file.

file_name
string

Name of this file

file_id
string

ID of this file. Other run task API will need this file_id.

Array of objects

Using upload url, headers, method below to upload file. After completion, the file_id is used to proceed with calling run task API.

Array
headers
object

Headers to include when uploading the file

url
string

URL to upload this file

method
string

HTTP method to upload this file

Request samples

Content type
application/json
{
  • "files": [
    ]
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Run an Al Photo Background Removal task

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
request_id
required
integer

Incremental request number starting from 0. Repeated requests with the same request ID will be ignored by the server. This ID should remain consistent for retries due to connection issues. This is to prevent duplicate deduction of credits caused by running the same task repeatedly. For instance, if the same file_id is sent with the same request_id, the engine won't re-run the task, nor will duplicate consume credits. However, if a client wants to generate multiple different results using the same file_id, the client needs to increment the request_id then the engine will re-run the task and consume the credit accordingly.

required
object
required
object
src_ids
required
Array of strings

ID of the file to run SOD. File ID from upload file API.

required
Array of objects

Only accept 1 action.

Array
id
required
integer

ID of this action, start with 0. The client needs to generate anid for each actiond. This action id has to be unique per task. In the response from the get status API, these actionids will be used to let the client know which results correspond to each action.

output_ext
string
Enum: "png" "webp"

The format of the output file.

Responses

Response Schema: application/json
status
integer

Response status

object
task_id
string

ID of this task. This task_id will only valid if client continue polling check status API with interval polling_interval defined in check status API response. Otherwise, engine might consider client have leave and will not process the task. No credit will be consumed in this case.

Request samples

Content type
application/json
{
  • "request_id": 0,
  • "payload": {
    }
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Check an Al Photo Background Removal task status

Authorizations:
BearerAuthentication
query Parameters
task_id
string
Example: task_id=SX9ALF1Z+KIiNa+GaFRp4bI5gijoc/ckI2teebLq35Bo1Nwc++3iXXdKqnU4/LID

ID of task to check

Responses

Response Schema: application/json
status
integer

Response status

object
polling_interval
integer

Milliseconds waiting time for start next polling. Note that the task will lose if no polling in 10 seconds

status
string
Enum: "running" "success" "error"

Status of this task

error
string (EngineErrorCode)
Enum: "exceed_max_filesize" "invalid_parameter" "error_download_image" "error_download_mask" "error_decode_image" "error_decode_mask" "error_nsfw_content_detected" "error_no_face" "error_pose" "error_face_parsing" "error_inference" "exceed_nsfw_retry_limits" "error_upload" "unknown_internal_error"

Errors:

  • exceed_max_filesize - Input file size exceeds the maximum limit
  • invalid_parameter - Invalid parameter value
  • error_download_image - Download source image error
  • error_download_mask - Download mask image error
  • error_decode_image - Decode source image error
  • error_decode_mask - Decode mask image error
  • error_nsfw_content_detected - NSFW content detected in source image
  • error_no_face - No face detected on source image
  • error_pose - Failed to detect pose on source image
  • error_face_parsing - Failed to do face segmentation on source image
  • error_inference - Inference pipeline error
  • exceed_nsfw_retry_limits - Exceed the retry limits to avoid generated NSFW image
  • error_upload - Upload result image error
  • unknown_internal_error - Others
Array of objects
Array
id
integer

ID of action

Array of objects
Array
dst_id
string

File ID of the result file is used for integrating other task. No need to reupload file.

url
string

URL to download this result. URL only valid for 2 hours

Response samples

AI Photo Enhance

AI Photo Enhance

Sharpen, upscale, denoise, and fix colors to transform low-resolution images into high-quality masterpieces.

AI Photo Enhance

Create a new file.

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
required
Array of objects
Array
content_type
required
string
Enum: "image/jpg" "image/jpeg" "image/png"

Content MIME type for this file. Currently available values are listed in the enum.

file_name
required
string

Name of this file

Responses

Response Schema: application/json
status
integer

Response status

object
Array of objects
Array
content_type
string

Content MIME type for this file.

file_name
string

Name of this file

file_id
string

ID of this file. Other run task API will need this file_id.

Array of objects

Using upload url, headers, method below to upload file. After completion, the file_id is used to proceed with calling run task API.

Array
headers
object

Headers to include when uploading the file

url
string

URL to upload this file

method
string

HTTP method to upload this file

Request samples

Content type
application/json
{
  • "files": [
    ]
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Run an AI Photo Enhance task

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
request_id
required
integer

Incremental request number starting from 0. Requests with the same request_id will be ignored by the server. request_id should remain the same if the API client needs to retry due to a connection issue. This is to prevent duplicate deduction of credits caused by running the same task repeatedly. For instance, if the same file_id is sent with the same request_id, the engine won't re-run the task, nor will duplicate consume credits. However, if a client wants to generate multiple different results using the same file_id, the client needs to increment the request_id then the engine will re-run the task and consume the credit accordingly.

required
object
required
object
src_ids
required
Array of strings

ID of file to run enhancement. File ID from upload file API.

required
Array of objects

Only accept 1 action.

Array
id
required
integer

ID of this action, start with 0. The client needs to generate an id for each action. This action id has to be unique per task. In the response from the get status API, these action id will be used to let the client know which results correspond to each action.

required
object
scale
required
integer

Scaling ratio. Available values are 1, 2, 4.

output_ext
string
Enum: "jpg" "webp"

The format of the output file.

Responses

Response Schema: application/json
status
integer

Response status

object
task_id
string

ID of this task. This task_id will only valid if client continue polling check status API with interval polling_interval defined in check status API response. Otherwise, engine might consider client have leave and will not process the task. No credit will be consumed in this case.

Request samples

Content type
application/json
{
  • "request_id": 0,
  • "payload": {
    }
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Check an AI Photo Enhance task status

Authorizations:
BearerAuthentication
query Parameters
task_id
string
Example: task_id=SX9ALF1Z+KIiNa+GaFRp4bI5gijoc/ckI2teebLq35Bo1Nwc++3iXXdKqnU4/LID

ID of task to check

Responses

Response Schema: application/json
status
integer

Response status

object
polling_interval
integer

Milliseconds waiting time for start next polling. Note that the task will lose if no polling in 10 seconds

status
string
Enum: "running" "success" "error"

Status of this task

error
string (EngineErrorCode)
Enum: "exceed_max_filesize" "invalid_parameter" "error_download_image" "error_download_mask" "error_decode_image" "error_decode_mask" "error_nsfw_content_detected" "error_no_face" "error_pose" "error_face_parsing" "error_inference" "exceed_nsfw_retry_limits" "error_upload" "unknown_internal_error"

Errors:

  • exceed_max_filesize - Input file size exceeds the maximum limit
  • invalid_parameter - Invalid parameter value
  • error_download_image - Download source image error
  • error_download_mask - Download mask image error
  • error_decode_image - Decode source image error
  • error_decode_mask - Decode mask image error
  • error_nsfw_content_detected - NSFW content detected in source image
  • error_no_face - No face detected on source image
  • error_pose - Failed to detect pose on source image
  • error_face_parsing - Failed to do face segmentation on source image
  • error_inference - Inference pipeline error
  • exceed_nsfw_retry_limits - Exceed the retry limits to avoid generated NSFW image
  • error_upload - Upload result image error
  • unknown_internal_error - Others
Array of objects
Array
id
integer

ID of action

Array of objects
Array
dst_id
string

File ID of the result file is used for integrating other task. No need to reupload file.

url
string

URL to download this result. URL only valid for 2 hours

Response samples

AI Image Generator

AI Image Generator

Transform words into vivid visuals with our cutting-edge AI text-to-image feature.

AI Image Generator

List predefined style groups for AI Image Generator task

Authorizations:
BearerAuthentication
query Parameters
page_size
integer
Example: page_size=20

Number of results to return in this page. Valid value should be between 1 and 20. Default 20.

starting_token
string
Example: starting_token=13045969587275114

Token for current page. Start with null for the first page, and use next_token from the previous response to start next page

Responses

Response Schema: application/json
status
integer

Response status

object
next_token
string

Token to query next page.

Array of objects
Array
id
integer

ID of style group

object
title
string

Title of this style group

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

List predefined style for AI Image Generator task

Authorizations:
BearerAuthentication
query Parameters
page_size
integer
Example: page_size=20

Number of results to return in this page. Valid value should be between 1 and 20. Default 20.

starting_token
string
Example: starting_token=13045969587275114

Token for current page. Start with null for the first page, and use next_token from the previous response to start next page

style_group_id
integer
Example: style_group_id=18213963761051864

The id of style group

Responses

Response Schema: application/json
status
integer

Response status

object
next_token
string

Token to query next page.

Array of objects
Array
id
integer

ID of style

object
title
string

Title of this style

thumb
string

Thumbnail url for this parameter

Response samples

Content type
application/json
{}

Run a AI Image Generator task

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
request_id
required
integer

Incremental request number starting from 0. Requests with the same request_id will be ignored by the server. request_id should remain the same if the API client needs to retry the API due to a connection issue. This is to prevent duplicate deduction of credits caused by running the same task repeatedly. For instance, if the same file_id is sent with the same request_id, the engine won't re-run the task, nor will duplicate consume credits. However, if a client wants to generate multiple different results using the same file_id, the client needs to increment the request_id then the engine will re-run the task and consume the credit accordingly.

required
object
required
Array of objects

Only accept 1 action.

Array
id
required
integer

ID of this action, start with 0. The client needs to generate an id for each action. This action id has to be unique per task. In the response from the get status API, these action id will be used to let the client know which results correspond to each action.

required
object
prompt
required
string

Prompt to generate image

style_group_id
required
integer

Id of style group

style_ids
required
Array of numbers

Id of style to run the task. Only accept 1 style.

output_ext
string
Value: "jpg"

The format of the output file.

Responses

Response Schema: application/json
status
integer

Response status

object
task_id
string

ID of this task. This task_id will only valid if client continue polling check status API with interval polling_interval defined in check status API response. Otherwise, engine might consider client have leave and will not process the task. No credit will be consumed in this case.

Request samples

Content type
application/json
{
  • "request_id": 0,
  • "payload": {
    }
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Check a AI Image Generator task status

Authorizations:
BearerAuthentication
query Parameters
task_id
string
Example: task_id=SX9ALF1Z+KIiNa+GaFRp4bI5gijoc/ckI2teebLq35Bo1Nwc++3iXXdKqnU4/LID

ID of task to check

Responses

Response Schema: application/json
status
integer

Response status

object
polling_interval
integer

Milliseconds waiting time for start next polling. Note that the task will lose if no polling in 10 seconds

status
string
Enum: "running" "success" "error"

Status of this task

error
string (EngineErrorCode)
Enum: "exceed_max_filesize" "invalid_parameter" "error_download_image" "error_download_mask" "error_decode_image" "error_decode_mask" "error_nsfw_content_detected" "error_no_face" "error_pose" "error_face_parsing" "error_inference" "exceed_nsfw_retry_limits" "error_upload" "unknown_internal_error"

Errors:

  • exceed_max_filesize - Input file size exceeds the maximum limit
  • invalid_parameter - Invalid parameter value
  • error_download_image - Download source image error
  • error_download_mask - Download mask image error
  • error_decode_image - Decode source image error
  • error_decode_mask - Decode mask image error
  • error_nsfw_content_detected - NSFW content detected in source image
  • error_no_face - No face detected on source image
  • error_pose - Failed to detect pose on source image
  • error_face_parsing - Failed to do face segmentation on source image
  • error_inference - Inference pipeline error
  • exceed_nsfw_retry_limits - Exceed the retry limits to avoid generated NSFW image
  • error_upload - Upload result image error
  • unknown_internal_error - Others
Array of objects
Array
id
integer

ID of action

Array of objects
Array
dst_id
string

File ID of the result file is used for integrating other task. No need to reupload file.

url
string

URL to download this result. URL only valid for 2 hours

Response samples