> ## 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 Image to Video

> Transform a static image into a dynamic video with AI-powered animation, effects, and audio

<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.
</Warning>

## Endpoint

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

## 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](/authentication/usage#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                                                                      |
| negative\_prompt   | String   | true         | Prompt text describing what to avoid in the animation                                                                |
| extend\_prompt     | Boolean  | false        | Whether to use algorithm default extended prompts                                                                    |
| resolution         | String   | true         | Resolution options: 720p, 1080p, 4k                                                                                  |
| audio\_url         | String   | false        | Audio URL, required when audio\_type = 2                                                                             |
| audio\_type        | Integer  | true         | Audio type: 1 = AI generate, 2 = user custom upload, 3 = none (no audio)                                             |
| video\_length      | Integer  | true         | Video duration in seconds, options: 5, 10 (10s only available for pro and above subscriptions)                       |
| is\_premium\_model | Boolean  | false        | Whether to use premium video model for faster generation (pro and above subscriptions only)                          |
| effect\_code       | String   | false        | Effect code: if specified, prompt content will be ignored.[Get Effect Code](/ai-tools-suite/image2video/get-effects) |
| 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                                         |
| - 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                                                  |
| - \_id              | String   | Document ID                                                  |
| - image\_url        | String   | Input image URL                                              |
| - prompt            | String   | Animation prompt                                             |
| - negative\_prompt  | String   | Negative prompt                                              |
| - extend\_prompt    | Boolean  | Whether extended prompts were used                           |
| - audio\_type       | Integer  | Audio type used                                              |
| - audio\_url        | String   | Audio URL used                                               |
| - deduction\_credit | Integer  | Credits deducted                                             |
| - effect\_code      | String   | Effect code used                                             |

## 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.",
  "negative_prompt": "blurry, distorted hands, missing fingers, unnatural pose, double hands, extra limbs, bad anatomy, low quality, cartoonish, exaggerated features, open mouth, aggressive expression, modern clothing, pixelated, vibrant colors, overexposed, flickering, blurry details, subtitles, logo, style, artwork, painting, picture, static, overall grayish, worst quality, JPEG compression artifacts, ugly, incomplete, extra fingers, poorly drawn hands, poorly drawn face, deformed, disfigured, malformed limbs, fused fingers, static characters, messy background, three legs, crowded background, walking backwards",
  "extend_prompt": true,
  "resolution": "4k",
  "audio_url": "https://drz0f01yeq1cx.cloudfront.net/1753772497950-9213-1749809724426audio.mp3",
  "audio_type": 2,
  "video_length": 10,
  "is_premium_model": true,
  "effect_code": "squish_89244231312",
  "webhookurl": ""
}
```

### Request

<CodeGroup>
  ```bash cURL theme={null}
  curl --location 'https://openapi.akool.com/api/open/v4/image2Video/createBySourcePrompt' \
  --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.",
    "negative_prompt": "blurry, distorted hands, missing fingers, unnatural pose, double hands, extra limbs, bad anatomy, low quality, cartoonish, exaggerated features, open mouth, aggressive expression, modern clothing, pixelated, vibrant colors, overexposed, flickering, blurry details, subtitles, logo, style, artwork, painting, picture, static, overall grayish, worst quality, JPEG compression artifacts, ugly, incomplete, extra fingers, poorly drawn hands, poorly drawn face, deformed, disfigured, malformed limbs, fused fingers, static characters, messy background, three legs, crowded background, walking backwards",
    "extend_prompt": true,
    "resolution": "4k",
    "audio_url": "https://drz0f01yeq1cx.cloudfront.net/1753772497950-9213-1749809724426audio.mp3",
    "audio_type": 2,
    "video_length": 10,
    "is_premium_model": true,
    "effect_code": "squish_89244231312",
    "webhookurl": ""
  }'
  ```

  ```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  \"negative_prompt\": \"blurry, distorted hands, missing fingers, unnatural pose, double hands, extra limbs, bad anatomy, low quality, cartoonish, exaggerated features, open mouth, aggressive expression, modern clothing, pixelated, vibrant colors, overexposed, flickering, blurry details, subtitles, logo, style, artwork, painting, picture, static, overall grayish, worst quality, JPEG compression artifacts, ugly, incomplete, extra fingers, poorly drawn hands, poorly drawn face, deformed, disfigured, malformed limbs, fused fingers, static characters, messy background, three legs, crowded background, walking backwards\",\n  \"extend_prompt\": true,\n  \"resolution\": \"4k\",\n  \"audio_url\": \"https://drz0f01yeq1cx.cloudfront.net/1753772497950-9213-1749809724426audio.mp3\",\n  \"audio_type\": 2,\n  \"video_length\": 10,\n  \"is_premium_model\": true,\n  \"effect_code\": \"squish_89244231312\",\n  \"webhookurl\": \"\"\n}");
  Request request = new Request.Builder()
    .url("https://openapi.akool.com/api/open/v4/image2Video/createBySourcePrompt")
    .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.",
    "negative_prompt": "blurry, distorted hands, missing fingers, unnatural pose, double hands, extra limbs, bad anatomy, low quality, cartoonish, exaggerated features, open mouth, aggressive expression, modern clothing, pixelated, vibrant colors, overexposed, flickering, blurry details, subtitles, logo, style, artwork, painting, picture, static, overall grayish, worst quality, JPEG compression artifacts, ugly, incomplete, extra fingers, poorly drawn hands, poorly drawn face, deformed, disfigured, malformed limbs, fused fingers, static characters, messy background, three legs, crowded background, walking backwards",
    "extend_prompt": true,
    "resolution": "4k",
    "audio_url": "https://drz0f01yeq1cx.cloudfront.net/1753772497950-9213-1749809724426audio.mp3",
    "audio_type": 2,
    "video_length": 10,
    "is_premium_model": true,
    "effect_code": "squish_89244231312",
    "webhookurl": ""
  });

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

  fetch("https://openapi.akool.com/api/open/v4/image2Video/createBySourcePrompt", 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.",
    "negative_prompt": "blurry, distorted hands, missing fingers, unnatural pose, double hands, extra limbs, bad anatomy, low quality, cartoonish, exaggerated features, open mouth, aggressive expression, modern clothing, pixelated, vibrant colors, overexposed, flickering, blurry details, subtitles, logo, style, artwork, painting, picture, static, overall grayish, worst quality, JPEG compression artifacts, ugly, incomplete, extra fingers, poorly drawn hands, poorly drawn face, deformed, disfigured, malformed limbs, fused fingers, static characters, messy background, three legs, crowded background, walking backwards",
    "extend_prompt": true,
    "resolution": "4k",
    "audio_url": "https://drz0f01yeq1cx.cloudfront.net/1753772497950-9213-1749809724426audio.mp3",
    "audio_type": 2,
    "video_length": 10,
    "is_premium_model": true,
    "effect_code": "squish_89244231312",
    "webhookurl": ""
  }';
  $request = new Request('POST', 'https://openapi.akool.com/api/open/v4/image2Video/createBySourcePrompt', $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"

  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.",
    "negative_prompt": "blurry, distorted hands, missing fingers, unnatural pose, double hands, extra limbs, bad anatomy, low quality, cartoonish, exaggerated features, open mouth, aggressive expression, modern clothing, pixelated, vibrant colors, overexposed, flickering, blurry details, subtitles, logo, style, artwork, painting, picture, static, overall grayish, worst quality, JPEG compression artifacts, ugly, incomplete, extra fingers, poorly drawn hands, poorly drawn face, deformed, disfigured, malformed limbs, fused fingers, static characters, messy background, three legs, crowded background, walking backwards",
    "extend_prompt": true,
    "resolution": "4k",
    "audio_url": "https://drz0f01yeq1cx.cloudfront.net/1753772497950-9213-1749809724426audio.mp3",
    "audio_type": 2,
    "video_length": 10,
    "is_premium_model": true,
    "effect_code": "squish_89244231312",
    "webhookurl": ""
  })
  headers = {
    'x-api-key':'{{API Key}}',
    'Content-Type': 'application/json'
  }

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

