curl --request POST \
--url 'https://openapi.akool.com/api/open/v5/characterSwap/analyze' \
--header 'x-api-key: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"url": "https://example.com/source.mp4",
"media_type": "video",
"type": "person"
}'
curl --request POST \
--url 'https://openapi.akool.com/api/open/v5/characterSwap/analyze' \
--header 'x-api-key: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"url": "https://example.com/source.jpg",
"media_type": "image",
"type": "person"
}'
{
"code": 1000,
"msg": "OK",
"data": {
"_id": "670000000000000000000001",
"task_id": "",
"status": 1,
"media_type": "video"
}
}
{
"code": 1000,
"msg": "OK",
"data": {
"_id": "670000000000000000000001",
"task_id": "",
"status": 1,
"media_type": "image"
}
}
API Endpoints
Analyze Source Material
Analyze Source Material for Character Swap V5.
POST
/
api
/
open
/
v5
/
characterSwap
/
analyze
curl --request POST \
--url 'https://openapi.akool.com/api/open/v5/characterSwap/analyze' \
--header 'x-api-key: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"url": "https://example.com/source.mp4",
"media_type": "video",
"type": "person"
}'
curl --request POST \
--url 'https://openapi.akool.com/api/open/v5/characterSwap/analyze' \
--header 'x-api-key: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"url": "https://example.com/source.jpg",
"media_type": "image",
"type": "person"
}'
{
"code": 1000,
"msg": "OK",
"data": {
"_id": "670000000000000000000001",
"task_id": "",
"status": 1,
"media_type": "video"
}
}
{
"code": 1000,
"msg": "OK",
"data": {
"_id": "670000000000000000000001",
"task_id": "",
"status": 1,
"media_type": "image"
}
}
POST https://openapi.akool.com/api/open/v5/characterSwap/analyze
Akool video replacement needs a completed person analysis of the same video. Image replacement uses face bounding boxes directly, and Kling video uses its own preparation workflow; neither needs an analyze_id.
| Parameter | Type | Required | Description |
|---|---|---|---|
| url | String | true | Public source material URL. Use the identical URL during task creation. |
| media_type | String | true | image or video. Use the same media type and URL when creating an analysis-driven task. |
| type | String | false | This endpoint always performs person analysis. Omit type or send person; other accepted type values do not change the effective category. |
Request examples
Select a source scenario to view matching request and queued response examples. URLs and IDs are illustrative; replace them with your accessible source material.- Source video
- Source image
Body
{
"url": "https://example.com/source.mp4",
"media_type": "video",
"type": "person"
}
Body
{
"url": "https://example.com/source.jpg",
"media_type": "image",
"type": "person"
}
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Business response code. |
| msg | String | Response message. |
| data | Object | Newly created analysis. |
| - _id | String | Analysis ID. |
| - 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 | Initially 1 (queueing). |
| - media_type | String | Source media type. |
data._id as the analysis ID.
For input limits, billing, callbacks, and error codes, see the Character Swap V5 overview.
curl --request POST \
--url 'https://openapi.akool.com/api/open/v5/characterSwap/analyze' \
--header 'x-api-key: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"url": "https://example.com/source.mp4",
"media_type": "video",
"type": "person"
}'
curl --request POST \
--url 'https://openapi.akool.com/api/open/v5/characterSwap/analyze' \
--header 'x-api-key: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"url": "https://example.com/source.jpg",
"media_type": "image",
"type": "person"
}'
{
"code": 1000,
"msg": "OK",
"data": {
"_id": "670000000000000000000001",
"task_id": "",
"status": 1,
"media_type": "video"
}
}
{
"code": 1000,
"msg": "OK",
"data": {
"_id": "670000000000000000000001",
"task_id": "",
"status": 1,
"media_type": "image"
}
}
Authorizations
ApiKeyAuthBearerAuth
Body
application/json
Public source material URL. Use the identical URL during task creation.
image or video. Use the same media type and URL when creating an analysis-driven task.
Available options:
image, video This endpoint always performs person analysis. Omit type or send person; other accepted type values do not change the effective category.
Available options:
person, head, outfit