curl --request POST \
--url https://api.ekly.ai/v1/videos \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"duration_seconds": 5,
"model": "seedance-2-5-fal",
"prompt": "A slow aerial shot over a misty pine forest at dawn",
"tier": "720p"
}
'import requests
url = "https://api.ekly.ai/v1/videos"
payload = {
"duration_seconds": 5,
"model": "seedance-2-5-fal",
"prompt": "A slow aerial shot over a misty pine forest at dawn",
"tier": "720p"
}
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({
duration_seconds: 5,
model: 'seedance-2-5-fal',
prompt: 'A slow aerial shot over a misty pine forest at dawn',
tier: '720p'
})
};
fetch('https://api.ekly.ai/v1/videos', 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.ekly.ai/v1/videos",
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([
'duration_seconds' => 5,
'model' => 'seedance-2-5-fal',
'prompt' => 'A slow aerial shot over a misty pine forest at dawn',
'tier' => '720p'
]),
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.ekly.ai/v1/videos"
payload := strings.NewReader("{\n \"duration_seconds\": 5,\n \"model\": \"seedance-2-5-fal\",\n \"prompt\": \"A slow aerial shot over a misty pine forest at dawn\",\n \"tier\": \"720p\"\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.ekly.ai/v1/videos")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"duration_seconds\": 5,\n \"model\": \"seedance-2-5-fal\",\n \"prompt\": \"A slow aerial shot over a misty pine forest at dawn\",\n \"tier\": \"720p\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ekly.ai/v1/videos")
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 \"duration_seconds\": 5,\n \"model\": \"seedance-2-5-fal\",\n \"prompt\": \"A slow aerial shot over a misty pine forest at dawn\",\n \"tier\": \"720p\"\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2023-11-07T05:31:56Z",
"id": "6f1c2d3e-9a0b-4c7d-8e1f-2a3b4c5d6e7f",
"model": "seedance-2-5-fal",
"prompt": "<string>",
"status": "pending",
"type": "image",
"completed_at": "2023-11-07T05:31:56Z",
"credits_charged": 123,
"error": {
"code": "<string>",
"message": "<string>"
},
"idempotency_key": "<string>",
"outputs": [
{
"url": "<string>",
"asset_id": "<string>",
"content_type": "video/mp4",
"duration_seconds": 123,
"height": 123,
"width": 123
}
]
}{
"error": {
"code": "unauthenticated",
"message": "This API key is not valid. Create a new one in Settings → Team.",
"trace_id": "c3746d5302dc4be6b2e8fa99fa762a8c"
}
}{
"error": {
"code": "payment_required",
"message": "Insufficient credits: this generation needs 39.6 credits and 12.0 are available.",
"trace_id": "c3746d5302dc4be6b2e8fa99fa762a8c"
}
}{
"error": {
"code": "forbidden",
"message": "API keys can only call the /v1 API.",
"trace_id": "c3746d5302dc4be6b2e8fa99fa762a8c"
}
}{
"error": {
"code": "conflict",
"message": "This idempotency key was already used with a different request.",
"trace_id": "c3746d5302dc4be6b2e8fa99fa762a8c"
}
}{
"error": {
"code": "validation_error",
"details": [
{
"loc": [
"body",
"model"
],
"msg": "Field required",
"type": "missing"
}
],
"message": "Request validation failed.",
"trace_id": "c3746d5302dc4be6b2e8fa99fa762a8c"
}
}{
"error": {
"code": "rate_limited",
"message": "Rate limit exceeded; retry after 12s.",
"trace_id": "c3746d5302dc4be6b2e8fa99fa762a8c"
}
}Generate a video
Submits a video generation from a prompt, a first/last frame, reference media, an earlier generation (source_generation_id, to extend it) or a character image plus motion video (motion-control models). GET /v1/models/{id} lists the inputs each mode needs; reference inputs take asset ids. Returns immediately with status: pending; credits are reserved now and settled when the job finishes. Poll GET /v1/generations/{id} until completed or failed.
curl --request POST \
--url https://api.ekly.ai/v1/videos \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"duration_seconds": 5,
"model": "seedance-2-5-fal",
"prompt": "A slow aerial shot over a misty pine forest at dawn",
"tier": "720p"
}
'import requests
url = "https://api.ekly.ai/v1/videos"
payload = {
"duration_seconds": 5,
"model": "seedance-2-5-fal",
"prompt": "A slow aerial shot over a misty pine forest at dawn",
"tier": "720p"
}
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({
duration_seconds: 5,
model: 'seedance-2-5-fal',
prompt: 'A slow aerial shot over a misty pine forest at dawn',
tier: '720p'
})
};
fetch('https://api.ekly.ai/v1/videos', 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.ekly.ai/v1/videos",
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([
'duration_seconds' => 5,
'model' => 'seedance-2-5-fal',
'prompt' => 'A slow aerial shot over a misty pine forest at dawn',
'tier' => '720p'
]),
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.ekly.ai/v1/videos"
payload := strings.NewReader("{\n \"duration_seconds\": 5,\n \"model\": \"seedance-2-5-fal\",\n \"prompt\": \"A slow aerial shot over a misty pine forest at dawn\",\n \"tier\": \"720p\"\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.ekly.ai/v1/videos")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"duration_seconds\": 5,\n \"model\": \"seedance-2-5-fal\",\n \"prompt\": \"A slow aerial shot over a misty pine forest at dawn\",\n \"tier\": \"720p\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ekly.ai/v1/videos")
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 \"duration_seconds\": 5,\n \"model\": \"seedance-2-5-fal\",\n \"prompt\": \"A slow aerial shot over a misty pine forest at dawn\",\n \"tier\": \"720p\"\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2023-11-07T05:31:56Z",
"id": "6f1c2d3e-9a0b-4c7d-8e1f-2a3b4c5d6e7f",
"model": "seedance-2-5-fal",
"prompt": "<string>",
"status": "pending",
"type": "image",
"completed_at": "2023-11-07T05:31:56Z",
"credits_charged": 123,
"error": {
"code": "<string>",
"message": "<string>"
},
"idempotency_key": "<string>",
"outputs": [
{
"url": "<string>",
"asset_id": "<string>",
"content_type": "video/mp4",
"duration_seconds": 123,
"height": 123,
"width": 123
}
]
}{
"error": {
"code": "unauthenticated",
"message": "This API key is not valid. Create a new one in Settings → Team.",
"trace_id": "c3746d5302dc4be6b2e8fa99fa762a8c"
}
}{
"error": {
"code": "payment_required",
"message": "Insufficient credits: this generation needs 39.6 credits and 12.0 are available.",
"trace_id": "c3746d5302dc4be6b2e8fa99fa762a8c"
}
}{
"error": {
"code": "forbidden",
"message": "API keys can only call the /v1 API.",
"trace_id": "c3746d5302dc4be6b2e8fa99fa762a8c"
}
}{
"error": {
"code": "conflict",
"message": "This idempotency key was already used with a different request.",
"trace_id": "c3746d5302dc4be6b2e8fa99fa762a8c"
}
}{
"error": {
"code": "validation_error",
"details": [
{
"loc": [
"body",
"model"
],
"msg": "Field required",
"type": "missing"
}
],
"message": "Request validation failed.",
"trace_id": "c3746d5302dc4be6b2e8fa99fa762a8c"
}
}{
"error": {
"code": "rate_limited",
"message": "Rate limit exceeded; retry after 12s.",
"trace_id": "c3746d5302dc4be6b2e8fa99fa762a8c"
}
}Authorizations
Headers
Body
Generate a video. The same endpoint covers text-, image- and reference-driven generation, video extension (source_generation_id) and motion control (a motion-control model with character_image and motion_video). GET /v1/models/{id} lists which inputs each mode needs.
Response
Successful Response
One generation. Poll GET /v1/generations/{id} until status is completed or failed.