Text To Video
curl --request POST \
--url https://api.domoai.com/v1/video/text2video \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "Close-up of a smiling woman in soft sunlight, gentle breeze in her hair, 4K",
"model": "t2v-2.4-faster",
"callback_url": "https://example.com/callback",
"seconds": 5
}
'import requests
url = "https://api.domoai.com/v1/video/text2video"
payload = {
"prompt": "Close-up of a smiling woman in soft sunlight, gentle breeze in her hair, 4K",
"model": "t2v-2.4-faster",
"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({
prompt: 'Close-up of a smiling woman in soft sunlight, gentle breeze in her hair, 4K',
model: 't2v-2.4-faster',
callback_url: 'https://example.com/callback',
seconds: 5
})
};
fetch('https://api.domoai.com/v1/video/text2video', 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/text2video",
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([
'prompt' => 'Close-up of a smiling woman in soft sunlight, gentle breeze in her hair, 4K',
'model' => 't2v-2.4-faster',
'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/text2video"
payload := strings.NewReader("{\n \"prompt\": \"Close-up of a smiling woman in soft sunlight, gentle breeze in her hair, 4K\",\n \"model\": \"t2v-2.4-faster\",\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/text2video")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"Close-up of a smiling woman in soft sunlight, gentle breeze in her hair, 4K\",\n \"model\": \"t2v-2.4-faster\",\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/text2video")
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 \"prompt\": \"Close-up of a smiling woman in soft sunlight, gentle breeze in her hair, 4K\",\n \"model\": \"t2v-2.4-faster\",\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 Text to Video Task
POST
/
v1
/
video
/
text2video
Text To Video
curl --request POST \
--url https://api.domoai.com/v1/video/text2video \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "Close-up of a smiling woman in soft sunlight, gentle breeze in her hair, 4K",
"model": "t2v-2.4-faster",
"callback_url": "https://example.com/callback",
"seconds": 5
}
'import requests
url = "https://api.domoai.com/v1/video/text2video"
payload = {
"prompt": "Close-up of a smiling woman in soft sunlight, gentle breeze in her hair, 4K",
"model": "t2v-2.4-faster",
"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({
prompt: 'Close-up of a smiling woman in soft sunlight, gentle breeze in her hair, 4K',
model: 't2v-2.4-faster',
callback_url: 'https://example.com/callback',
seconds: 5
})
};
fetch('https://api.domoai.com/v1/video/text2video', 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/text2video",
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([
'prompt' => 'Close-up of a smiling woman in soft sunlight, gentle breeze in her hair, 4K',
'model' => 't2v-2.4-faster',
'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/text2video"
payload := strings.NewReader("{\n \"prompt\": \"Close-up of a smiling woman in soft sunlight, gentle breeze in her hair, 4K\",\n \"model\": \"t2v-2.4-faster\",\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/text2video")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"Close-up of a smiling woman in soft sunlight, gentle breeze in her hair, 4K\",\n \"model\": \"t2v-2.4-faster\",\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/text2video")
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 \"prompt\": \"Close-up of a smiling woman in soft sunlight, gentle breeze in her hair, 4K\",\n \"model\": \"t2v-2.4-faster\",\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 Text To Video Styles to see all available styles
Authorizations
API Key Bearer Token
Body
application/json
Required string length:
1 - 2000Output 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"
Available options:
t2v-2.4-faster, t2v-2.4-advanced Example:
"t2v-2.4-faster"
Available options:
japanese_anime, realistic, pixel, cartoon_game, flat_color_anime, 90s_style Example:
"japanese_anime"
Output video aspect ratio.
Available options:
16:9, 9:16, 1:1, 4:3, 3:4 Examples:
"16:9"
"9:16"
"1:1"
"4:3"
"3:4"
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?