Skip to main content
POST
Kling 4.0
Use the authenticated gateway at https://maxapi.io. Authentication · Shared request fields.

Model IDs and parameter coverage

Send model and input in the JSON body. input.prompt is required. Image-to-image and image-to-video IDs require reference images. Use only the input fields listed for your selected ID; a family-wide table does not mean every variant accepts every field.

Parameters

Use public HTTP(S) media URLs that the generation service can fetch. Replace all example media URLs with your own files. Mode-specific requirements and provider limits below still apply after local validation.

Supported scope and limits

  • Output duration: 3–30 whole seconds. Default: 5 seconds.
  • Only publicly accessible HTTP(S) image URLs are accepted.
  • Video input, video editing, extension and audio input are not enabled.

Pricing

The rate depends on the selected resolution and the requested output duration. Prices are standard public rates in USD. Multiply per-second rates by the billed duration, per-image rates by the requested image count, and per-video rates by one generation. Reference-video rates replace the ordinary output rate where shown. The final task total is rounded up to whole credits: credits = ceil(total_USD × 100); one credit is $0.01. Round once after adding all billable components. The following examples show the rounded debit.

Submit and query

A successful submission returns data.taskId; it does not mean generation has completed. Poll Query Task or use a Webhook. Stop polling on SUCCESS, FAILURE, TIMEOUT or CANCELLED. A pending or uncertain submission must not be blindly resubmitted.

Minimal request bodies by model ID

kling-4.0

Billing and model notes

How much does the Kling 4.0 API cost?

From $0.155/s. For example: 5 seconds at 1080p costs $1.17. See the pricing table above for every variant and resolution.

What durations and resolutions does Kling 4.0 support?

Durations: 3–30s. Resolutions: 720p, 1080p.

How is the final credit charge calculated?

Unit prices are shown in US dollars. The total task price is rounded up to whole credits; one credit is $0.01. The Playground and cost examples show this rounded debit. Small tasks may therefore cost more than the unrounded unit-price calculation.

Which generation modes are supported?

Text-to-video, image-to-video, image references, and first/last frames. Video input is not supported by this integration.

Am I charged if a task fails?

Confirmed failures, including content moderation rejections, are refunded in full. For a pending submission or a request timeout, check the task status before retrying.