---
title: "Execute real-time face swap for image/video frame, with preview fallback when GPU estimate exceeds 2 seconds"
method: POST
path: "/api/ai/face-swap"
tags: ["ai-jobs", "face-swap"]
---

# Execute real-time face swap for image/video frame, with preview fallback when GPU estimate exceeds 2 seconds

`POST /api/ai/face-swap`

## Request body

- object
  - `sourceAssetUrl` string, required
  - `targetAssetUrl` string, required
  - `mediaType` 'image' | 'video_frame', required
  - `width` number, required
  - `height` number, required
  - `detectedFaceCount` number, required
  - `sourceFaceIndex` number
  - `targetFaceIndex` number
  - `frameTimeMs` number
  - `consentAttested` boolean
  - `celebrityConfidence` number
  - `nsfwScore` number
  - `actorId` string
  - `workspaceId` string

## Response `200`

Real-time face swap completed

## Other responses

- `202` — Preview fallback served and async job queued
- `403` — Blocked by content policy

---

[API](https://skmtc.net/memesio/apis/memesio-api-contracts.md) · [All operations](https://skmtc.net/memesio/apis/memesio-api-contracts/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/memesio/memesio-api-contracts/revisions/826e6edbf294/schema)
