---
title: "Put your face into a video or a picture"
method: POST
path: "/v1/ai/face-swap"
tags: ["Face swap"]
---

# Put your face into a video or a picture

`POST /v1/ai/face-swap`

## Request

- Base URL: `https://apihub.co.il`
- URL: `https://apihub.co.il/v1/ai/face-swap`
- Auth: HTTP bearer

Puts the face of a photo into a video (up to 15 s) or a picture. Two engines: `wan-replace` (video — the person in the video becomes the one in the photo, the scene's light and colour kept; 480p / 580p / 720p) and `seedream` (picture — the face of the photo on the person in the picture, the pose, clothes and scene kept; `hair` keeps the photo's hair or the picture's). `engine: "auto"` (the default) picks the one for the target; name one to compare them.

**Rules, always on:**
- `consent` (or `consent_id`) is required: the face is yours, or the person gave you explicit permission. It is stored with the time, your account and the files.
- The face is checked before anything is made: a well-known public figure (a politician, a celebrity…) is refused with `public_figure_refused`, a person who appears to be under 18 with `minor_refused`. A refused request is not charged.
- Every result is marked as AI-generated inside the file (IPTC `trainedAlgorithmicMedia`, a comment), and — unless you send `visible_label: false` — carries a small "AI" mark in the corner.
- Each run is logged (who, which face, which target, which engine); the face is kept 30 days, then deleted. The result is kept 24 hours.
- The answer has `abuse_report`: where anyone can report a misuse of the file.

Asynchronous: wait with `x-wait-ms` or poll `GET /v1/executions/{id}`. Price: per second of the output video by resolution (a picture: one price), plus the face check — see the estimate first (`POST /v1/ai/face-swap/estimate`).

**Billing:** Per second of the output video, by resolution (a picture: one price per picture), plus the face's safety check. A refused or failed request is not charged. · **Rate limit:** 6/min · **Asynchronous**

## Headers

- `Idempotency-Key` string
- `X-Tag` string
- `x-wait-ms` integer

## Request body

- object
  - `hair` 'face' | 'target': The picture engine: keep the hair of the face photo (face) or of the target (target)
  - `seed` integer: Repeat a result exactly
  - `engine` 'auto' | 'wan-replace' | 'seedream': auto (the default) = the better engine for the target: wan-replace for a video (the person in the video becomes the one in the photo, the scene's light kept), seedream for a picture (the face of the photo on the person in the picture, the pose, clothes and scene kept). Name one to compare them
  - `gender` 'male' | 'female' | 'non-binary': The person in face_url — an optional hint for the picture engine
  - `consent` object: The rights / consent declaration for this likeness (or send consent_id)
    - `basis` 'own' | 'consent' | 'licensed': own = it is you / your content · consent = the person gave explicit permission · licensed = you hold the rights to this content
    - `locale` 'he' | 'en' | 'ru' | 'uk': Language the statement was shown in
    - `subject` 'self' | 'other': self = your own face / voice / video · other = another person who agreed
    - `accepted` true, required: You accept the consent statement for this scope (GET the text in the docs or the dashboard)
    - `subject_name` string: Required for `other`: the person's full name
  - `face_url` string, uri, required: A clear photo of the face to put in — your own, or of a person who gave you explicit permission (PNG / JPEG / WebP, one face, up to 15 MB). It is checked first: a public figure or a person who appears to be under 18 is refused
  - `consent_id` string: A consent you recorded before (the dashboard records one when you tick the box)
  - `resolution` '480p' | '580p' | '720p': A video's output resolution (wan-replace). 480p is the cheapest; the price per second grows with it
  - `target_url` string, uri, required: The video (up to 15 s) or the picture to put the face into (public https link — upload it first if needed)
  - `target_type` 'video' | 'image': Whether target_url is a video or a picture — read from the file when omitted
  - `visible_label` boolean: Draw a small "AI" mark in the corner (on by default). The file is always marked as AI-generated in its metadata
  - `duration_seconds` number: The video's length if you know it (only for the estimate; the charge uses the real length)

## Response `200`

Completed (or 202 while processing)

- object
  - `id` string: Execution id — stable across internal retries; use it with GET /v1/executions/{id}
  - `status` 'pending' | 'processing' | 'completed' | 'partial' | 'failed' | 'cancelled' | 'timeout'
  - `operation` string
  - `tag` string, nullable: Your X-Tag, if sent
  - `created_at` string, date-time
  - `completed_at` string, date-time, nullable
  - `output` object: Operation result (see each operation). While a Studio render is processing: `stage` (queued · transcribing · downloading · preparing · cleaning_voice · mixing_audio · rendering · finishing), `phase` (the engine's: download · prepare · voice · audio · encode · qa · upload, or null), `progress` (a percent, 0–100) and `progress_fraction` (0–1), `eta_seconds` (seconds left, never below 0) and `estimate_seconds`
  - `error` string, nullable
  - `usage` object
    - `credits_charged` number, nullable
    - `credits_reserved` number
    - `estimated_credits` number
    - `cost_source` 'provider_reported' | 'calculated' | 'estimated' | 'null', nullable
    - `provider_usage` object, nullable: Normalised consumption, e.g. { VIDEO_SECOND: 22.4 }
  - `balance` object
    - `available` number
    - `reserved` number

## Other responses

- `202`: Processing — poll GET /v1/executions/{id}
- `400`: Invalid input
- `402`: Insufficient credits / project budget
- `404`: Resource not found (or not yours)
- `429`: Rate limited
- `503`: Service temporarily paused

---

[API](https://skmtc.dev/apihub/apis/apihub-one-api-for-chat-image-video-ai.md) · [All operations](https://skmtc.dev/apihub/apis/apihub-one-api-for-chat-image-video-ai/llms.txt) · [OpenAPI document](https://skmtc.dev/apihub/apis/apihub-one-api-for-chat-image-video-ai/revisions/a8caa42835ce?raw)
