Enhance your business and streamline your workflow with the faceswapai.com API

Integrate our API into your application, website, or workflow to quickly generate high-quality face swap images.

GETTING STARTED

How to use faceswapai.com API?

Just follow our documentation and you can use it quickly in a few minutes.

BENEFITS

What are the advantages of faceswapai.com API?

Our API efficiently simplifies the developer's workflow and makes your product even better.

Quick Integration

Quick integration

It only takes a few minutes to quickly integrate the API into your product.

Fast Generation

Fast generation

No need to wait for a long time. It only takes about 3 seconds to generate a picture.

High Quality

High generation quality

Uses the top large model. Has a delicate and perfect face-swapping effect.

Security

Safe and reliable

Private and secure, visible only to you.

DOCUMENTATION

API Documentation

Comprehensive documentation for the faceswapai.com API.

Authentication

All API requests require authentication. You need to include your API key in the headers of your request.

// Example: Including API key in headers
X-API-Key: YOUR_API_KEY

Base URL

All API endpoints are relative to the base URL:

https://api.faceswapai.com/v1

Endpoints

POST /face-swap

This endpoint swaps faces in images.

Request Parameters
Parameter Type Required Description
source_image file or base64 Yes The image containing the face to swap from.
target_image file or base64 Yes The image containing the face to swap to.
swap_mode string No Mode of face swapping. Options: 'single', 'multiple'. Default: 'single'.
Example Request
curl -X POST \
  https://api.faceswapai.com/v1/face-swap \
  -H 'X-API-Key: YOUR_API_KEY' \
  -H 'Content-Type: multipart/form-data' \
  -F 'source_image=@/path/to/source.jpg' \
  -F 'target_image=@/path/to/target.jpg'
Response
Status Code Description
200 Successful operation
400 Invalid parameters
401 Unauthorized (Invalid API key)
Example Response
{
  "status": "success",
  "result": {
    "image": "base64_encoded_image_data...",
    "processing_time": "2.5s"
  }
}

POST /video-face-swap

This endpoint swaps faces in videos.

Request Parameters
Parameter Type Required Description
source_image file or base64 Yes The image containing the face to swap from.
target_video file or url Yes The video containing the face to swap to.
face_index integer No Index of the face to swap in the target video. Default: 0 (main face).
QUESTIONS & ANSWERS

Frequently Asked Questions

Got a question? We've got answers. If you have some other questions, see our support center.

Who can access the faceswapai.com API?

Our API is available to all registered users. You need to create an account and generate an API key to start using it. Different subscription plans offer varying levels of API access and usage limits.

What features does the API support?

The API supports all the core features available on our website, including single face swap, multiple face swap, video face swap, and batch processing. Check the documentation for the complete list of endpoints and capabilities.

Does calling the API consume credits?

Yes, API calls consume credits just like using the web interface. The credit consumption follows the same rules - for example, single face swaps cost 1 credit, video face swaps are calculated based on duration and number of faces.

How to quickly integrate API into your own products?

We offer comprehensive documentation and code examples in multiple programming languages to make integration easy. Additionally, we provide SDKs for popular languages like JavaScript, Python, and PHP to simplify the integration process even further.

Is the faceswapai.com API secure and private?

Yes, we take security and privacy seriously. All API communications are encrypted using HTTPS. We do not store your images or videos beyond the processing time needed. Your API key is also secured and you can revoke it at any time. We adhere to strict data protection guidelines and do not share your data with third parties.

Ready to integrate face swapping into your application?

Get started with faceswapai.com API in minutes and offer your users amazing face swap capabilities.