Generate Video
POST
/api/v1/generate-videoGenerate a video from a text prompt using AI models. Returns a streaming response with status updates and the final video file path. The response is sent as newline-delimited JSON (JSON Lines).
Request Body
Name Type Required Default Description
prompt string Yes — Description of the video to generate model string No veo-3.1-generate-preview Model key Values: "veo-3.1-generate-preview", "veo-3.1-fast-generate-preview", "kling-3-0-pro", "kling-3-0-standard", "kling-o3-pro", "kling-o3-standard", "kling-2-6-pro", "kling-2-5-turbo-pro", "kling-2-5-turbo-standard", "runway-gen4-5", "runway-gen4-turbo", "runway-aleph", "minimax-hailuo-2-3", "minimax-hailuo-2-3-fast", "minimax-hailuo-02", "minimax-video-01-director", "minimax-video-01-live", "seedance-1-5-pro", "seedance-1-0-pro", "seedance-1-0-pro-fast", "seedance-1-0-lite", "grok-imagine-video", "sora-2-pro", "sora-2", "ai-avatar", "ai-avatar-tts", "ai-avatar-duo-tts", "ai-avatar-duo", "stable-avatar", "fabric-1-0", "fabric-1-0-fast", "fabric-1-0-text"
aspect_ratio string No 16:9 Aspect ratio Values: "16:9", "9:16", "1:1"
duration number No 8 Duration in seconds (5, 8, or 10) resolution string No 1080p Video resolution audio boolean No true Include audio in the generated video count number No 1 Number of video variants to generate seed number No — Seed for reproducibility Example Request
curl -X POST https://api.dalnulla.com/api/v1/generate-video \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{
"prompt": "A drone shot flying over a foggy forest at sunrise",
"model": "veo-3.1-generate-preview",
"aspect_ratio": "16:9",
"duration": 8,
"audio": true
}'Responses
Success (Streaming)
The response is streamed as newline-delimited JSON. Each line is a JSON object with a type field:
"status"— Progress updates during generation"result"— Final result with the video file path"error"— Error during generation (after headers sent)
200 OK (Streaming)
{"type":"status","status":"Queued","details":"Waiting for available slot..."}
{"type":"status","status":"Processing","details":"Generating video with AI model..."}
{"type":"status","status":"Processing","details":"Generating video... (15s elapsed)"}
{"type":"status","status":"Uploading","details":"Saving video to storage..."}
{"type":"status","status":"Success","details":"Video generated successfully with google"}
{"type":"result","filePath":"user-id/videos/video_1234567890.mp4","metadata":{}}Errors
Errors before streaming starts are returned as standard JSON responses:
400 Bad Request
{
"error": "Prompt is required"
}401 Unauthorized
{
"error": "Unauthorized: Invalid or expired token"
}402 Payment Required
{
"error": "Insufficient credits. Required: 200, Remaining: 50"
}403 Forbidden
{
"error": "This model requires a Pro subscription",
"code": "MODEL_REQUIRES_SUBSCRIPTION",
"model": "kling-2.1",
"requiredTier": "Pro"
}500 Internal Server Error
{
"type": "error",
"error": "Failed to generate video"
}