cURL
curl --request POST \
--url https://api.creatify.ai/api/ai_shorts/preview/ \
--header 'Content-Type: application/json' \
--header 'X-API-ID: <api-key>' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"script": "<string>",
"accent": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"caption_setting": {
"style": "normal-black",
"offset": {
"x": 0,
"y": 0.4
},
"font_family": "Montserrat",
"font_size": 70,
"background_color": "<string>",
"text_color": "<string>",
"highlight_text_color": "<string>",
"max_width": 123,
"line_height": 123,
"text_shadow": "<string>",
"hidden": false,
"override_visual_style": false
},
"background_music_url": "<string>",
"background_music_volume": 0.5,
"voiceover_volume": 0.5,
"webhook_url": "<string>"
}
'import requests
url = "https://api.creatify.ai/api/ai_shorts/preview/"
payload = {
"script": "<string>",
"accent": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"caption_setting": {
"style": "normal-black",
"offset": {
"x": 0,
"y": 0.4
},
"font_family": "Montserrat",
"font_size": 70,
"background_color": "<string>",
"text_color": "<string>",
"highlight_text_color": "<string>",
"max_width": 123,
"line_height": 123,
"text_shadow": "<string>",
"hidden": False,
"override_visual_style": False
},
"background_music_url": "<string>",
"background_music_volume": 0.5,
"voiceover_volume": 0.5,
"webhook_url": "<string>"
}
headers = {
"X-API-ID": "<api-key>",
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-API-ID': '<api-key>',
'X-API-KEY': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
script: '<string>',
accent: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
caption_setting: {
style: 'normal-black',
offset: {x: 0, y: 0.4},
font_family: 'Montserrat',
font_size: 70,
background_color: '<string>',
text_color: '<string>',
highlight_text_color: '<string>',
max_width: 123,
line_height: 123,
text_shadow: '<string>',
hidden: false,
override_visual_style: false
},
background_music_url: '<string>',
background_music_volume: 0.5,
voiceover_volume: 0.5,
webhook_url: '<string>'
})
};
fetch('https://api.creatify.ai/api/ai_shorts/preview/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.creatify.ai/api/ai_shorts/preview/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'script' => '<string>',
'accent' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'caption_setting' => [
'style' => 'normal-black',
'offset' => [
'x' => 0,
'y' => 0.4
],
'font_family' => 'Montserrat',
'font_size' => 70,
'background_color' => '<string>',
'text_color' => '<string>',
'highlight_text_color' => '<string>',
'max_width' => 123,
'line_height' => 123,
'text_shadow' => '<string>',
'hidden' => false,
'override_visual_style' => false
],
'background_music_url' => '<string>',
'background_music_volume' => 0.5,
'voiceover_volume' => 0.5,
'webhook_url' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-ID: <api-key>",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.creatify.ai/api/ai_shorts/preview/"
payload := strings.NewReader("{\n \"script\": \"<string>\",\n \"accent\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"caption_setting\": {\n \"style\": \"normal-black\",\n \"offset\": {\n \"x\": 0,\n \"y\": 0.4\n },\n \"font_family\": \"Montserrat\",\n \"font_size\": 70,\n \"background_color\": \"<string>\",\n \"text_color\": \"<string>\",\n \"highlight_text_color\": \"<string>\",\n \"max_width\": 123,\n \"line_height\": 123,\n \"text_shadow\": \"<string>\",\n \"hidden\": false,\n \"override_visual_style\": false\n },\n \"background_music_url\": \"<string>\",\n \"background_music_volume\": 0.5,\n \"voiceover_volume\": 0.5,\n \"webhook_url\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-ID", "<api-key>")
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.creatify.ai/api/ai_shorts/preview/")
.header("X-API-ID", "<api-key>")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"script\": \"<string>\",\n \"accent\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"caption_setting\": {\n \"style\": \"normal-black\",\n \"offset\": {\n \"x\": 0,\n \"y\": 0.4\n },\n \"font_family\": \"Montserrat\",\n \"font_size\": 70,\n \"background_color\": \"<string>\",\n \"text_color\": \"<string>\",\n \"highlight_text_color\": \"<string>\",\n \"max_width\": 123,\n \"line_height\": 123,\n \"text_shadow\": \"<string>\",\n \"hidden\": false,\n \"override_visual_style\": false\n },\n \"background_music_url\": \"<string>\",\n \"background_music_volume\": 0.5,\n \"voiceover_volume\": 0.5,\n \"webhook_url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.creatify.ai/api/ai_shorts/preview/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-ID"] = '<api-key>'
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"script\": \"<string>\",\n \"accent\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"caption_setting\": {\n \"style\": \"normal-black\",\n \"offset\": {\n \"x\": 0,\n \"y\": 0.4\n },\n \"font_family\": \"Montserrat\",\n \"font_size\": 70,\n \"background_color\": \"<string>\",\n \"text_color\": \"<string>\",\n \"highlight_text_color\": \"<string>\",\n \"max_width\": 123,\n \"line_height\": 123,\n \"text_shadow\": \"<string>\",\n \"hidden\": false,\n \"override_visual_style\": false\n },\n \"background_music_url\": \"<string>\",\n \"background_music_volume\": 0.5,\n \"voiceover_volume\": 0.5,\n \"webhook_url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"failed_reason": "<string>",
"video_output": "<string>",
"preview": "<string>",
"editor_url": "<string>",
"is_hidden": true,
"progress": 123,
"credits_used": 123,
"duration": 123,
"media_job": "<string>",
"permission_type": "private",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"user": 123,
"workspace": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"script": "<string>",
"aspect_ratio": "9x16",
"style": "4K realistic",
"created_from_api": true,
"caption_setting": "<unknown>",
"background_music_url": "<string>",
"background_music_volume": 0.5,
"voiceover_volume": 0.5,
"webhook_url": "<string>",
"brand": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"accent": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}API Reference
Generate preview of AI Shorts
This endpoint generates a preview of AI Shorts video before rendering the final video. Generating a video preview through this endpoint costs 1 credit for every 30 seconds.
POST
/
api
/
ai_shorts
/
preview
/
cURL
curl --request POST \
--url https://api.creatify.ai/api/ai_shorts/preview/ \
--header 'Content-Type: application/json' \
--header 'X-API-ID: <api-key>' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"script": "<string>",
"accent": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"caption_setting": {
"style": "normal-black",
"offset": {
"x": 0,
"y": 0.4
},
"font_family": "Montserrat",
"font_size": 70,
"background_color": "<string>",
"text_color": "<string>",
"highlight_text_color": "<string>",
"max_width": 123,
"line_height": 123,
"text_shadow": "<string>",
"hidden": false,
"override_visual_style": false
},
"background_music_url": "<string>",
"background_music_volume": 0.5,
"voiceover_volume": 0.5,
"webhook_url": "<string>"
}
'import requests
url = "https://api.creatify.ai/api/ai_shorts/preview/"
payload = {
"script": "<string>",
"accent": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"caption_setting": {
"style": "normal-black",
"offset": {
"x": 0,
"y": 0.4
},
"font_family": "Montserrat",
"font_size": 70,
"background_color": "<string>",
"text_color": "<string>",
"highlight_text_color": "<string>",
"max_width": 123,
"line_height": 123,
"text_shadow": "<string>",
"hidden": False,
"override_visual_style": False
},
"background_music_url": "<string>",
"background_music_volume": 0.5,
"voiceover_volume": 0.5,
"webhook_url": "<string>"
}
headers = {
"X-API-ID": "<api-key>",
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-API-ID': '<api-key>',
'X-API-KEY': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
script: '<string>',
accent: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
caption_setting: {
style: 'normal-black',
offset: {x: 0, y: 0.4},
font_family: 'Montserrat',
font_size: 70,
background_color: '<string>',
text_color: '<string>',
highlight_text_color: '<string>',
max_width: 123,
line_height: 123,
text_shadow: '<string>',
hidden: false,
override_visual_style: false
},
background_music_url: '<string>',
background_music_volume: 0.5,
voiceover_volume: 0.5,
webhook_url: '<string>'
})
};
fetch('https://api.creatify.ai/api/ai_shorts/preview/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.creatify.ai/api/ai_shorts/preview/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'script' => '<string>',
'accent' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'caption_setting' => [
'style' => 'normal-black',
'offset' => [
'x' => 0,
'y' => 0.4
],
'font_family' => 'Montserrat',
'font_size' => 70,
'background_color' => '<string>',
'text_color' => '<string>',
'highlight_text_color' => '<string>',
'max_width' => 123,
'line_height' => 123,
'text_shadow' => '<string>',
'hidden' => false,
'override_visual_style' => false
],
'background_music_url' => '<string>',
'background_music_volume' => 0.5,
'voiceover_volume' => 0.5,
'webhook_url' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-ID: <api-key>",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.creatify.ai/api/ai_shorts/preview/"
payload := strings.NewReader("{\n \"script\": \"<string>\",\n \"accent\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"caption_setting\": {\n \"style\": \"normal-black\",\n \"offset\": {\n \"x\": 0,\n \"y\": 0.4\n },\n \"font_family\": \"Montserrat\",\n \"font_size\": 70,\n \"background_color\": \"<string>\",\n \"text_color\": \"<string>\",\n \"highlight_text_color\": \"<string>\",\n \"max_width\": 123,\n \"line_height\": 123,\n \"text_shadow\": \"<string>\",\n \"hidden\": false,\n \"override_visual_style\": false\n },\n \"background_music_url\": \"<string>\",\n \"background_music_volume\": 0.5,\n \"voiceover_volume\": 0.5,\n \"webhook_url\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-ID", "<api-key>")
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.creatify.ai/api/ai_shorts/preview/")
.header("X-API-ID", "<api-key>")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"script\": \"<string>\",\n \"accent\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"caption_setting\": {\n \"style\": \"normal-black\",\n \"offset\": {\n \"x\": 0,\n \"y\": 0.4\n },\n \"font_family\": \"Montserrat\",\n \"font_size\": 70,\n \"background_color\": \"<string>\",\n \"text_color\": \"<string>\",\n \"highlight_text_color\": \"<string>\",\n \"max_width\": 123,\n \"line_height\": 123,\n \"text_shadow\": \"<string>\",\n \"hidden\": false,\n \"override_visual_style\": false\n },\n \"background_music_url\": \"<string>\",\n \"background_music_volume\": 0.5,\n \"voiceover_volume\": 0.5,\n \"webhook_url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.creatify.ai/api/ai_shorts/preview/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-ID"] = '<api-key>'
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"script\": \"<string>\",\n \"accent\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"caption_setting\": {\n \"style\": \"normal-black\",\n \"offset\": {\n \"x\": 0,\n \"y\": 0.4\n },\n \"font_family\": \"Montserrat\",\n \"font_size\": 70,\n \"background_color\": \"<string>\",\n \"text_color\": \"<string>\",\n \"highlight_text_color\": \"<string>\",\n \"max_width\": 123,\n \"line_height\": 123,\n \"text_shadow\": \"<string>\",\n \"hidden\": false,\n \"override_visual_style\": false\n },\n \"background_music_url\": \"<string>\",\n \"background_music_volume\": 0.5,\n \"voiceover_volume\": 0.5,\n \"webhook_url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"failed_reason": "<string>",
"video_output": "<string>",
"preview": "<string>",
"editor_url": "<string>",
"is_hidden": true,
"progress": 123,
"credits_used": 123,
"duration": 123,
"media_job": "<string>",
"permission_type": "private",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"user": 123,
"workspace": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"script": "<string>",
"aspect_ratio": "9x16",
"style": "4K realistic",
"created_from_api": true,
"caption_setting": "<unknown>",
"background_music_url": "<string>",
"background_music_volume": 0.5,
"voiceover_volume": 0.5,
"webhook_url": "<string>",
"brand": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"accent": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}Queue a preview generation task
Generate a preview of AI Shorts video.import requests
url = "https://api.creatify.ai/api/ai_shorts/preview/"
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 preview status
Now our AI model is generating preview of AI Shorts video. It will return aid of the AI Shorts video. Then you can check the preview status of your video by sending a GET request to Get AI Shorts video 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)
preview field. Then you can render the video by sending a POST request to Render a AI Shorts video endpoint.
Render the video
import requests
url = "https://api.creatify.ai/api/ai_shorts/{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_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)
status to be done when finished. Meanwhile you can find the video output in video_output field.Authorizations
Body
application/jsonapplication/x-www-form-urlencodedmultipart/form-data
4K realistic- _4K_REALISTIC3D- _3DCinematic- CINEMATICCartoonish- CARTOONISHLine art- LINE_ARTPixel art- PIXEL_ARTMysterious- MYSTERIOUSSteam punk- STEAM_PUNKCollage- COLLAGEKawaii- KAWAII
Available options:
4K realistic, 3D, Cinematic, Cartoonish, Line art, Pixel art, Mysterious, Steam punk, Collage, Kawaii Response
200 - application/json
Style to be used for the video
4K realistic- _4K_REALISTIC3D- _3DCinematic- CINEMATICCartoonish- CARTOONISHLine art- LINE_ARTPixel art- PIXEL_ARTMysterious- MYSTERIOUSSteam punk- STEAM_PUNKCollage- COLLAGEKawaii- KAWAII
Available options:
4K realistic, 3D, Cinematic, Cartoonish, Line art, Pixel art, Mysterious, Steam punk, Collage, Kawaii 
