> ## Documentation Index
> Fetch the complete documentation index at: https://docs.iacrea.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Video Creation API

> API documentation for the video creation service

# Video Creation API

The video creation service allows you to transform your static images into dynamic animations using artificial intelligence.

## Generate a video

<ParamField path="POST /api/animation/v2/generate" />

### Request Parameters

<ParamField body="user_id" type="string" required>
  The unique user identifier (UUID) that you can retrieve from your Developer Space
</ParamField>

<ParamField body="image_urls" type="array" required>
  Array of URLs of images to animate. Currently, the first image in the array is used for video creation.
</ParamField>

<ParamField body="option" type="string" required>
  Desired animation type. Possible values: "ZOOM\_IN", "ZOOM\_OUT", "PAN\_RIGHT", "PAN\_LEFT", "PAN\_UP", "PAN\_DOWN", "CAMERA\_PUSH\_OUT", "AUTO\_EFFECTS", "AUTO\_REVERSE"
</ParamField>

<ParamField body="prompt" type="string">
  Textual description to guide the visual style of the animation. Only used if the option is not "AUTO\_EFFECTS" or "AUTO\_REVERSE". For these automatic options, the prompt is automatically generated by AI.
</ParamField>

<ParamField body="format" type="string">
  Video orientation format. Possible values: "portrait" (768x1280 format) or any other value for landscape format (1280x768). By default, landscape format is used.
</ParamField>

<ParamField body="webhook" type="string">
  Webhook URL to receive a notification when the generation is complete
</ParamField>

### Response

<ResponseField name="generation_id" type="string">
  The unique generation identifier (UUID) to use with the retrieval API
</ResponseField>

<ResponseField name="remaining_videos" type="number">
  The number of video credits remaining for the user
</ResponseField>

<ResponseField name="project_id" type="string">
  The unique project identifier (UUID)
</ResponseField>

### Request Example

```bash theme={null}
curl --request POST \
--url 'https://iacrea.com/api/animation/v2/generate' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
  "user_id": "uuid",
  "image_urls": ["https://example.com/image.jpg"],
  "option": "ZOOM_OUT",
  "prompt": "Elegant modern living room",
  "format": "portrait"
}'
```

### Response Example

```json theme={null}
{
  "generation_id": "uuid",
  "remaining_videos": 10,
  "project_id": "uuid"
}
```

## Available Animation Types

| Option            | Description                                                   |
| ----------------- | ------------------------------------------------------------- |
| ZOOM\_IN          | Zoom-in effect towards the inside of the image                |
| ZOOM\_OUT         | Zoom-out effect moving away from the image                    |
| PAN\_RIGHT        | Camera movement to the right                                  |
| PAN\_LEFT         | Camera movement to the left                                   |
| PAN\_UP           | Camera movement upward                                        |
| PAN\_DOWN         | Camera movement downward                                      |
| CAMERA\_PUSH\_OUT | Fluid movement combining zoom and displacement                |
| AUTO\_EFFECTS     | Automatic prompt generation by AI to create optimal animation |
| AUTO\_REVERSE     | Automatic prompt generation by AI to create reverse animation |

## Retrieve a video

<ParamField path="POST /api/animation/v2/get" />

### Request Parameters

<ParamField body="user_id" type="string" required>
  The unique user identifier (UUID) that you can retrieve from your Developer Space
</ParamField>

<ParamField body="generation_id" type="string" required>
  The unique generation identifier (UUID) returned by the generation API
</ParamField>

### Response

<ResponseField name="status" type="string">
  Generation status: "STARTING", "IN\_PROGRESS", "SUCCEEDED", "FAILED"
</ResponseField>

<ResponseField name="urls" type="array">
  Array containing the URLs of generated videos (present only if status="SUCCEEDED")
</ResponseField>

### Request Example

```bash theme={null}
curl --request POST \
--url 'https://iacrea.com/api/animation/v2/get' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
  "user_id": "uuid",
  "generation_id": "uuid"
}'
```

### Response Example

```json theme={null}
{
  "status": "SUCCEEDED",
  "urls": ["https://generated-video-url.mp4"]
}
```

### Possible Generation States

| Status       | Description                         |
| ------------ | ----------------------------------- |
| STARTING     | Generation is initializing          |
| IN\_PROGRESS | Video is being created              |
| SUCCEEDED    | Generation completed successfully   |
| FAILED       | An error occurred during generation |

**Important note:** In case of "FAILED" status, your video credits are automatically refunded.
