Skip to main content
POST
/
collection
/
{collection_id}
/
generate
/
video
Generate video using AI
curl --request POST \
  --url https://api.videodb.io/collection/{collection_id}/generate/video/ \
  --header 'Content-Type: application/json' \
  --header 'x-access-token: <api-key>' \
  --data '
{
  "prompt": "A cat playing with a ball",
  "duration": 5,
  "callback_url": "https://webhook.example.com/callback"
}
'
{
  "success": true,
  "status": "processing",
  "data": {
    "id": "job-123",
    "output_url": "https://api.videodb.io/async-response/job-123"
  }
}
Generate short AI-powered video clips from text prompts. Specify the duration between 5-8 seconds for optimal results.
import videodb

conn = videodb.connect(api_key="your_api_key")
coll = conn.get_collection()

video = coll.generate_video(
    prompt="A drone flying over a futuristic city",
    duration=6
)

print(video.id)
print(video.stream_url)
  • Duration must be an integer between 5 and 8 seconds inclusive
  • Generation is asynchronous; access the .stream_url property to retrieve the completed video
  • Use callback_url parameter for webhook notification when generation completes
  • Video IDs have an m- prefix (e.g., m-a1b2c3d4)

Authorizations

x-access-token
string
header
required

API key for authentication (sk-xxx format)

Path Parameters

collection_id
string
required
Example:

"default"

Body

application/json
prompt
string
required
Example:

"A cat playing with a ball"

duration
number
Example:

5

callback_url
string
Example:

"https://webhook.example.com/callback"

Response

200 - application/json

Video generation started

success
boolean
Example:

true

status
enum<string>
Available options:
processing,
done,
failed
Example:

"processing"

data
object