Setup InsightFaceSwap
{: .no_toc }
## Table of contents
{: .no_toc .text-delta }
1. TOC
{:toc}
Approximately 3 minutes to complete setup steps.
---
## Create Discord account
You need a [Discord](https://discord.com) account to interact with [InsightFaceSwap Discord bot](https://discord.gg/Ym3X8U59ZN). Create a [new account](https://discord.com/register) if you don't have one already.
Please note even if you have an existing Discord account we are **strongly** recommending creating a separate Discord account specifically designated to be used with useapi.net API.
## Create Discord server
Please log in to your Discord account and create a new Discord server following [official instructions](https://support.discord.com/hc/en-us/articles/204849977-How-do-I-create-a-server-).
## Create `#api` text channel on your Discord server
Once you created the Discord server you need to create a designated for API-related work text channel. You can refer to [official instructions](https://support.discord.com/hc/en-us/articles/4412085582359-Text-Channels-Text-Chat-In-Voice-Channels) to learn about Discord channels and how to manage them on your server. We suggest naming the text channel `#api` for clarity and also making that channel private. Please see [Midjourney instructions](https://docs.midjourney.com/docs/invite-the-bot) to learn how you can restrict the bot to a single private channel.
## Join Picsi.Ai - Powered by InsightFace Discord Server
Follow Picsi.Ai [instructions](https://github.com/deepinsight/insightface/blob/master/web-demos/swapping_discord/README.md) and join official [Picsi.Ai - Powered by InsightFace Discord Server](https://discord.gg/Ym3X8U59ZN).
## Add InsightFaceSwap bot to your Discord server
Please follow [official instructions](https://discord.com/channels/1095014106576212101/1128550062683865178/1189604165006135379) to add InsightFaceSwap bot to your Discord server created earlier.
## Example of Discord server with private `#api` text channel and InsightFace bot
Below you can see we created `useapi` Discord server with private `#api` text channel:

InsightFace bot invited to the server and has access to private `#api` text channel

## Test InsightFace bot
Navigate to the created above `#api` text channel and execute few InsightFaceSwap bot command(s) to make sure it works.
## Make a note of your server id and channel id values
Your Discord URL looks like `https://discord.com/channels/
InsightFaceSwap API v1
February 2024
This is [experimental](../../docs/legal) API for [InsightFaceSwap Discord Bot](https://discord.gg/Ym3X8U59ZN) by [Picsi.Ai](https://www.picsi.ai/). InsightFaceSwap allows users to swap faces from source image(s) onto different target images. It offers free and paid [subscription](https://www.patreon.com/picsi) models. Paid subscribers have access to a wide selection of extra features such as [HiFidelity Mode](https://www.patreon.com/posts/89036144), [ARTIFY](https://www.patreon.com/posts/picsi-ai-v2-0-97389077), oldify/youngify, morphing multiple faces in one image, and [many more](https://discord.com/channels/1095014106576212101/1128550062683865178).
[Setup InsightFaceSwap](../../docs/start-here/setup-faceswap)
[Postman collection](https://www.postman.com/useapinet/useapi-net/collection) (January 20, 2026)
[LLM-friendly API spec](https://useapi.net/assets/aibot/api-faceswap-v1.txt) Feed this to your LLM to build integrations
Official documentation links:
- [Discord support channel](https://discord.com/channels/1095014106576212101/1128550062683865178)
- [Patreon support channel](https://www.patreon.com/picsi/posts)
- [YouTube channel](https://www.youtube.com/@PicsiAi)
#### Example source code on GitHub
* [Face swap and animate images generated by Midjourney using InsightFaceSwap and Pika (using webhook)](https://github.com/useapi/examples/tree/main/imagine-faceswap-animate) February 19, 2024
Developer Community:
* DEL faceswap/account/channel
parent: InsightFaceSwap API v1
nav_order: 400
---
## Delete InsightFaceSwap account
{: .no_toc }
## Table of contents
{: .no_toc .text-delta }
1. TOC
{:toc}
---
{: .delete }
> **https://api.useapi.net/v1/faceswap/account/`channel`**
The `channel` value should correspond to an account configured previously via a [POST](post-faceswap-account-channel) request.
##### Request Headers
``` yaml
Authorization: Bearer {API token}
```
- `API token` is **required**, see [Setup useapi.net](../start-here/setup-useapi) for details.
##### Responses
{% tabs del_account_InsightFaceSwap_response %}
{% tab del_account_InsightFaceSwap_response 204 %}
204 No Content
{% endtab %}
{% tab del_account_InsightFaceSwap_response 401 %}
401 Unauthorized
```json
{
"error": "Unauthorized",
"code": 401
}
```
{% endtab %}
{% tab del_account_InsightFaceSwap_response 404 %}
404 Not Found
{% endtab %}
{% endtabs %}
##### Model
```typescript
{ // TypeScript, all fields are optional
error: string,
errorDetails: string,
code: number
}
```
##### Examples
{% tabs del_account_InsightFaceSwap_example %}
{% tab del_account_InsightFaceSwap_example Curl %}
``` bash
curl -H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer …" \
-X DELETE https://api.useapi.net/v1/faceswap/account/DEL faceswap/delid
parent: InsightFaceSwap API v1
nav_order: 1100
---
## InsightFaceSwap [/delid](https://github.com/deepinsight/insightface/blob/master/web-demos/swapping_discord/README.md#delid-name) command
{: .no_toc }
## Table of contents
{: .no_toc .text-delta }
1. TOC
{:toc}
---
Use this endpoint to submit the InsightFaceSwap [/delid](https://github.com/deepinsight/insightface/blob/master/web-demos/swapping_discord/README.md#delid-name) command to your [InsightFaceSwap Discord channel](../start-here/setup-faceswap). The result will be returned in the response body and can also be sent as a callback to an optional [`replyUrl`](#request-body).
This is a blocking call, you will **not** be able to make another call to the same InsightFaceSwap Discord channel until the current call is completed. The average execution time is approximately 3 to 10 seconds. If you expect high load and need to make multiple concurrent calls, please consider setting up [multiple InsightFaceSwap accounts](https://useapi.net/docs/api-faceswap-v1/post-faceswap-account-channel).
It is **important** not to use the InsightFaceSwap account setup for API access for any purposes other than its intended use, such as executing `/delid` or any other InsightFaceSwap commands _manually_ or in conjunction with _any other_ automation tools. The useapi.net API internally tracks the usage of the InsightFaceSwap account, including the number of currently active executions. Using it for other activities may cause API to function incorrectly.
{: .delete }
> **https://api.useapi.net/v1/faceswap/delid**
##### Request Headers
``` yaml
Authorization: Bearer {API token}
Content-Type: multipart/form-data
```
- `API token` is **required**, see [Setup useapi.net](../start-here/setup-useapi) for details.
##### Request Body
```json
{
"channel": "Discord channel id",
"idname": "idname param",
}
```
- `channel` is optional when only one [faceswap/account](../api-faceswap-v1/get-faceswap-account) configured. However, if you have multiple accounts configured, this parameter becomes **required**.
- `idname` is **required**, please refer to InsightFaceSwap [/delid](https://github.com/deepinsight/insightface/blob/master/web-demos/swapping_discord/README.md#delid-name) for details.
- `replyUrl` is optional, if not provided value from [useapi.net account](../account-management/get-account) will be used.
Place here your callback URL. API will call the provided `replyUrl` once job completed or failed.
Maximum length 1024 characters.
We recommend using sites like [webhook.site](https://webhook.site) to test callback URL functionality.
- `replyRef` is optional, place here your reference id which will be stored and returned along with this job response / result.
Maximum length 1024 characters.
##### Responses
{% tabs post_faceswap-delid_response %}
{% tab post_faceswap-delid_response 200 %}
200 OK
Field `content` contains message generated by InsightFaceSwap.
```json
{
"jobid": "GET faceswap/account/channel
parent: InsightFaceSwap API v1
nav_order: 200
---
## Retrieve InsightFaceSwap configuration for `channel`
{: .no_toc }
## Table of contents
{: .no_toc .text-delta }
1. TOC
{:toc}
---
{: .get }
> **https://api.useapi.net/v1/faceswap/account/`channel`**
The `channel` value should correspond to an account configured previously via a [POST](post-faceswap-account-channel) request.
##### Request Headers
``` yaml
Authorization: Bearer {API token}
Content-Type: application/json
```
- `API token` is **required**, see [Setup useapi.net](../start-here/setup-useapi) for details.
##### Responses
{% tabs get_account_InsightFaceSwap_channel_response %}
{% tab get_account_InsightFaceSwap_channel_response 200 %}
200 OK
```json
{
"server": "Discord server id",
"channel": "Discord channel id",
"discord": "Discord token",
"credits": {
"timestamp": "2024-02-01T02:05:24.991000+00:00",
"total": 50,
"used": 18
}
}
```
{% endtab %}
{% tab get_account_InsightFaceSwap_channel_response 401 %}
401 Unauthorized
```json
{
"error": "Unauthorized",
"code": 401
}
```
{% endtab %}
{% tab get_account_InsightFaceSwap_channel_response 404 %}
404 Not Found
Configuration not found. To create configuration use [faceswap/account/`channel`](https://useapi.net/docs/api-faceswap-v1/post-faceswap-account-channel).
{% endtab %}
{% endtabs %}
##### Model
```typescript
{ // TypeScript, all fields are optional
discord: string,
server: string,
channel: string,
credits: {
timestamp: string,
total: number,
used: number
}
}
```
##### Examples
{% tabs get_account_InsightFaceSwap_channel_example %}
{% tab get_account_InsightFaceSwap_channel_example Curl %}
``` bash
curl https://api.useapi.net/v1/faceswap/account/GET faceswap/account
parent: InsightFaceSwap API v1
nav_order: 100
---
## Retrieve InsightFaceSwap accounts information
{: .no_toc }
## Table of contents
{: .no_toc .text-delta }
1. TOC
{:toc}
---
Before you start using the API, you **must** [configure](../start-here/setup-faceswap) at least one InsightFaceSwap Discord account. You may specify multiple InsightFaceSwap accounts, the API will automatically perform load balancing by randomly selecting an account with available credits before making calls to InsightFaceSwap Discord bot.
This endpoint retrieves the complete list of configured accounts for InsightFaceSwap.
{: .get }
> **https://api.useapi.net/v1/faceswap/account**
##### Request Headers
``` yaml
Authorization: Bearer {API token}
Content-Type: application/json
```
- `API token` is **required**, see [Setup useapi.net](../start-here/setup-useapi) for details.
##### Responses
{% tabs account_InsightFaceSwap_response %}
{% tab account_InsightFaceSwap_response 200 %}
200 OK
```json
{
"Discord channel A": {
"server": "Discord server A",
"channel": "Discord channel A",
"discord": "Discord token A",
"credits": {
"timestamp": "2024-02-01T02:05:24.991000+00:00",
"total": 50,
"used": 18
},
},
"Discord channel B": {
"server": "Discord server B",
"channel": "Discord channel B",
"discord": "Discord token B"
},
"Discord channel N": {
"server": "Discord server N",
"channel": "Discord channel N",
"discord": "Discord token N",
"credits": {
"timestamp": "2024-02-01T03:17:48.159000+00:00",
"total": 200,
"used": 115
}
}
}
```
{% endtab %}
{% tab account_InsightFaceSwap_response 401 %}
401 Unauthorized
```json
{
"error": "Unauthorized",
"code": 401
}
```
{% endtab %}
{% tab account_InsightFaceSwap_response 404 %}
404 Not Found
Configuration not found. To create configuration use [faceswap/account/`channel`](https://useapi.net/docs/api-faceswap-v1/post-faceswap-account-channel).
{% endtab %}
{% endtabs %}
##### Model
```typescript
{ // TypeScript, all fields are optional
[channel: string]: {
discord: string,
server: string,
channel: string,
credits: {
timestamp: string,
total: number,
used: number
}
}
}
```
##### Examples
{% tabs account_InsightFaceSwap_example %}
{% tab account_InsightFaceSwap_example Curl %}
``` bash
curl https://api.useapi.net/v1/faceswap/account \
-H "Accept: application/json" \
-H "Authorization: Bearer …"
```
{% endtab %}
{% tab account_InsightFaceSwap_example JavaScript %}
``` javascript
const token = "API token";
const apiUrl = "https://api.useapi.net/v1/faceswap/account";
const response = await fetch(apiUrl, {
headers: {
"Authorization": `Bearer ${token}`,
},
});
const result = await response.json();
console.log("response", {response, result});
```
{% endtab %}
{% tab account_InsightFaceSwap_example Python %}
``` python
import requests
token = "API token"
apiUrl = "https://api.useapi.net/v1/faceswap/account"
headers = {
"Content-Type": "application/json",
"Authorization" : f"Bearer {token}"
}
response = requests.get(apiUrl, headers=headers)
print(response, response.json())
```
{% endtab %}
{% endtabs %}
=== URL: https://useapi.net/docs/api-faceswap-v1/get-faceswap-jobid ===
Document URL: https://useapi.net/docs/api-faceswap-v1/get-faceswap-jobid
---
layout: default
title: GET faceswap/jobs/?jobid=jobid
parent: InsightFaceSwap API v1
nav_order: 1300
---
## Retrieve InsightFaceSwap job status and results
{: .no_toc }
## Table of contents
{: .no_toc .text-delta }
1. TOC
{:toc}
---
Use this endpoint to retrieve status and results of
- [faceswap/headshot](../api-faceswap-v1/post-faceswap-headshot)
- [faceswap/changebg](../api-faceswap-v1/post-faceswap-changebg)
- [faceswap/picsi](../api-faceswap-v1/post-faceswap-picsi) with initial jobs status returned `started`
If you specified optional parameter [`replyUrl`](../api-faceswap-v1/post-faceswap-headshot#request-body) you technically do not need to use this endpoint to retrieve results since API will call provided `replyUrl` once job generation completed.
**Important** API periodically polls (checks) Discord every 15 to 60 seconds (depending on the load) and updates all currently executed jobs statuses and results. Polling interval is used for safety reasons, aiming to prevent any potential issues with Discord and InsightFaceSwap, such as bans or excessive requests.
Jobs lifespan guaranteed to be at least 31 days, after that they will be expired and may be recycled.
{: .get }
> **https://api.useapi.net/v1/faceswap/jobs/?jobid=`jobid`**
##### Request Headers
``` yaml
Authorization: Bearer {API token}
```
- `API token` is **required**, see [Setup useapi.net](../start-here/setup-useapi) for details.
##### Query Parameter
`jobid` is **required**, use value returned by
- [faceswap/headshot](../api-faceswap-v1/post-faceswap-headshot)
- [faceswap/changebg](../api-faceswap-v1/post-faceswap-changebg)
- [faceswap/picsi](../api-faceswap-v1/post-faceswap-picsi) with initial jobs status returned `started`
##### Responses
{:toc}
{% tabs get_faceswap_jobid_response %}
{% tab get_faceswap_jobid_response 200 %}
200 OK
If field `status` value is *created*, *started* or *progress* wait in a loop for **at least** 10..30 seconds and retry again. When completed retrieve generated images or video from `attachments` array. Field `content` contains message generated by InsightFaceSwap reflecting current generation parameters and progress. Optional array `embeds` contains additional information.
```json
{
"jobid": "