Introduction

You can use the API to let AI edit your video.

Quickstart

Prerequisite

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

Queue a preview generation task

Generate a preview of AI Editing video.

import requests

url = "https://api.creatify.ai/api/ai_editing/preview/"

payload = {
  "video_url": "https://d35ghwdno3nak3.cloudfront.net/media_file/3/20240807/956e94aa-b695-4a23-ab63-cb37c70135db_daniel.mp4",
  "editing_style": "film"
}
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 preview status

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

import requests

url = "https://api.creatify.ai/api/ai_editing/{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)

Once the preview of AI Editing video is generated, there will be data in preview field. Then you can render the video by sending a POST request to Render a AI Editing video.

Render the video.

import requests

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

payload = {}

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 the status of the video

import requests

url = "https://api.creatify.ai/api/ai_editing/{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.