Skip to main content
POST
See the workflow guide for examples, media requirements and billing rules. Use a GENGEN API key. For pending tasks, poll the returned ID. The successful task detail includes usage with billable seconds and the applicable price row. See usage fields.

Authorizations

Authorization
string
header
required

GENGEN API key

Body

application/json
model
enum<string>
required

Use kling-4.0.

Available options:
kling-4.0
prompt
string
required

Nonblank text. Weighted limit: ASCII code points / 26000 + other Unicode code points / 11000 <= 1. Use @referenceId to refer to media. Describe dialogue, music and sound effects here. Include positive and negative descriptions in this field. Specify what to preserve and what to change when editing.

Minimum string length: 1
mode
enum<string>

Optional. Supported values:

  • text_to_video: Generate from a text prompt without reference media.
  • image_to_video: Generate from one or more keyframe images (first, middle or last frames).
  • omni_video: Generate or edit using image/video references, a source video, elements or voices. Keyframes are also supported.

If omitted, reference images/videos, a source video, elements or voices select omni_video; otherwise keyframes select image_to_video, and text alone selects text_to_video.

Available options:
text_to_video,
image_to_video,
omni_video
assets
object

At most 10 images and 15 total references across all fields. At most five video inputs (including source video and video elements), at most three video elements, and at most 30 seconds of combined input video. Image-to-video requires at least one keyframe. Text-to-video uses the prompt alone; reference images/videos, elements and voices require Omni. Images must be JPEG/PNG, at most 30 MiB each, at least 300 pixels per side, with an aspect ratio from 2:5 to 5:2. Videos must be MP4/MOV, at most 300 MiB each, 3–30 seconds, 24–60 fps, 700–4553 pixels per side, at most 8,294,400 pixels, with an aspect ratio from 2:5 to 5:2.

controls
object
providerOptions
object

Response

Task status. Save the complete public ID. Success is delivered after output storage and settlement.

id
string
required
Pattern: ^kling40:[0-9a-f-]{36}$
model
enum<string>
required

Always kling-4.0.

Available options:
kling-4.0
status
enum<string>
required
  • pending: Task accepted and awaiting processing.
  • processing: Generation, output storage or billing settlement is in progress.
  • succeeded: Output is stored and billing is settled; read outputs.videos.
  • failed: Task failed; see failureReason.
Available options:
pending,
processing,
succeeded,
failed
outputs
object
required
usage
object

Successful task detail. With video input, billable seconds equal output seconds plus the greater of input and output seconds. Otherwise only output seconds are charged.

createdAt
string<date-time>
failureReason
string

Present when the task fails.