POST
/
api
/
ai_editing
/
preview

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/2/20240805/038a9606-7b03-4fdd-a44d-122195a97afb_jun-16x9.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. Then you can check the preview status of your video by sending a GET request to Get AI Editing video 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 endpoint.

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 render status

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.

Authorizations

X-API-ID
string
header
required

API ID, from your settings page.

X-API-KEY
string
header
required

API Key, from your settings page.

Body

editing_style
enum<string>
required
  • film - Film
  • geometric_gradient - Geometric Gradient
  • glitch - Glitch
  • glitter_gradient - Glitter Gradient
  • paper - Paper
Available options:
film,
geometric_gradient,
glitch,
glitter_gradient,
paper
video_url
string
required
background_music_url
string | null

Background music URL for the video. Default is null, video will use random music.

Maximum length: 255
background_music_volume
number | null

Volume of the background music, ranging from 0.0 to 1.0. Default is null, video will use default music volume of visual_style.

Required range: 0 < x < 1
caption_setting
object

Caption setting, default null and default caption setting will be used

voiceover_volume
number | null

Volume of the voiceover, ranging from 0.0 to 1.0. Default is null, video will use default voiceover volume of visual_style.

Required range: 0 < x < 1
webhook_url
string | null

Webhook URL for status updates. Default is null.

Maximum length: 200

Response

200 - application/json
created_at
string
required
credits_used
integer
required

Credits used in this api call

id
string
required
is_hidden
boolean
required
media_job
string | null
required
permission_type
enum<string>
required
  • private - Private
  • workspace - Workspace
  • public - Public
Available options:
private,
workspace,
public
preview
string | null
required
progress
number
required
status
enum<string>
required
  • pending - Pending
  • in_queue - In Queue
  • running - Running
  • failed - Failed
  • done - Done
  • rejected - Rejected
Available options:
pending,
in_queue,
running,
failed,
done,
rejected
updated_at
string
required
user
integer | null
required
video_output
string | null
required
workspace
string | null
required
aspect_ratio

Aspect ratio of the video

  • 9x16 - 9X16
  • 16x9 - 16X9
  • 1x1 - 1X1
Available options:
9x16,
16x9,
1x1
audio_url
string | null

Audio to be used for the video

Maximum length: 255
background_music_url
string | null

Background music URL for the video. Default is null, video will use random music.

Maximum length: 255
background_music_volume
number | null

Volume of the background music, ranging from 0.0 to 1.0. Default is null, video will use default music volume of visual_style.

Required range: 0 < x < 1
caption_setting
any | null

Caption setting, default null and default caption setting will be used

created_from_api
boolean

Flow is created from api or not

duration
number

Duration of the video

editing_style

Style to be used for the video

  • film - Film
  • geometric_gradient - Geometric Gradient
  • glitch - Glitch
  • glitter_gradient - Glitter Gradient
  • paper - Paper
Available options:
film,
geometric_gradient,
glitch,
glitter_gradient,
paper
is_one_person_in_video
boolean

Whether the video is one person video or not

is_talking_video
boolean

Whether the video is talking video or not

name
string
Maximum length: 255
script
string | null

Text to be converted to video

size
number

Size of the video

video_url
string | null

Video to be used for the video

Maximum length: 255
voiceover_volume
number | null

Volume of the voiceover, ranging from 0.0 to 1.0. Default is null, video will use default voiceover volume of visual_style.

Required range: 0 < x < 1
webhook_url
string | null

Webhook URL for status updates. Default is null.

Maximum length: 200