Skip to main content
POST
Request Headers
Choose the matching request example: Image replacement, Akool video replacement, or Kling video replacement. analyze_id is required only for Akool video. obj_id and img_url belong to mappings[], not analyze_id. Kling uses image and target_url; image replacement uses source_url, source_bbox and target_bbox inside mappings[].
Body Attributes Response Attributes

Request examples

Select a scenario below or in the request sample to view matching request and response examples. URLs, IDs and model selections are illustrative; replace them with accessible resources, completed analyses and models available to your account. Response credit values are examples, not price quotations. Poll each returned _id until completion.
Body
For input limits, billing, callbacks, and error codes, see the Character Swap V5 overview.

Authorizations

x-api-key
string
header
required

Body

application/json
media_type
enum<string>
required
Available options:
image
target_url
string<uri>
required

Public source scene image or video URL.

mappings
object[]
required

Image: 1–2 mappings with source_url, source_bbox, and target_bbox. Akool video: 1–5 mappings with obj_id and img_url.

Required array length: 1 - 2 elements
model_name
enum<string>
Available options:
akool-premium-multi-person
analyze_id
string

Required only for Akool video: completed person analysis _id for the identical source video URL. Image and Kling video do not need it.

Pattern: ^[a-fA-F0-9]{24}$
character_orientation
enum<string>

Kling video: image or video; defaults to video.

Available options:
image,
video
image
string<uri>

Required only for Kling video: public reference-character image URL. target_url is the source video; both must contain a single person.

resolution
string

Image: selected automatically. Akool video: 480p or 720p, using the model default or 480p fallback. Kling video: select a supported value from models (720p fallback).

keep_original_sound
boolean

Keep source video audio; defaults to true. Applies to video requests.

prompt
string

Video generation instructions, up to 5000 characters. Image replacement generates its instructions from mappings.

Maximum string length: 5000
webhookUrl
string<uri>

Optional final-state callback URL; follow the Webhook guide.

negative_prompt
string

Optional Kling video negative instructions.

Maximum string length: 5000

Response

200 - application/json

Business response. Code 1000 means the request succeeded; inspect task status or data.errors for generation/submission outcomes.

code
integer
Example:

1000

msg
string
Example:

"OK"

data
object