Quickstart
Submit your first generation task in a few minutes with a free test key.
- Create a Test API key in Settings → API Keys.
- Submit your first task with the request below (no credits needed with a test key).
- Poll the returned
taskIduntilstatusis"completed"— about 35 seconds in the sandbox. - Swap in a Live key and a real model id to generate for real.
curl https://vidocraft.com/api/v1/generations \
-X POST \
-H "Authorization: Bearer sk_test_xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "text-to-image:rikcgfbufzdm",
"input": {
"prompt": "a lighthouse on a cliff at golden hour, cinematic",
"aspect_ratio": "16:9"
}
}'A complete submit-and-poll loop:
#!/usr/bin/env bash
set -euo pipefail
# Requires jq. KEY=sk_live_… or sk_test_…
TASK_ID=$(curl -s https://vidocraft.com/api/v1/generations \
-X POST \
-H "Authorization: Bearer $KEY" \
-H "Content-Type: application/json" \
-d '{"model":"text-to-image:rikcgfbufzdm","input":{"prompt":"a lighthouse on a cliff"}}' \
| jq -r .taskId)
while true; do
sleep 1
STATUS=$(curl -s https://vidocraft.com/api/v1/tasks/$TASK_ID \
-H "Authorization: Bearer $KEY")
case $(echo "$STATUS" | jq -r .status) in
completed) echo "$STATUS" | jq -r '.data.results[]'; break ;;
failed|canceled) echo "$STATUS" | jq -r .failed_reason; exit 1 ;;
esac
done