Skip to content

API > Integrate API into your product

How to use our Multiswap endpoints

This page documents MultiSwap Realistic v5. Stylized v1 follows the same process — see the Swagger UI for stylized-specific paths.

All requests require authentication. Include your API key in the header.

Workflow

Every MultiSwap generation follows three steps:

  1. Submit a generation request → receive a job ID
  2. Poll the status endpoint → receive a base64-encoded image
  3. Decode base64 → use the image in your product

Step 1: Generate an Image

For realistic, use: POST /v5/run/multi_swap

for stylized use: POST /v1/run/stylized_multi_swap

Parameters

Parameter Type Required Description
input_image string yes Base64-encoded image or public URL. Landscape orientation recommended.
style_id int or string yes Integer style ID (1–25) from the catalog, or UUID (paid/self-created/alias)
outpaint bool yes true = expand image beyond original frame, false = maintain original perspective

Example Request

{
  "input_image": "<base64_encoded_image>",
  "style_id": 3,
  "outpaint": false
}

Example Response

{
  "id": "job-xyz-789",
  "status": "IN_QUEUE"
}

Save the id — you need it for the next step.

Notes

  • Cost: 3 credits per request.

Step 2: Check Status & Retrieve Image

POST /v5/status_multi_swap/{job_id}

POST to this endpoint with your job ID syncronus await until the status is COMPLETED or FAILED.

Response

{
  "id": "job-xyz-789",
  "status": "COMPLETED",
  "output": {
    "images": ["<base64_encoded_image>"]
  }
}

Status Values

Status Meaning
IN_QUEUE Waiting to be processed
PROCESSING Generation in progress
COMPLETED Done — image available in output.images
FAILED Generation failed — check your inputs

Step 3: Decode Base64

Take the string from output.images[0] and decode it with any standard base64 library. The result is a PNG image.


Quick Recipe

  1. POST /v5/run/multi_swap with input_image, style_id, outpaint → save returned id
  2. POST /v5/status_multi_swap/{id} → poll until status = COMPLETED
  3. Read output.images[0] → base64 decode → image file

MultiSwap Stylized (v1)

Same workflow with different endpoints:

Purpose Endpoint
Generate POST /v1/run/stylized_multi_swap
Status POST /v1/status_stylized_multi_swap/{job_id}

See Swagger UI for stylized parameter details.


Troubleshooting

I never receive COMPLETED status

  • Verify you are using the correct status endpoint (POST /v5/status_multi_swap/{job_id}).
  • Check that you are passing the exact id returned by the generation endpoint.

Base64 decoding issues

  • Make sure you copied the full base64 string without extra quotes or whitespace.