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

# Overview

> Unified endpoints for AI assets generation (image, video) with discoverable input schemas.

## 🚀 Introduction

The **Asset Generator API** provides a single interface to run **image / video** generations.\
First list available models and their **input parameter schemas**, then create a generation and **poll or receive a webhook** when it’s ready.

<Note>
  Check live processing times for each model on the [Model Status page](https://app.creatify.ai/ai-models/status).
</Note>

***

## ✅ Prerequisites

* A Creatify account with **API access**
* Your **API credentials** (see [Authentication](/api-reference/authentication))

***

## 0) Supported Models & Pricing

[Supported Models and Pricing](/api-reference/ai-generation/post-ai-generation#supported-models)

## 1) Discover Models & Input Schemas

Use this endpoint to list available models and the **JSON schema** for their `input_params`.\
Filter by `model_name` using a comma-separated list.

**Endpoint:** [GET /api/asset\_generator/schemas/](/api-reference/ai-generation/get-ai-generation-schema)

**Query params:** `model_name` (optional, comma-separated)

<CodeGroup>
  ```bash Example Request theme={null}
  curl --request GET \
    --url "https://api.creatify.ai/api/asset_generator/schemas/" \
    --header 'X-API-ID: your-api-id' \
    --header 'X-API-KEY: your-api-key'
  ```

  ```json Example Response [expandable] theme={null}
  [
      {
          "model_name": "kling-video/v1.6/pro/image-to-video",
          "input_params_schema": {
              "$schema": "http://json-schema.org/draft-07/schema#",
              "required": [
                  "prompt",
                  "image_url"
              ],
              "properties": {
                  "prompt": {
                      "type": "string",
                      "title": "Prompt",
                      "maxLength": 2000,
                      "minLength": 1
                  },
                  "duration": {
                      "enum": [
                          "5",
                          "10"
                      ],
                      "type": "string",
                      "title": "Duration",
                      "default": "5",
                      "description": "The duration of the generated video in seconds"
                  },
                  "cfg_scale": {
                      "type": "number",
                      "title": "Cfg Scale",
                      "default": 0.5,
                      "maximum": 1,
                      "minimum": 0,
                      "multipleOf": 0.1,
                      "description": "The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you.",
                      "x-advance-settings": true
                  },
                  "image_url": {
                      "type": "string",
                      "title": "Image Url",
                      "max_width": 5000,
                      "min_width": 300,
                      "x-ui-name": "start_image",
                      "max_height": 5000,
                      "min_height": 300,
                      "max_file_size": 10485760
                  },
                  "aspect_ratio": {
                      "enum": [
                          "16:9",
                          "9:16",
                          "1:1"
                      ],
                      "type": "string",
                      "title": "Aspect Ratio",
                      "default": "16:9",
                      "description": "The aspect ratio of the generated video frame"
                  },
                  "tail_image_url": {
                      "type": "string",
                      "title": "Tail Image Url",
                      "max_width": 5000,
                      "min_width": 300,
                      "x-ui-name": "end_image",
                      "max_height": 5000,
                      "min_height": 300,
                      "description": "URL of the image to be used for the end of the video",
                      "max_file_size": 10485760
                  },
                  "negative_prompt": {
                      "type": "string",
                      "title": "Negative Prompt",
                      "default": "blur, distort, and low quality",
                      "maxLength": 2500,
                      "x-advance-settings": true
                  }
              }
          },
          "generation_type": "image_to_video"
      },
      {
          "model_name": "kling-video/v1.6/pro/text-to-video",
          "input_params_schema": {
              "$schema": "http://json-schema.org/draft-07/schema#",
              "required": [
                  "prompt"
              ],
              "properties": {
                  "prompt": {
                      "type": "string",
                      "title": "Prompt",
                      "maxLength": 2000,
                      "minLength": 1
                  },
                  "duration": {
                      "enum": [
                          "5",
                          "10"
                      ],
                      "type": "string",
                      "title": "Duration",
                      "default": "5",
                      "description": "The duration of the generated video in seconds"
                  },
                  "cfg_scale": {
                      "type": "number",
                      "title": "Cfg Scale",
                      "default": 0.5,
                      "maximum": 1,
                      "minimum": 0,
                      "multipleOf": 0.1,
                      "description": "The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you.",
                      "x-advance-settings": true
                  },
                  "aspect_ratio": {
                      "enum": [
                          "16:9",
                          "9:16",
                          "1:1"
                      ],
                      "type": "string",
                      "title": "Aspect Ratio",
                      "default": "16:9",
                      "description": "The aspect ratio of the generated video frame"
                  },
                  "negative_prompt": {
                      "type": "string",
                      "title": "Negative Prompt",
                      "default": "blur, distort, and low quality",
                      "maxLength": 2500,
                      "x-advance-settings": true
                  }
              }
          },
          "generation_type": "text_to_video"
      }
  ]
  ```
</CodeGroup>

> **Notes**
>
> * `input_params_schema` is a JSON Schema containing \$schema, required, and properties; fields listed in required must be present, and all other entries in properties are optional when creating Asset Generator task.

***

## 2) Create a Generation Task

Send `model_name`, `input_params` (must satisfy the schema from step 1), and optional `webhook_url`.

**Endpoint:** [POST /api/asset\_generator/](/api-reference/ai-generation/post-ai-generation)

**Body:**

* `model_name` (string, required)
* `input_params` (json, required; must match schema)
* `webhook_url` (string URL, optional)

<CodeGroup>
  ```bash Example Request (kling image-to-video) theme={null}
  curl --request POST \
    --url https://api.creatify.ai/api/asset_generator/ \
    --header 'Content-Type: application/json' \
    --header 'X-API-ID: your-api-id' \
    --header 'X-API-KEY: your-api-key' \
    --data '{
      "model_name": "kling-video/v1.6/pro/image-to-video",
      "webhook_url": "https://webhook.site/8de4fa26-a1aa-4e83-8795-ede39bb99d78",
      "input_params": {
          "prompt": "A man working in the snow moutains with small image logo.",
          "duration": "5",
          "cfg_scale": 0.5,
          "image_url": "https://d35ghwdno3nak3.cloudfront.net/media_file/18165/d91443bdd92c82ed5d5992e38f3ff9d3.jpg",
          "aspect_ratio": "16:9",
          "negative_prompt": "blur, distort, and low quality"
      }
  }'
  ```

  ```json Example Response theme={null}
  {
      "id": "1ea584a7-4930-4892-90a0-d7c74c6623dd",
      "model_name": "kling-video/v1.6/pro/image-to-video",
      "gen_type": "video",
      "status": "initializing",
      "failed_reason": "",
      "assets": [],
      "aspect_ratio": "16:9",
      "output_nums": 1,
      "duration": 5,
      "resolution": null,
      "input_params": {
          "prompt": "A man working in the snow moutains with small image logo.",
          "duration": "5",
          "cfg_scale": 0.5,
          "image_url": "https://d35ghwdno3nak3.cloudfront.net/media_file/18165/d91443bdd92c82ed5d5992e38f3ff9d3.jpg",
          "aspect_ratio": "16:9",
          "negative_prompt": "blur, distort, and low quality"
      },
      "webhook_url": "https://webhook.site/8de4fa26-a1aa-4e83-8795-ede39bb99d78",
      "created_at": "2025-11-04T20:20:36.051480-08:00",
      "updated_at": "2025-11-04T20:20:36.051513-08:00"
  }
  ```
</CodeGroup>

***

## 3) Check Status (Poll) or Receive Webhook

You can **poll** the job until it’s `done`, or provide a **webhook** to be notified automatically. You can get the generated result from the `assets` field.

**Endpoint:** [`GET /api/asset_generator/{id}/`](/api-reference/ai-generation/get-ai-generation-)

### Poll

<CodeGroup>
  ```bash Example Request theme={null}
  curl --request GET \
    --url https://api.creatify.ai/api/asset_generator/1ea584a7-4930-4892-90a0-d7c74c6623dd/ \
    --header 'X-API-ID: your-api-id' \
    --header 'X-API-KEY: your-api-key'
  ```

  ```json Example Response theme={null}
  {
      "id": "1ea584a7-4930-4892-90a0-d7c74c6623dd",
      "model_name": "kling-video/v1.6/pro/image-to-video",
      "gen_type": "video",
      "status": "done",
      "failed_reason": "",
      "assets": [
          {
              "id": "4238460a-bee5-4747-8be0-f267783f21fd",
              "type": "video",
              "url": "https://d35ghwdno3nak3.cloudfront.net/user/1/20251104/eb7e2f3e.mp4",
              "thumbnail_url": "https://d35ghwdno3nak3.cloudfront.net/creative_assets/4238460a-bee5-4747-8be0-f267783f21fd/thumbnail.jpg",
              "name": "Video-714bec31"
          }
      ],
      "aspect_ratio": "16:9",
      "output_nums": 1,
      "duration": 5,
      "resolution": null,
      "input_params": {
          "prompt": "A man working in the snow moutains with small image logo.",
          "duration": "5",
          "cfg_scale": 0.5,
          "image_url": "https://d35ghwdno3nak3.cloudfront.net/media_file/18165/d91443bdd92c82ed5d5992e38f3ff9d3.jpg",
          "aspect_ratio": "16:9",
          "negative_prompt": "blur, distort, and low quality"
      },
      "webhook_url": "https://webhook.site/8de4fa26-a1aa-4e83-8795-ede39bb99d78",
      "created_at": "2025-11-04T20:20:36.051480-08:00",
      "updated_at": "2025-11-04T20:20:36.051513-08:00"
  }
  ```
</CodeGroup>

### Webhook (Optional)

If you supplied a `webhook_url` when creating the job, we’ll POST a payload when it finishes. You can get the generated result from the `assets` field.

```json theme={null}
{
  "id": "1ea584a7-4930-4892-90a0-d7c74c6623dd",
  "status": "done",
  "failed_reason": "",
  "assets": [
    {
      "id": "4238460a-bee5-4747-8be0-f267783f21fd",
      "type": "video",
      "url": "https://d35ghwdno3nak3.cloudfront.net/user/1/20251104/eb7e2f3e.mp4",
      "thumbnail_url": "https://d35ghwdno3nak3.cloudfront.net/creative_assets/4238460a-bee5-4747-8be0-f267783f21fd/thumbnail.jpg",
      "name": "Video-714bec31"
    }
  ]
}
```

> You can verify the job any time with a GET to `/api/asset_generator/{id}/`.

***

## 📚 Endpoint Reference

| Action                         | Endpoint                            |
| ------------------------------ | ----------------------------------- |
| List models & input schemas    | `GET /api/asset_generator/schemas/` |
| Create a generation task       | `POST /api/asset_generator/`        |
| Check task status / get result | `GET /api/asset_generator/{id}/`    |

***

## 🎯 Summary

| Step | What you do                                                                           |
| ---- | ------------------------------------------------------------------------------------- |
| 1    | List **models** and get their **input schema**                                        |
| 2    | Create a **generation** with `model_name` + `input_params` (+ optional `webhook_url`) |
| 3    | **Poll** `/api/asset_generator/{id}/` or receive a **webhook** with the final result  |