### Response

```json theme={null}
{
  "code": 1000,
  "msg": "OK",
  "data": {
    "create_time": 1754362985482,
    "uid": 101400,
    "team_id": "6805fb69e92d9edc7ca0b409",
    "status": 1,
    "webhookUrl": "",
    "resolution": "4k",
    "file_name": "Image2Video_Animate this image with .mp4",
    "effect_name": "Squish",
    "_id": "689174694b4dbdd4ab3d28c9",
    "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 hands, missing fingers, unnatural pose, double hands, extra limbs, bad anatomy, low quality, cartoonish, exaggerated features, open mouth, aggressive expression, modern clothing, pixelated, vibrant colors, overexposed, flickering, blurry details, subtitles, logo, style, artwork, painting, picture, static, overall grayish, worst quality, JPEG compression artifacts, ugly, incomplete, extra fingers, poorly drawn hands, poorly drawn face, deformed, disfigured, malformed limbs, fused fingers, static characters, messy background, three legs, crowded background, walking backwards",
    "extend_prompt": true,
    "audio_type": 2,
    "audio_url": "https://drz0f01yeq1cx.cloudfront.net/1753772497950-9213-1749809724426audio.mp3",
    "deduction_credit": 60,
    "effect_code": "squish_89244231312"
  }
}
```

## Important Notes

* **Image Quality**: Use high-resolution images for better animation results
* **Prompt**: Use descriptive prompts to guide the animation style and motion
* **Negative Prompt**: Specify what to avoid (e.g., "blurry, distorted") for cleaner results
* **Effects**: If `effect_code` is specified, the `prompt` content will be ignored. Browse effects with [Get Available Effects](/ai-tools-suite/image2video/get-effects)
* **Resolution**: Choose from 720p, 1080p, or 4k - higher resolution costs more credits
* **Video Length**: 10-second videos are only available for pro and above subscriptions
* **Premium Model**: Use `is_premium_model` for faster generation (pro and above subscriptions only)
* **Resource Expiration**: Generated videos are valid for 7 days, save them promptly
* **Webhook**: Use `webhookUrl` to receive notifications when video generation is complete
* Save the `_id` from the response to check video status using the [Get Image to Video Results](/ai-tools-suite/image2video/get-results) API
