{
  "info": {
    "_postman_id": "4f903f40-b439-4bc1-91b7-241240869617",
    "name": "DeepSwapAI Face Swap API",
    "description": "Server-side request examples for the five production DeepSwapAI face swap workflows. Set apiKey, select local files, submit a task, then run the matching poll request. This collection is an example asset, not an official language SDK. Webhook callbacks are not currently supported.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{apiKey}}",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://deepswapai.com",
      "type": "string"
    },
    {
      "key": "apiKey",
      "value": "",
      "type": "secret"
    },
    {
      "key": "taskId",
      "value": "",
      "type": "string"
    }
  ],
  "item": [
    {
      "name": "Photo face swap",
      "description": "Costs 2 credits. Each image can be up to 30 MB. Accepted inputs are JPEG/JPG, PNG, WebP, GIF, BMP, HEIC, or HEIF with validated image content.",
      "item": [
        {
          "name": "Create Photo face swap task",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Task accepted', function () { pm.expect(pm.response.code).to.eql(200); });",
                  "const payload = pm.response.json();",
                  "pm.expect(payload.taskId).to.be.a('string');",
                  "pm.collectionVariables.set('taskId', payload.taskId);"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "sourceImage",
                  "type": "file",
                  "src": "",
                  "description": "Face reference image; maximum 30 MB."
                },
                {
                  "key": "targetImage",
                  "type": "file",
                  "src": "",
                  "description": "Target scene image; maximum 30 MB."
                }
              ]
            },
            "url": "{{baseUrl}}/api/ai-tasks",
            "description": "Costs 2 credits. Each image can be up to 30 MB. Accepted inputs are JPEG/JPG, PNG, WebP, GIF, BMP, HEIC, or HEIF with validated image content.\n\nRequires a verified account email and sufficient credits."
          },
          "response": []
        },
        {
          "name": "Poll Photo face swap task",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{baseUrl}}/api/ai-tasks?taskId={{taskId}}",
            "description": "Poll this endpoint until status is COMPLETED, FAILED, or CANCELLED. Polling is the currently supported completion mechanism; webhook callbacks are not available."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Batch photo face swap",
      "description": "Costs 2 credits per generated output. A request can contain at most 20 images, 30 MB per image, and 200 MB combined. JPEG, PNG, WebP, AVIF, HEIC, and HEIF are accepted.",
      "item": [
        {
          "name": "Create Batch photo face swap task",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Task accepted', function () { pm.expect(pm.response.code).to.eql(200); });",
                  "const payload = pm.response.json();",
                  "pm.expect(payload.taskId).to.be.a('string');",
                  "pm.collectionVariables.set('taskId', payload.taskId);"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "mode",
                  "type": "text",
                  "value": "singleToMulti",
                  "description": "singleToMulti requires one source image and one or more targets. multiToSingle requires one or more source images and one target."
                },
                {
                  "key": "sourceImages",
                  "type": "file",
                  "src": "",
                  "description": "Source face image."
                },
                {
                  "key": "targetImages",
                  "type": "file",
                  "src": "",
                  "description": "Target image."
                }
              ]
            },
            "url": "{{baseUrl}}/api/ai-tasks/batch-face-swap",
            "description": "Costs 2 credits per generated output. A request can contain at most 20 images, 30 MB per image, and 200 MB combined. JPEG, PNG, WebP, AVIF, HEIC, and HEIF are accepted.\n\nRequires a verified account email and sufficient credits."
          },
          "response": []
        },
        {
          "name": "Poll Batch photo face swap task",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{baseUrl}}/api/ai-tasks/batch-face-swap?taskId={{taskId}}",
            "description": "Poll this endpoint until status is COMPLETED, FAILED, or CANCELLED. Polling is the currently supported completion mechanism; webhook callbacks are not available."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Mapped group-photo face swap",
      "description": "Costs 2 credits per replacement face. Supply one group photo and contiguous targetFace0 through targetFace9 fields. The total request can be up to 120 MB. Optional faceBox mappings must be supplied for every replacement face or omitted for all faces.",
      "item": [
        {
          "name": "Create Mapped group-photo face swap task",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Task accepted', function () { pm.expect(pm.response.code).to.eql(200); });",
                  "const payload = pm.response.json();",
                  "pm.expect(payload.taskId).to.be.a('string');",
                  "pm.collectionVariables.set('taskId', payload.taskId);"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "sourceImage",
                  "type": "file",
                  "src": "",
                  "description": "Group photo containing the people to replace. JPEG, PNG, or WebP; maximum 30 MB."
                },
                {
                  "key": "targetFace0",
                  "type": "file",
                  "src": "",
                  "description": "Replacement identity image 0. Numbered fields must be contiguous from targetFace0. JPEG, PNG, or WebP; maximum 30 MB."
                }
              ]
            },
            "url": "{{baseUrl}}/api/ai-tasks/multi-face-swap",
            "description": "Costs 2 credits per replacement face. Supply one group photo and contiguous targetFace0 through targetFace9 fields. The total request can be up to 120 MB. Optional faceBox mappings must be supplied for every replacement face or omitted for all faces.\n\nRequires a verified account email and sufficient credits."
          },
          "response": []
        },
        {
          "name": "Poll Mapped group-photo face swap task",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{baseUrl}}/api/ai-tasks/multi-face-swap?taskId={{taskId}}",
            "description": "Poll this endpoint until status is COMPLETED, FAILED, or CANCELLED. Polling is the currently supported completion mechanism; webhook callbacks are not available."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Video face swap",
      "description": "The face image can be up to 30 MB. The MP4, MOV, or WebM target can be up to 200 MB and 300 seconds. One face reference is applied to the primary on-camera person; separate reference mapping for multiple people in one video is not supported. Duration is rounded up. 720p costs 2 credits per second with a 6-credit minimum; 1080p costs 5 credits per second with a 15-credit minimum.",
      "item": [
        {
          "name": "Create Video face swap task",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Task accepted', function () { pm.expect(pm.response.code).to.eql(200); });",
                  "const payload = pm.response.json();",
                  "pm.expect(payload.taskId).to.be.a('string');",
                  "pm.collectionVariables.set('taskId', payload.taskId);"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "sourceImage",
                  "type": "file",
                  "src": "",
                  "description": "Face reference image; JPEG, PNG, WebP, HEIC, or HEIF; maximum 30 MB."
                },
                {
                  "key": "targetVideo",
                  "type": "file",
                  "src": "",
                  "description": "Target MP4, MOV, or WebM video; maximum 200 MB and 300 seconds."
                },
                {
                  "key": "quality",
                  "type": "text",
                  "value": "1080p",
                  "description": ""
                }
              ]
            },
            "url": "{{baseUrl}}/api/ai-tasks/video",
            "description": "The face image can be up to 30 MB. The MP4, MOV, or WebM target can be up to 200 MB and 300 seconds. One face reference is applied to the primary on-camera person; separate reference mapping for multiple people in one video is not supported. Duration is rounded up. 720p costs 2 credits per second with a 6-credit minimum; 1080p costs 5 credits per second with a 15-credit minimum.\n\nRequires a verified account email and sufficient credits."
          },
          "response": []
        },
        {
          "name": "Poll Video face swap task",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{baseUrl}}/api/ai-tasks/video?taskId={{taskId}}",
            "description": "Poll this endpoint until status is COMPLETED, FAILED, or CANCELLED. Polling is the currently supported completion mechanism; webhook callbacks are not available."
          },
          "response": []
        }
      ]
    },
    {
      "name": "GIF or short-clip face swap",
      "description": "The face image can be up to 30 MB. The GIF, MP4, or WebM target can be up to 100 MB and 30 seconds. Duration is rounded up. Cost is 3 credits per second with a 10-credit minimum.",
      "item": [
        {
          "name": "Create GIF or short-clip face swap task",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Task accepted', function () { pm.expect(pm.response.code).to.eql(200); });",
                  "const payload = pm.response.json();",
                  "pm.expect(payload.taskId).to.be.a('string');",
                  "pm.collectionVariables.set('taskId', payload.taskId);"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "sourceImage",
                  "type": "file",
                  "src": "",
                  "description": "Face reference image; JPEG, PNG, WebP, HEIC, or HEIF; maximum 30 MB."
                },
                {
                  "key": "targetGif",
                  "type": "file",
                  "src": "",
                  "description": "Target GIF, MP4, or WebM animation; maximum 100 MB and 30 seconds."
                }
              ]
            },
            "url": "{{baseUrl}}/api/ai-tasks/gif",
            "description": "The face image can be up to 30 MB. The GIF, MP4, or WebM target can be up to 100 MB and 30 seconds. Duration is rounded up. Cost is 3 credits per second with a 10-credit minimum.\n\nRequires a verified account email and sufficient credits."
          },
          "response": []
        },
        {
          "name": "Poll GIF or short-clip face swap task",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{baseUrl}}/api/ai-tasks/gif?taskId={{taskId}}",
            "description": "Poll this endpoint until status is COMPLETED, FAILED, or CANCELLED. Polling is the currently supported completion mechanism; webhook callbacks are not available."
          },
          "response": []
        }
      ]
    }
  ]
}
