Template To Video
curl --request POST \
--url https://api.domoai.com/v1/video/template2video \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"template": "kissing_screen",
"prompt": "The girl kiss the screen.",
"image": {
"bytes_base64_encoded": "/9j/4AAQSkZJRgABAQAAAQABAAD/2w..."
},
"callback_url": "https://example.com/callback",
"seconds": 5
}
'import requests
url = "https://api.domoai.com/v1/video/template2video"
payload = {
"template": "kissing_screen",
"prompt": "The girl kiss the screen.",
"image": { "bytes_base64_encoded": "/9j/4AAQSkZJRgABAQAAAQABAAD/2w..." },
"callback_url": "https://example.com/callback",
"seconds": 5
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
template: 'kissing_screen',
prompt: 'The girl kiss the screen.',
image: {bytes_base64_encoded: '/9j/4AAQSkZJRgABAQAAAQABAAD/2w...'},
callback_url: 'https://example.com/callback',
seconds: 5
})
};
fetch('https://api.domoai.com/v1/video/template2video', 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.domoai.com/v1/video/template2video",
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([
'template' => 'kissing_screen',
'prompt' => 'The girl kiss the screen.',
'image' => [
'bytes_base64_encoded' => '/9j/4AAQSkZJRgABAQAAAQABAAD/2w...'
],
'callback_url' => 'https://example.com/callback',
'seconds' => 5
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.domoai.com/v1/video/template2video"
payload := strings.NewReader("{\n \"template\": \"kissing_screen\",\n \"prompt\": \"The girl kiss the screen.\",\n \"image\": {\n \"bytes_base64_encoded\": \"/9j/4AAQSkZJRgABAQAAAQABAAD/2w...\"\n },\n \"callback_url\": \"https://example.com/callback\",\n \"seconds\": 5\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.domoai.com/v1/video/template2video")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"template\": \"kissing_screen\",\n \"prompt\": \"The girl kiss the screen.\",\n \"image\": {\n \"bytes_base64_encoded\": \"/9j/4AAQSkZJRgABAQAAAQABAAD/2w...\"\n },\n \"callback_url\": \"https://example.com/callback\",\n \"seconds\": 5\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.domoai.com/v1/video/template2video")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"template\": \"kissing_screen\",\n \"prompt\": \"The girl kiss the screen.\",\n \"image\": {\n \"bytes_base64_encoded\": \"/9j/4AAQSkZJRgABAQAAAQABAAD/2w...\"\n },\n \"callback_url\": \"https://example.com/callback\",\n \"seconds\": 5\n}"
response = http.request(request)
puts response.read_body{
"data": {
"task_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"code": 0
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}AI Video
Create Template to Video Task
POST
/
v1
/
video
/
template2video
Template To Video
curl --request POST \
--url https://api.domoai.com/v1/video/template2video \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"template": "kissing_screen",
"prompt": "The girl kiss the screen.",
"image": {
"bytes_base64_encoded": "/9j/4AAQSkZJRgABAQAAAQABAAD/2w..."
},
"callback_url": "https://example.com/callback",
"seconds": 5
}
'import requests
url = "https://api.domoai.com/v1/video/template2video"
payload = {
"template": "kissing_screen",
"prompt": "The girl kiss the screen.",
"image": { "bytes_base64_encoded": "/9j/4AAQSkZJRgABAQAAAQABAAD/2w..." },
"callback_url": "https://example.com/callback",
"seconds": 5
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
template: 'kissing_screen',
prompt: 'The girl kiss the screen.',
image: {bytes_base64_encoded: '/9j/4AAQSkZJRgABAQAAAQABAAD/2w...'},
callback_url: 'https://example.com/callback',
seconds: 5
})
};
fetch('https://api.domoai.com/v1/video/template2video', 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.domoai.com/v1/video/template2video",
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([
'template' => 'kissing_screen',
'prompt' => 'The girl kiss the screen.',
'image' => [
'bytes_base64_encoded' => '/9j/4AAQSkZJRgABAQAAAQABAAD/2w...'
],
'callback_url' => 'https://example.com/callback',
'seconds' => 5
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.domoai.com/v1/video/template2video"
payload := strings.NewReader("{\n \"template\": \"kissing_screen\",\n \"prompt\": \"The girl kiss the screen.\",\n \"image\": {\n \"bytes_base64_encoded\": \"/9j/4AAQSkZJRgABAQAAAQABAAD/2w...\"\n },\n \"callback_url\": \"https://example.com/callback\",\n \"seconds\": 5\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.domoai.com/v1/video/template2video")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"template\": \"kissing_screen\",\n \"prompt\": \"The girl kiss the screen.\",\n \"image\": {\n \"bytes_base64_encoded\": \"/9j/4AAQSkZJRgABAQAAAQABAAD/2w...\"\n },\n \"callback_url\": \"https://example.com/callback\",\n \"seconds\": 5\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.domoai.com/v1/video/template2video")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"template\": \"kissing_screen\",\n \"prompt\": \"The girl kiss the screen.\",\n \"image\": {\n \"bytes_base64_encoded\": \"/9j/4AAQSkZJRgABAQAAAQABAAD/2w...\"\n },\n \"callback_url\": \"https://example.com/callback\",\n \"seconds\": 5\n}"
response = http.request(request)
puts response.read_body{
"data": {
"task_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"code": 0
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Read Templates to see all available templates
Authorizations
API Key Bearer Token
Body
application/json
Available options:
kissing_screen, looping_animation, hug, groove_dance, kiss, french_kiss, 360_view, zoom_in, zoom_out, crane_up Array of input images. Currently supports only one image. Multiple images may be supported in the future.
Minimum array length:
1Show child attributes
Show child attributes
Examples:
[
{
"domoai_uri": "domoai://eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJvcmdhbml6YXRpb25faWQiOiIwNjhmZWViMy1hYmVkLTcyYTItODAwMC1hZDM1ZTg0ZGIxNDAiLCJ1cGxvYWRfYnVja2V0IjoiZW50LWFwaS10ZXN0LTEzMzYyODM0MDgiLCJ1cGxvYWRfa2V5IjoiZXBoZW1lcmFsLXVwbG9hZHMvMDY4ZmVlYjMtYWJlZC03MmEyLTgwMDAtYWQzNWU4NGRiMTQwLzI1YjhmOTgwLWM2MzEtNGQ1NC05Y2VhLTU0ZGFiYjhiMjYwNy9maWxlLm1wMyIsInR5cGUiOiJlcGhlbWVyYWwiLCJjb250ZW50X3R5cGUiOiJhdWRpby9tcGVnIiwiZmlsZV9zaXplIjoxMjU2MzIsImlhdCI6MTc2ODM4NzA3MCwiZXhwIjoxNzY4NDczNDcwLCJpc3MiOiJodHRwOi8vemhtLWFwaS5mcnAtZGV2LmRvbW8uY29vbC8ifQ.E60fIHPeDtEE0NmKaPGRYtyQJtaEQI9I0aNEwgtsLrg"
}
]
[
{
"bytes_base64_encoded": "/9j/4AAQSkZJRgABAQAAAQABAAD/2w..."
}
]
Output video duration in seconds.
Required range:
1 <= x <= 10Callback notification URL for task results. If configured, the server will actively send notifications when the task status changes. The message schema of the notification can be found in the Callback Protocol section.
Required string length:
1 - 2083Example:
"https://example.com/callback"
Maximum string length:
2000Output video aspect ratio. If null or not provided, the system will automatically detect and use the closest matching ratio based on the input image.
Available options:
16:9, 9:16, 1:1, 4:3, 3:4 Example:
"16:9"
Callbacks
POST{$request.body.callback_url}task_status_callback
Body
application/json
Available options:
PENDING, QUEUING, PROCESSING, SUCCESS, FAILED, CANCELED Available options:
TEXT_TO_VIDEO, IMAGE_TO_VIDEO, VIDEO_TO_VIDEO, TEMPLATE_TO_VIDEO, TALKING_AVATAR Show child attributes
Show child attributes
Response
Successful Response
Was this page helpful?