POST /v1/videos/generations
curl --request POST \
--url https://api.geekhub.mx/v1/videos/generations \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"duration": 123,
"aspect_ratio": "<string>"
}
'import requests
url = "https://api.geekhub.mx/v1/videos/generations"
payload = {
"model": "<string>",
"prompt": "<string>",
"duration": 123,
"aspect_ratio": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({model: '<string>', prompt: '<string>', duration: 123, aspect_ratio: '<string>'})
};
fetch('https://api.geekhub.mx/v1/videos/generations', 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.geekhub.mx/v1/videos/generations",
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([
'model' => '<string>',
'prompt' => '<string>',
'duration' => 123,
'aspect_ratio' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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.geekhub.mx/v1/videos/generations"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"duration\": 123,\n \"aspect_ratio\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.geekhub.mx/v1/videos/generations")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"duration\": 123,\n \"aspect_ratio\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.geekhub.mx/v1/videos/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"duration\": 123,\n \"aspect_ratio\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"status": "<string>",
"model": "<string>"
}API Reference
POST /v1/videos/generations
Create a video generation job (async)
POST
/
v1
/
videos
/
generations
POST /v1/videos/generations
curl --request POST \
--url https://api.geekhub.mx/v1/videos/generations \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"duration": 123,
"aspect_ratio": "<string>"
}
'import requests
url = "https://api.geekhub.mx/v1/videos/generations"
payload = {
"model": "<string>",
"prompt": "<string>",
"duration": 123,
"aspect_ratio": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({model: '<string>', prompt: '<string>', duration: 123, aspect_ratio: '<string>'})
};
fetch('https://api.geekhub.mx/v1/videos/generations', 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.geekhub.mx/v1/videos/generations",
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([
'model' => '<string>',
'prompt' => '<string>',
'duration' => 123,
'aspect_ratio' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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.geekhub.mx/v1/videos/generations"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"duration\": 123,\n \"aspect_ratio\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.geekhub.mx/v1/videos/generations")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"duration\": 123,\n \"aspect_ratio\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.geekhub.mx/v1/videos/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"duration\": 123,\n \"aspect_ratio\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"status": "<string>",
"model": "<string>"
}Request body
string
required
The namespaced model ID, e.g.
fal/kling-3-pro. See Video models.string
required
Video description. Maximum 4000 characters.
integer
Duration in seconds. If you don’t send it, we use the model default. Per-model cap (see catalog).
string
Video ratio. Examples:
16:9, 9:16, 1:1, 4:5. Support depends on the model.Response (immediate, ~100ms)
{
"id": "e8c96506-72a1-429f-a7ed-4bb0a42541be",
"object": "video.job",
"status": "processing",
"model": "fal/kling-3-pro",
"prompt": "an astronaut surfing a giant wave of green salsa",
"video_url": null,
"duration": 5,
"error": null,
"created": 1782415166,
"completed": null
}
string
The job_id. Use it for polling.
string
Usually
processing. Rare but possible failed if the submission to the provider blew up.string
The model id you requested.
Examples
job = client.post("/videos/generations", body={
"model": "fal/kling-3-pro",
"prompt": "An astronaut surfing a giant wave of green salsa, cinematic",
"duration": 5,
"aspect_ratio": "16:9",
})
print(job["id"])
job = client.post("/videos/generations", body={
"model": "google/veo-3.1",
"prompt": "A hummingbird drinking from a cempasúchil flower at dawn, naturalistic foley",
"duration": 8,
})
curl -X POST https://api.geekhub.mx/v1/videos/generations \
-H "Authorization: Bearer ghub_sk_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"model": "fal/kling-3-pro",
"prompt": "An astronaut surfing a giant wave of green salsa",
"duration": 5,
"aspect_ratio": "16:9"
}'
⚠️ About cost
When you create the job you are NOT charged yet. The charge happens when the job transitions tocompleted. If it fails, there’s no charge.
Safety cap: your balance is validated at submit — if it’s ≤ 0 we return 402 insufficient_balance before creating the job.
Before sending many jobs in parallel, compute your max cost:
duration × model_price × markup × FX. Example: 10 Kling 5s videos = 10 × 5 × $0.04 × 1.05 × 20 = $42 MXN.Next step
GET /v1/videos/{id}
Poll the job status until it reaches
completed.⌘I