Skip to main content
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>"
}
'
{
  "id": "<string>",
  "status": "<string>",
  "model": "<string>"
}

Request body

model
string
required
The namespaced model ID, e.g. fal/kling-2. See Video models.
prompt
string
required
Video description. Maximum 4000 characters.
duration
integer
Duration in seconds. If you don’t send it, we use the model default. Per-model cap (see catalog).
aspect_ratio
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-2",
  "prompt": "an astronaut surfing a giant wave of green salsa",
  "video_url": null,
  "duration": 5,
  "error": null,
  "created": 1782415166,
  "completed": null
}
id
string
The job_id. Use it for polling.
status
string
Usually processing. Rare but possible failed if the submission to the provider blew up.
model
string
The model id you requested.

Examples

job = client.post("/videos/generations", body={
    "model": "fal/kling-2",
    "prompt": "An astronaut surfing a giant wave of green salsa, cinematic",
    "duration": 5,
    "aspect_ratio": "16:9",
})
print(job["id"])

⚠️ About cost

When you create the job you are NOT charged yet. The charge happens when the job transitions to completed. 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.