Link to videos
Links
Lipsyncs
Lipsyncs v2
Custom Templates
Custom Template Videos
Text to Speech
AI Shorts
AI Editing
Avatar
Workspace
Generate preview of AI Editing
This endpoint generates a preiview of AI Editing video before redering the final video. Generating a video preview through this endpoint costs 1 credit for every 30 seconds.
curl --request POST \
--url https://api.creatify.ai/api/ai_editing/preview/ \
--header 'Content-Type: application/json' \
--header 'X-API-ID: <api-key>' \
--header 'X-API-KEY: <api-key>' \
--data '{
"editing_style": "film",
"video_url": "<string>",
"caption_setting": {
"style": "normal-black",
"offset": {
"x": 0,
"y": 0.4
},
"font_family": "Montserrat",
"font_size": 70,
"font_style": "font-bold",
"background_color": "<string>",
"text_color": "<string>",
"highlight_text_color": "<string>",
"max_width": 123,
"line_height": 123,
"text_shadow": "<string>",
"hidden": false
},
"background_music_url": "<string>",
"background_music_volume": 0.5,
"voiceover_volume": 0.5,
"webhook_url": "<string>"
}'
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"credits_used": 123,
"duration": 123,
"media_job": "<string>",
"status": "pending",
"video_output": "<string>",
"preview": "<string>",
"is_hidden": true,
"progress": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"permission_type": "private",
"name": "<string>",
"script": "<string>",
"aspect_ratio": "9x16",
"is_talking_video": true,
"is_one_person_in_video": true,
"editing_style": "film",
"audio_url": "<string>",
"video_url": "<string>",
"size": 123,
"created_from_api": true,
"caption_setting": "<any>",
"background_music_url": "<string>",
"background_music_volume": 0.5,
"voiceover_volume": 0.5,
"webhook_url": "<string>",
"user": 123,
"workspace": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
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
API ID, from your settings page.
API Key, from your settings page.
Body
Response
The response is of type object
.
curl --request POST \
--url https://api.creatify.ai/api/ai_editing/preview/ \
--header 'Content-Type: application/json' \
--header 'X-API-ID: <api-key>' \
--header 'X-API-KEY: <api-key>' \
--data '{
"editing_style": "film",
"video_url": "<string>",
"caption_setting": {
"style": "normal-black",
"offset": {
"x": 0,
"y": 0.4
},
"font_family": "Montserrat",
"font_size": 70,
"font_style": "font-bold",
"background_color": "<string>",
"text_color": "<string>",
"highlight_text_color": "<string>",
"max_width": 123,
"line_height": 123,
"text_shadow": "<string>",
"hidden": false
},
"background_music_url": "<string>",
"background_music_volume": 0.5,
"voiceover_volume": 0.5,
"webhook_url": "<string>"
}'
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"credits_used": 123,
"duration": 123,
"media_job": "<string>",
"status": "pending",
"video_output": "<string>",
"preview": "<string>",
"is_hidden": true,
"progress": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"permission_type": "private",
"name": "<string>",
"script": "<string>",
"aspect_ratio": "9x16",
"is_talking_video": true,
"is_one_person_in_video": true,
"editing_style": "film",
"audio_url": "<string>",
"video_url": "<string>",
"size": 123,
"created_from_api": true,
"caption_setting": "<any>",
"background_music_url": "<string>",
"background_music_volume": 0.5,
"voiceover_volume": 0.5,
"webhook_url": "<string>",
"user": 123,
"workspace": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}