UlazAI developer docs

Developer documentation

Kling 3.0 Video API

White-label video generation API for text-to-video, image-to-video, start/end frame control, optional audio, and multi-shot storytelling.

Pricing is per second. Duration supports whole seconds from 3 to 15. You can enable Prompt Directory opt-in to apply an immediate -10 credits discount.

POST /kling30/api/generate/

Create a Kling 3.0 generation task.

Authentication

Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Request body

{
  "prompt": "A cinematic tracking shot following a cyclist through a rainy neon city street.",
  "generationMode": "text_to_video",
  "durationSeconds": 8,
  "qualityMode": "pro",
  "sound": true,
  "multiShots": true,
  "aspectRatio": "16:9",
  "prompt_directory_optin": true
}

Image-to-video example

{
  "prompt": "The portrait slowly smiles while camera pushes in.",
  "generationMode": "image_to_video",
  "imageUrls": ["https://example.com/source.jpg"],
  "durationSeconds": 5,
  "qualityMode": "std",
  "sound": false,
  "startFrameUrl": "https://example.com/start.jpg",
  "endFrameUrl": "https://example.com/end.jpg"
}

Field reference

prompt (string, required, max 2500)

generationMode (required): text_to_video or image_to_video

imageUrls (array): required for image-to-video unless frame URLs are provided

durationSeconds (required): integer 3..15

qualityMode (required): std or pro

sound (optional, boolean)

multiShots (optional, boolean)

aspectRatio (optional): 16:9, 9:16, 1:1 (not allowed when start/end frame URLs are set)

startFrameUrl, endFrameUrl (optional http(s) URLs)

prompt_directory_optin (optional, boolean): apply immediate discount and auto-share on success

Success response

{
  "success": true,
  "task_id": "7f8cfd64-5b91-4a31-a987-e0ea8fd9d0a1",
  "provider_task_id": "281e5b0...f39b9",
  "status": "processing",
  "credits_used": 310,
  "directory_discount_applied": 10,
  "estimated_time": "60-180 seconds"
}
GET /kling30/api/status/{task_id}/

Get task status and output URL when complete.

{
  "success": true,
  "task_id": "7f8cfd64-5b91-4a31-a987-e0ea8fd9d0a1",
  "status": "completed",
  "video_url": "https://cdn.example.com/path/output.mp4",
  "credits_charged": 310,
  "prompt_submission_id": "70f4f6a9-2d17-4f31-81ac-8d57eecb9e21"
}

Status values: pending, processing, completed, failed. On failure, credits are refunded automatically.

POST /kling30/api/upload/

Upload source/start/end frame images (JPEG/PNG/WebP, max 10MB) and receive a public URL for generation requests.

Pricing matrix (credits per second)

Standard

No audio: 20 / s

With audio: 30 / s

Pro

No audio: 27 / s

With audio: 40 / s

cURL example

curl -X POST https://ulazai.com/kling30/api/generate/ \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A heroic wide shot of a spaceship entering orbit above Earth.",
    "generationMode": "text_to_video",
    "durationSeconds": 10,
    "qualityMode": "pro",
    "sound": true,
    "multiShots": true,
    "aspectRatio": "16:9",
    "prompt_directory_optin": true
  }'

Error codes

  • 400 invalid payload
  • 401 invalid authentication
  • 402 insufficient credits
  • 429 rate-limited
  • 500 upstream/provider or internal failure