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
Parameter
Type
Required
Description
media_type
String
true
image or video.
target_url
String
true
Public source scene image or video URL.
model_name
String
false
Defaults to akool-premium-multi-person. Get supported IDs from the models endpoint.
mappings
Array
conditional
Image: 1–2 mappings with source_url, source_bbox, and target_bbox. Akool video: 1–5 mappings with obj_id and img_url.
mappings[].source_url
String
image
Reference character image URL.
mappings[].source_bbox
Array
image
Reference face bounding box [x1,y1,x2,y2] in original-image pixels.
mappings[].target_bbox
Array
image
Target face bounding box [x1,y1,x2,y2] in original-image pixels. The same target box cannot be mapped twice.
mappings[].obj_id
Integer
Akool video
Person ID from the analysis result.
mappings[].img_url
String
Akool video
Reference character image URL.
analyze_id
String
Akool video only
Completed person analysis _id for the identical source video URL; not needed for image or Kling video.
character_orientation
String
false
Kling video: image or video; defaults to video.
image
String
Kling video
Reference character URL for a single-person Kling replacement.
resolution
String
false
Image: automatic. Akool video: 480p or 720p. Kling: choose from the model’s supported values.
keep_original_sound
Boolean
false
Keep source video audio; defaults to true.
prompt
String
false
Video generation instructions: up to 2500 characters for Kling and 5000 for Akool. Overlong prompts are rejected before generation. Image replacement generates its instructions from mappings.
negative_prompt
String
false
Optional Kling video negative instructions, up to 5000 characters.
webhookUrl
String
false
Optional final-state callback URL; follow the Webhook guide.
Response Attributes
Parameter
Type
Description
code
Integer
Business response code; 1000 means the request succeeded.
msg
String
Response message.
data
Object
Batch creation result.
- list
Array
Successfully created tasks.
— _id
String
Task ID to use for result polling.
— task_id
String
Downstream algorithm/provider task ID; may be empty until submission. Use _id, not this value, for task-detail queries. It may change between workflow stages.
— status
Integer
Initial task status.
— media_type
String
Output media type: image or video.
— model_name
String
Selected model ID.
— deduction_credit
Number
Task billing amount.
— create_time
Number
Creation timestamp in milliseconds.
- errors
Array
Inputs that could not create a task. Inspect this array even when code is 1000.
— index
Integer
Zero-based plan/input index that failed during submission.
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.
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).