Endpoint
Request Headers
| Parameter | Value | Description |
|---|---|---|
| x-api-key | API Key | Request authorization. If both Authorization and x-api-key are set, platform rules determine precedence. |
| Authorization | Bearer {token} | Optional Bearer token. Get Token |
| Content-Type | application/json | Required |
Body Attributes
| Parameter | Type | Required | Description |
|---|---|---|---|
| video_url | String | true | Identical source video URL as used in analysis |
| mappings | Array | true | At least 1 object, at most 5 |
| - obj_id | Number | true | Subject id from analysis_result.media[].obj_id |
| - img_url | String | true | Single reference face image URL (http / https) for that obj_id |
| model_name | String | true | Model id — see Model names below |
| resolution | String | true | Output resolution: 480p or 720p |
| template_id | String | false | Template id when enabled for your tenant |
| keep_original_sound | Boolean | false | Keep source audio (default true) |
| webhookUrl | String | false | HTTPS recommended; final-state callback (format per platform / support) |
Model names
| Value | Description |
|---|---|
| akool-premium | Head swap generation model |
1003 with a message such as Your current account does not support this feature.
Response Attributes
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Business status code (1000 = success) |
| msg | String | Status message |
| data | Object | Created task |
| - _id | String | Task id — use with Get Head Swap Task Detail |
| - create_time | Long | Creation time (ms) |
| - uid | Integer | User id |
| - team_id | String | Team id |
| - video_duration | Number | Associated video duration (seconds) |
| - task_id | String | Internal processing id |
| - resolution | String | Output resolution |
| - status | Integer | Usually 1 (queue) when created |
| - deduction_lock_duration | Number | Pre-hold / lock value (billing semantics per agreement) |
| - model_name | String | Model used |
| - file_name | String | Output file name (platform-generated) |
| - video_url | null | Often null at create time; poll Get Head Swap Task Detail for the result URL |
Example
Request Body
Request
Response
Important Notes
- More than 5 mappings may return an error such as:
Up to 5 characters can be replaced at one time. - Credits are validated on create; insufficient balance often returns
1104. - Store
data._idand poll Get Head Swap Task Detail (or wait forwebhookUrl) for the outputvideo_url.