cURL
curl --request POST \ --url https://api.videodb.io/collection/{collection_id}/generate/image/ \ --header 'Content-Type: application/json' \ --header 'x-access-token: <api-key>' \ --data ' { "prompt": "A beautiful sunset over mountains", "aspect_ratio": "16:9", "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 images using AI models from text prompts
import videodb conn = videodb.connect(api_key="your_api_key") coll = conn.get_collection() image = coll.generate_image( prompt="Serene mountain landscape with golden sunset", aspect_ratio="16:9" ) print(image.id) print(image.generate_url())
1:1
9:16
16:9
4:3
3:4
callback_url
i-
i-a1b2c3d4
API key for authentication (sk-xxx format)
"default"
"A beautiful sunset over mountains"
"16:9"
"https://webhook.example.com/callback"
Image generation started
true
processing
done
failed
"processing"
Show child attributes