> ## 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.

# Create Batch Image to Video

> Create multiple videos from images in a single request with AI-powered animation

> [!WARNING]
>
> The resources (image, video, voice) generated by our API are valid for 7 days.
> Please save the relevant resources as soon as possible to prevent expiration.

## Endpoint

```
POST https://openapi.akool.com/api/open/v4/image2Video/createBySourcePrompt/batch
```

## 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](https://docs.akool.com/authentication/usage.md#get-the-token) |

## Body Attributes

| **Parameter** | **Type** | **Required** | **Description** |
| - | - | - | - |
| image\_url | String | true | Image URL to be animated |
| prompt | String | true | Prompt text describing how to animate the image |
| model\_name | String | false | AI model name (get available models from [Get AI Model List](https://docs.akool.com/ai-tools-suite/aimodel.md#get-ai-model-list)) |
| negative\_prompt | String | false | Prompt text describing what to avoid in the animation |
| extend\_prompt | Boolean | false | Whether to use algorithm default extended prompts |
| resolution | String | true | Resolution value (e.g., 720p, 1080p, 4k). Available options are retrieved from the resolutionList field of the selected model in [Get AI Model List](https://docs.akool.com/ai-tools-suite/aimodel.md#get-ai-model-list) |
| video\_length | Integer | true | Video duration in seconds. Available durations are retrieved from the durationList field of the selected model in [Get AI Model List](https://docs.akool.com/ai-tools-suite/aimodel.md#get-ai-model-list) |
| last\_image\_url | String | false | URL of the image to use as the last frame of the video |
| generate\_audio | Boolean | false | Whether to generate AI audio alongside the video. Only applicable to models that support audio generation — check the `generate_audio` field in [Get AI Model List](https://docs.akool.com/ai-tools-suite/aimodel.md#get-ai-model-list) (non-null means supported). Default: `false`. Enabling this on supported models may increase credit consumption |
| count | Integer | false | Number of videos to create simultaneously (1-10), default: 1 |
| webhookurl | String | false | Callback URL for POST requests |

## 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 |
| - successList | Array | Array of successfully created video tasks |
| - errorList | Array | Array of failed tasks with error information |

### successList Item Attributes

| **Parameter** | **Type** | **Description** |
| - | - | - |
| \_id | String | Document ID |
| create\_time | Long | Creation timestamp |
| uid | Integer | User ID |
| team\_id | String | Team ID |
| status | Integer | Task status: 1=queueing, 2=processing, 3=completed, 4=failed |
| webhookUrl | String | Callback URL |
| resolution | String | Video resolution |
| file\_name | String | Output file name |
| effect\_name | String | Effect name |
| image\_url | String | Input image URL |
| prompt | String | Animation prompt |
| negative\_prompt | String | Negative prompt |
| extend\_prompt | Boolean | Whether extended prompts were used |
| last\_image\_url | String | Last frame image URL |
| deduction\_credit | Integer | Credits deducted |
| model\_name | String | AI model name used |
| batch\_id | String | Batch ID for grouping videos created in the same request |
| batch\_count | Integer | Total number of videos in this batch |

## Example

### Request Body

```json theme={null}
{
  "image_url": "https://drz0f01yeq1cx.cloudfront.net/1753772478686-9524-b6e4169bb1b44d5d8361936b3f6eddb8.png",
  "prompt": "Animate this image with smooth camera movement and subtle object motion.",
  "model_name": "seedance-1-0-lite-i2v-250428",
  "negative_prompt": "blurry, distorted, low quality",
  "extend_prompt": true,
  "resolution": "720p",
  "video_length": 5,
  "last_image_url": "https://drz0f01yeq1cx.cloudfront.net/1753772478686-9524-last-frame.png",
  "count": 3
}
```

### Request Body - With Audio Generation

Use `generate_audio` when the selected model supports audio generation (e.g., `AkoolImage2VideoFastV1`, `AkoolImage2VideoHDV1`):

```json theme={null}
{
  "image_url": "https://drz0f01yeq1cx.cloudfront.net/1753772478686-9524-b6e4169bb1b44d5d8361936b3f6eddb8.png",
  "prompt": "Animate this image with smooth camera movement and ambient background sound.",
  "model_name": "AkoolImage2VideoFastV1",
  "resolution": "720p",
  "video_length": 5,
  "generate_audio": true,
  "count": 1
}
```

### Request

```bash cURL theme={null}
curl --location 'https://openapi.akool.com/api/open/v4/image2Video/createBySourcePrompt/batch' \
--header 'x-api-key: {{API Key}}' \
--header 'Content-Type: application/json' \
--data '{
  "image_url": "https://drz0f01yeq1cx.cloudfront.net/1753772478686-9524-b6e4169bb1b44d5d8361936b3f6eddb8.png",
  "prompt": "Animate this image with smooth camera movement and subtle object motion.",
  "model_name": "seedance-1-0-lite-i2v-250428",
  "negative_prompt": "blurry, distorted, low quality",
  "extend_prompt": true,
  "resolution": "720p",
  "video_length": 5,
  "last_image_url": "https://drz0f01yeq1cx.cloudfront.net/1753772478686-9524-last-frame.png",
  "count": 3
}'
```

```java Java theme={null}
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n  \"image_url\": \"https://drz0f01yeq1cx.cloudfront.net/1753772478686-9524-b6e4169bb1b44d5d8361936b3f6eddb8.png\",\n  \"prompt\": \"Animate this image with smooth camera movement and subtle object motion.\",\n  \"model_name\": \"seedance-1-0-lite-i2v-250428\",\n  \"negative_prompt\": \"blurry, distorted, low quality\",\n  \"extend_prompt\": true,\n  \"resolution\": \"720p\",\n  \"video_length\": 5,\n  \"last_image_url\": \"https://drz0f01yeq1cx.cloudfront.net/1753772478686-9524-last-frame.png\",\n  \"count\": 3\n}");
Request request = new Request.Builder()
  .url("https://openapi.akool.com/api/open/v4/image2Video/createBySourcePrompt/batch")
  .method("POST", body)
  .addHeader("x-api-key", "{{API Key}}")
  .addHeader("Content-Type", "application/json")
  .build();
Response response = client.newCall(request).execute();
```

```js Javascript theme={null}
const myHeaders = new Headers();
myHeaders.append("x-api-key", "{{API Key}}");
myHeaders.append("Content-Type", "application/json");

const raw = JSON.stringify({
  "image_url": "https://drz0f01yeq1cx.cloudfront.net/1753772478686-9524-b6e4169bb1b44d5d8361936b3f6eddb8.png",
  "prompt": "Animate this image with smooth camera movement and subtle object motion.",
  "model_name": "seedance-1-0-lite-i2v-250428",
  "negative_prompt": "blurry, distorted, low quality",
  "extend_prompt": true,
  "resolution": "720p",
  "video_length": 5,
  "last_image_url": "https://drz0f01yeq1cx.cloudfront.net/1753772478686-9524-last-frame.png",
  "count": 3
});

const requestOptions = {
  method: "POST",
  headers: myHeaders,
  body: raw,
  redirect: "follow"
};

fetch("https://openapi.akool.com/api/open/v4/image2Video/createBySourcePrompt/batch", requestOptions)
  .then((response) => response.text())
  .then((result) => console.log(result))
  .catch((error) => console.error(error));
```

```php PHP theme={null}
<?php
$client = new Client();
$headers = [
  'x-api-key' =>'{{API Key}}',
  'Content-Type' => 'application/json'
];
$body = '{
  "image_url": "https://drz0f01yeq1cx.cloudfront.net/1753772478686-9524-b6e4169bb1b44d5d8361936b3f6eddb8.png",
  "prompt": "Animate this image with smooth camera movement and subtle object motion.",
  "model_name": "seedance-1-0-lite-i2v-250428",
  "negative_prompt": "blurry, distorted, low quality",
  "extend_prompt": true,
  "resolution": "720p",
  "video_length": 5,
  "last_image_url": "https://drz0f01yeq1cx.cloudfront.net/1753772478686-9524-last-frame.png",
  "count": 3
}';
$request = new Request('POST', 'https://openapi.akool.com/api/open/v4/image2Video/createBySourcePrompt/batch', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
?>
```

```python Python theme={null}
import requests
import json

url = "https://openapi.akool.com/api/open/v4/image2Video/createBySourcePrompt/batch"

payload = json.dumps({
  "image_url": "https://drz0f01yeq1cx.cloudfront.net/1753772478686-9524-b6e4169bb1b44d5d8361936b3f6eddb8.png",
  "prompt": "Animate this image with smooth camera movement and subtle object motion.",
  "model_name": "seedance-1-0-lite-i2v-250428",
  "negative_prompt": "blurry, distorted, low quality",
  "extend_prompt": True,
  "resolution": "720p",
  "video_length": 5,
  "last_image_url": "https://drz0f01yeq1cx.cloudfront.net/1753772478686-9524-last-frame.png",
  "count": 3
})
headers = {
  'x-api-key':'{{API Key}}',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
```

### Response

```json theme={null}
{
  "code": 1000,
  "msg": "OK",
  "data": {
    "successList": [
      {
        "_id": "689174694b4dbdd4ab3d28c9",
        "create_time": 1754362985482,
        "uid": 101400,
        "team_id": "6805fb69e92d9edc7ca0b409",
        "status": 1,
        "webhookUrl": "",
        "resolution": "720p",
        "file_name": "Image2Video_Animate this image with .mp4",
        "image_url": "https://drz0f01yeq1cx.cloudfront.net/1753772478686-9524-b6e4169bb1b44d5d8361936b3f6eddb8.png",
        "prompt": "Animate this image with smooth camera movement and subtle object motion.",
        "negative_prompt": "blurry, distorted, low quality",
        "extend_prompt": true,
        "deduction_credit": 5,
        "model_name": "seedance-1-0-lite-i2v-250428",
        "batch_id": "1754362985482_101400",
        "batch_count": 3
      },
      {
        "_id": "689174694b4dbdd4ab3d28ca",
        "create_time": 1754362985483,
        "uid": 101400,
        "team_id": "6805fb69e92d9edc7ca0b409",
        "status": 1,
        "webhookUrl": "",
        "resolution": "720p",
        "file_name": "Image2Video_Animate this image with .mp4",
        "image_url": "https://drz0f01yeq1cx.cloudfront.net/1753772478686-9524-b6e4169bb1b44d5d8361936b3f6eddb8.png",
        "prompt": "Animate this image with smooth camera movement and subtle object motion.",
        "negative_prompt": "blurry, distorted, low quality",
        "extend_prompt": true,
        "deduction_credit": 5,
        "model_name": "seedance-1-0-lite-i2v-250428",
        "batch_id": "1754362985482_101400",
        "batch_count": 3
      },
      {
        "_id": "689174694b4dbdd4ab3d28cb",
        "create_time": 1754362985484,
        "uid": 101400,
        "team_id": "6805fb69e92d9edc7ca0b409",
        "status": 1,
        "webhookUrl": "",
        "resolution": "720p",
        "file_name": "Image2Video_Animate this image with .mp4",
        "image_url": "https://drz0f01yeq1cx.cloudfront.net/1753772478686-9524-b6e4169bb1b44d5d8361936b3f6eddb8.png",
        "prompt": "Animate this image with smooth camera movement and subtle object motion.",
        "negative_prompt": "blurry, distorted, low quality",
        "extend_prompt": true,
        "deduction_credit": 5,
        "model_name": "seedance-1-0-lite-i2v-250428",
        "batch_id": "1754362985482_101400",
        "batch_count": 3
      }
    ],
    "errorList": []
  }
}
```

## Important Notes

* **Batch Size**: You can create 1-10 videos simultaneously in a single request
* **Model Selection**: Use the [Get AI Model List](https://docs.akool.com/ai-tools-suite/aimodel.md#get-ai-model-list) API to get available models and their supported resolutions/durations
* **Resolution**: Available options depend on the selected model; check the model's `resolutionList` field
* **Video Length**: Available durations depend on the selected model; check the model's `durationList` field
* **Last Frame**: Use `last_image_url` to specify what the video's last frame should look like
* **Audio Generation**: Set `generate_audio` to `true` to add AI-generated audio to the output video. This parameter is only effective for models where the `generate_audio` field is not null in the [Get AI Model List](https://docs.akool.com/ai-tools-suite/aimodel.md#get-ai-model-list) response. If the selected model does not support audio generation, this parameter is ignored
* **Credits**: Each video in the batch is charged individually based on resolution and duration. Enabling `generate_audio` on supported models may increase credit consumption
* **Resource Expiration**: Generated videos are valid for 7 days, save them promptly
* **Webhook**: Use `webhookUrl` to receive notifications when each video generation is complete
* Save the `_id` values from the response to check video status using the [Get Image to Video Results](https://docs.akool.com/ai-tools-suite/image2video/get-results.md) API


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.