Endpoint
POST https://openapi.akool.com/api/open/v4/image2Video/updateVideoAudio
Request Headers
| Parameter | Value | Description |
|---|---|---|
| x-api-key | API Key | Your API Key used for request authorization. If both Authorization and x-api-key have values, Authorization will be used first and x-api-key will be discarded. |
| Authorization | Bearer {token} | Your API Key used for request authorization.Get Token |
Body Attributes
| Parameter | Type | Required | Description |
|---|---|---|---|
| pre_video_id | String | true | Image to Video result _id |
| audio_url | String | true | Audio URL, required when audio_type = 2 |
| audio_type | Integer | true | 1 = AI Generate, 2 = user custom upload |
Response Attributes
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Interface returns business status code (1000:success) |
| msg | String | Interface returns status information |
| data | Object | Response data object |
| - create_time | Long | Creation timestamp |
| - uid | Integer | User ID |
| - team_id | String | Team ID |
| - update_time | Long | Last update time |
| - video_duration | Number | Video duration |
| - webhookUrl | String | Callback URL |
| - resolution | String | Resolution |
| - file_name | String | File name |
| - effect_name | String | Effect name |
| - _id | String | Document ID |
| - pre_video_id | String | Original video ID |
| - image_url | String | Image URL |
| - prompt | String | Prompt text |
| - negative_prompt | String | Negative prompt |
| - extend_prompt | Boolean | Whether extended prompts were used |
| - audio_type | Integer | Audio type |
| - audio_url | String | Audio URL |
| - deduction_credit | Integer | Credits deducted |
| - effect_code | String | Effect code |
| - status | Integer | Status: 1=queueing, 2=processing, 3=completed, 4=failed |
| - only_add_audio | Boolean | Whether only audio was added |
Example
Request Body
{
"pre_video_id": "6890830af27dfad2a3e6062d",
"audio_url": "https://drz0f01yeq1cx.cloudfront.net/1753772497950-9213-1749809724426audio.mp3",
"audio_type": 2
}
Request
curl --location 'https://openapi.akool.com/api/open/v4/image2Video/updateVideoAudio' \
--header 'x-api-key: {{API Key}}' \
--header 'Content-Type: application/json' \
--data '{
"pre_video_id": "6890830af27dfad2a3e6062d",
"audio_url": "https://drz0f01yeq1cx.cloudfront.net/1753772497950-9213-1749809724426audio.mp3",
"audio_type": 2
}'
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"pre_video_id\": \"6890830af27dfad2a3e6062d\",\n \"audio_url\": \"https://drz0f01yeq1cx.cloudfront.net/1753772497950-9213-1749809724426audio.mp3\",\n \"audio_type\": 2\n}");
Request request = new Request.Builder()
.url("https://openapi.akool.com/api/open/v4/image2Video/updateVideoAudio")
.method("POST", body)
.addHeader("x-api-key", "{{API Key}}")
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();
const myHeaders = new Headers();
myHeaders.append("x-api-key", "{{API Key}}");
myHeaders.append("Content-Type", "application/json");
const raw = JSON.stringify({
"pre_video_id": "6890830af27dfad2a3e6062d",
"audio_url": "https://drz0f01yeq1cx.cloudfront.net/1753772497950-9213-1749809724426audio.mp3",
"audio_type": 2
});
const requestOptions = {
method: "POST",
headers: myHeaders,
body: raw,
redirect: "follow"
};
fetch("https://openapi.akool.com/api/open/v4/image2Video/updateVideoAudio", requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.error(error));
<?php
$client = new Client();
$headers = [
'x-api-key' =>'{{API Key}}',
'Content-Type' => 'application/json'
];
$body = '{
"pre_video_id": "6890830af27dfad2a3e6062d",
"audio_url": "https://drz0f01yeq1cx.cloudfront.net/1753772497950-9213-1749809724426audio.mp3",
"audio_type": 2
}';
$request = new Request('POST', 'https://openapi.akool.com/api/open/v4/image2Video/updateVideoAudio', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
?>
import requests
import json
url = "https://openapi.akool.com/api/open/v4/image2Video/updateVideoAudio"
payload = json.dumps({
"pre_video_id": "6890830af27dfad2a3e6062d",
"audio_url": "https://drz0f01yeq1cx.cloudfront.net/1753772497950-9213-1749809724426audio.mp3",
"audio_type": 2
})
headers = {
'x-api-key':'{{API Key}}',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
Response
{
"code": 1000,
"msg": "OK",
"data": {
"create_time": 1754374697629,
"uid": 101400,
"team_id": "6805fb69e92d9edc7ca0b409",
"update_time": 1754374394023,
"video_duration": 5.063,
"webhookUrl": "",
"resolution": "4k",
"file_name": "Image2Video_Animate this image with .mp4",
"effect_name": "Squish",
"_id": "6891a2295d612f78c9204f77",
"pre_video_id": "6891a07f5d612f78c9204f1c",
"image_url": "https://drz0f01yeq1cx.cloudfront.net/1753772478686-9524-b6e4169bb1b44d5d8361936b3f6eddb8.png",
"prompt": "Animate this image with smooth camera movement and subtle object motion.",
"negative_prompt": "",
"extend_prompt": false,
"audio_type": 2,
"audio_url": "https://drz0f01yeq1cx.cloudfront.net/1753772497950-9213-1749809724426audio.mp3",
"deduction_credit": 5,
"effect_code": "squish_89244231312",
"status": 1,
"only_add_audio": true
}
}
Important Notes
- The
pre_video_idmust be the_idof a completed video (status = 3) from a previous Create Image to Video request - When
audio_typeis 2 (custom upload), theaudio_urlparameter is required - When
audio_typeis 1 (AI generate), the system will automatically generate matching audio - The response creates a new video entry with its own
_id; use this to track the audio update status via Get Image to Video Results - Video to Audio is charged separately (5 credits for 5s, 10 credits for 10s) unless included in the original Image to Video creation