Skip to main content

UNLIMITED

FLUX 3 Klein, Qwen 2.1, H3 Turbo, 310+ effectsSee plans
Back to API Platform

Video Generation

Kling 4.0 API

Kling Video 4.0. Up to 30 seconds at 1080p with native audio and dialogue: text, start/end frames, reference images and videos, or edit an existing clip. Integrate this model via REST with endpoint docs, parameters, and code examples.

Img2Vid
Audio
Credit Cost
25 credits
Type
Video

API Endpoint

POST
/api/v1/models/kling-4-0/run

Test This Model

Run a real request through the API pipeline and inspect the exact input and output your integration will handle. Uses your credits like any API call; failed runs are refunded automatically.

Parameters

Input parameters accepted by this model

ParameterTypeDefault
prompt
required
string
-
image
url
-
last_frame_image
url
-
reference_images
array
-
video
url
-
reference_videos
array
-
resolution
enum
1080p
aspect_ratio
enum
16:9
duration
integer
5

Use saved characters (@Name)

Write @Name in the prompt to use a character, product, outfit, location, prop or style saved in the account's Character Studio, for example "@Mara on a beach at sunset". Its photos are added to reference_images automatically, after any images you send yourself, so your own image numbering is unchanged. List saved names with GET /api/v1/characters and save new ones with POST /api/v1/characters. An @word that names nothing saved stays plain text.

Supported Aspect Ratios

16:9
9:16
1:1
21:9

See also

Related endpoints on this model — you may need a different apiId for a different operation (e.g. image edit vs generation).

Code Examples

Text → video — copy and paste to get started

bash
curl -X POST "https://pixeldojo.ai/api/v1/models/kling-4-0/run" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "0-4s: slow push in on a barista in a rainy cafe. 4-10s: she looks up and says \"Last order of the night.\" Audio: rain on glass, espresso hiss.",
    "duration": 10,
    "resolution": "1080p"
  }'

Response Format

Submit Response (202 Accepted)

json
{
  "jobId": "job_abc123...",
  "status": "pending",
  "statusUrl": "https://pixeldojo.ai/api/v1/jobs/job_abc123...",
  "creditCost": 25,
  "creditsRemaining": 95,
  "expiresAt": "2026-10-24T21:06:30Z"
}

Completed Response

json
{
  "jobId": "job_abc123...",
  "status": "completed",
  "output": {
    "video": "https://temp.pixeldojo.ai/pixeldojotemp/1705930123-456789.mp4"
  },
  "creditCost": 25,
  "expiresAt": "2026-10-24T21:06:30Z"
}