Swap face in video
swap_face_in_videoUse only with the user's own likeness or content they are authorized to use. Do not use for impersonation, deception, sexual content, or content involving minors.
Swaps faces in an existing video: all faces with a reference image, or selected faces using detect_faces results. Starts a background job that costs credits; returns a project id for wait_for_video_project. Before choosing settings, read get_account_info and the current parameter constraints. A listed model, resolution, duration or count is not necessarily available together or on this account. Preserve explicit requirements and all supplied inputs; explain a genuine block instead of submitting an incompatible request. Account balance alone does not prove a request is affordable. Use the named attachment fields first for ChatGPT files. Ask which file goes where if their roles are unclear. If a file fails, ask the user to attach it again and keep the requested settings.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"start_seconds": "<start_seconds>",
"end_seconds": "<end_seconds>",
"assets": "<assets>"
},
"name": "swap_face_in_video"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Optional project name for identifying this output. Omit to use the API's default project name. | Face Swap - dateTime |
| style | No | Style of the face swap video. | |
| video | No | Attach the video from ChatGPT for this input. Set assets.video_source to file. | |
| assets | Yes | Provide the assets for face swap. For video, The `video_source` field determines whether `video_file_path` or `youtube_url` field is used | |
| end_seconds | Yes | End time of your clip (seconds). Must be greater than start_seconds. | |
| source_face | No | Attach the source face from ChatGPT for this input. | |
| start_seconds | Yes | Start time of your clip (seconds). Must be ≥ 0. | |
| replacement_faces | No | Attached image files. Set image_index in each matching entry to its position in this list, starting at 1. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Unique ID of the video. Use it with the [Get video Project API](https://docs.magichour.ai/api-reference/video-projects/get-video-details) to fetch status and downloads. | |
| credits_charged | Yes | The amount of credits deducted from your account to generate the video. If the status is not 'complete', this value is an estimate and may be adjusted upon completion based on the actual FPS of the output video. If video generation fails, credits will be refunded, and this field will be updated to include the refund. |