Documentation Index
Fetch the complete documentation index at: https://docs.akool.com/llms.txt
Use this file to discover all available pages before exploring further.
Endpoint
POST https://openapi.akool.com/api/open/v4/headswap/analyze
| Parameter | Value | Description |
|---|
| x-api-key | API Key | Request authorization. If both Authorization and x-api-key are set, platform rules determine precedence (often Authorization first). |
| Authorization | Bearer {token} | Optional Bearer token. Get Token |
| Content-Type | application/json | Required for JSON body |
Body Attributes
| Parameter | Type | Required | Description |
|---|
| video_url | String | true | Publicly accessible source video URL (http or https) |
| type | String | true | For head swap, always head |
Response Attributes
| Parameter | Type | Description |
|---|
| code | Integer | Business status code (1000 = success) |
| msg | String | Status message (often Analyze success on success) |
| data | Object | Analysis record |
| - _id | String | Analysis record id — use with Get Analysis Result |
| - create_time | Long | Creation time (ms) |
| - uid | Integer | User id |
| - team_id | String | Team id |
| - video_url | String | Source video URL |
| - type | String | head |
| - status | Integer | 1 queue, 2 processing, 3 completed, 4 failed |
| - task_id | String | Internal processing id (support / tickets) |
| - progress | Number | Approximate progress 0–100 |
| - analysis_result | Object | null | Usually null right after submit; populated when completed |
| - error_reason | String | Error description if any |
| - error_code | Number | Error code if any |
Example
Request Body
{
"video_url": "https://example.com/videos/source.mp4",
"type": "head"
}
Request
curl --location 'https://openapi.akool.com/api/open/v4/headswap/analyze' \
--header 'x-api-key: {{API Key}}' \
--header 'Content-Type: application/json' \
--data '{
"video_url": "https://example.com/videos/source.mp4",
"type": "head"
}'
Response
{
"code": 1000,
"msg": "Analyze success",
"data": {
"_id": "6a066d03625746c797390f55",
"create_time": 1778806019014,
"uid": 101400,
"team_id": "6805fb69e92d9edc7ca0b409",
"video_url": "https://example.com/videos/source.mp4",
"type": "head",
"status": 1,
"task_id": "6a066d022872921bde86b72f",
"progress": 0
}
}
Important Notes
- Save
data._id and poll Get Analysis Result until status is 3 or 4.
- Video length must be within the documented duration window (about 3–20 seconds).
- Invalid
video_url, wrong type, or service issues return non-1000 code / descriptive msg.