Introduction

You can use the API to create viral videos from text.

Quickstart

Prerequisite

  • You need a creatify.ai account with API access.
  • You need to go through the Get your API key

Queue a generation task

Generate AI Shorts video.

import requests

url = "https://api.creatify.ai/api/ai_shorts/"

payload = {
    "script": "Meet the Tesla Model X, where cutting-edge technology meets unparalleled performance. Designed with luxury and comfort in mind, the Model X offers a driving experience like no other.",
    "aspect_ratio": "9x16",
    "style": "4K realistic"
}
headers = {
    "X-API-ID": "<your-x-api-id>",
    "X-API-KEY": "<your-x-api-key>",
    "Content-Type": "application/json"
}

response = requests.request("POST", url, json=payload, headers=headers)

print(response.text)

Check status

Now our AI model is generating ai shorts video for you. It will return a id of the ai shorts item. Then you can check the status of your video generation by sending a GET request to Get AI Shorts item by id endpoint.

import requests

url = "https://api.creatify.ai/api/ai_shorts/{id}/"

headers = {
    "X-API-ID": "<your-x-api-id>",
    "X-API-KEY": "<your-x-api-key>"
}

response = requests.request("GET", url, headers=headers)

print(response.text)

You will find the status to be done when finished. Meanwhile you can find the video output in video_output field.