Skip to main content
POST
Replace a person in the input video with the character
Swap a character in an input video for one shown in a reference image, preserving motion and composition. Returns a request_id for status polling.
Prerequisite: Consult the Model Selection endpoint to identify a valid model slug and check specific limits.

Authorizations

Authorization
string
header
required

Sanctum personal access token, sent as Authorization: Bearer <token>. The token is opaque — it carries no claims and no embedded expiry, so do not attempt to decode it. Issue and revoke tokens from your account dashboard.

Headers

Accept
enum<string>
default:application/json
required
Available options:
application/json

Body

multipart/form-data

Video replace parameters

Every example in this schema is a working set for the model example shown — they are not defaults and not portable. Sizes, step counts, frame counts and frame rates are all per-model: read info.limits and info.defaults for the model you actually intend to use from GET /api/v2/models. Substituting a different model while keeping these values is the most common source of a 422.

video
file
required

Input video file. Supported formats: MP4, MPEG, QuickTime, AVI, WMV, OGG.

ref_image
file
required

Reference character image. Supported formats: JPG, JPEG, PNG, GIF, BMP, WebP. Maximum file size: 10 MB.

model
string
required

The model to use for video replacement. Available models can be retrieved via the GET /api/v2/models endpoint.

Example:

"Wan2_2_Animate_14B_INT8"

prompt
string | null

Optional text prompt to guide the replacement

Example:

"A dancer performing on a neon-lit stage"

width
integer | null

Output video width in pixels. If omitted, uses input video width. Must be provided together with height. The accepted range is model-specific — read info.limits.min_width/max_width and min_height/max_height for your model from GET /api/v2/models. Some models also publish dimension_multiple or resolution_step: values are snapped DOWN to that grid before validation, so an off-grid size is silently reduced rather than rejected. max_pixels and max_ratio, where present, cap total area and aspect ratio on top of the per-side bounds.

Example:

768

height
integer | null

Output video height in pixels. If omitted, uses input video height. Must be provided together with width. The accepted range is model-specific — read info.limits.min_width/max_width and min_height/max_height for your model from GET /api/v2/models. Some models also publish dimension_multiple or resolution_step: values are snapped DOWN to that grid before validation, so an off-grid size is silently reduced rather than rejected. max_pixels and max_ratio, where present, cap total area and aspect ratio on top of the per-side bounds.

Example:

768

steps
integer

Number of inference steps (default: 4). The accepted range is model-specific — read info.limits.min_steps/max_steps for your model from GET /api/v2/models; the base rule allows 1-100 but a model may narrow it further.

Example:

4

seed
integer

Random seed for generation (default: -1 for random)

Example:

-1

webhook_url
string<uri> | null

Optional HTTPS URL to receive webhook notifications for job status changes (processing, completed, failed). Must be HTTPS. Max 2048 characters. A per-request URL is self-contained: it is delivered even when the account has no webhook configuration, or the account webhook is disabled. See the webhooks block at the top level of this document for the event payloads and the headers each delivery carries.

Maximum string length: 2048
Example:

"https://your-server.com/webhooks/deapi"

webhook_secret
string | null

Optional per-request HMAC secret (min. 32 chars) used to sign the webhook callback. Overrides the account-default secret for this job only. If omitted, the account-default secret signs the callback; if no secret exists at all, the callback is still delivered but UNSIGNED (empty X-DeAPI-Signature header). Requires webhook_url to also be set.

Required string length: 32 - 255
Example:

"a1b2c3d4e5f60708091a2b3c4d5e6f7081920a1b2c3d4e5f60708091a2b3c4d5"

Response

ID of the inference request.

data
object
required

Information from success endpoint