Skip to main content
POST
/
vendors
/
klingai
/
v1
/
kling-v2.6
/
text-to-video
/
generation
Text to Video Generation
curl --request POST \
  --url https://api.mulerun.com/vendors/klingai/v1/kling-v2.6/text-to-video/generation \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "A beautiful woman is dancing in a room",
  "negative_prompt": "ugly, bad, distorted",
  "mode": "std",
  "aspect_ratio": "16:9",
  "duration": 5,
  "sound": "on"
}
'
{
  "task_info": {
    "id": "8e1e315e-b50d-4334-a231-be7d19a372f4",
    "status": "pending",
    "created_at": "2025-09-21T00:00:00.000Z",
    "updated_at": "2025-09-21T00:00:00.000Z"
  }
}
This API supports Kling v2.6 video generation model with audio generation. Please refer to Kling’s official documentation for more details.

Overview

Generate videos from text prompts using the Kling v2.6 model with built-in audio generation support.

Key Features

  • Text-to-video generation with audio
  • Multiple aspect ratio options (16:9, 9:16, 1:1)
  • Standard and Professional quality modes
  • 5s or 10s duration
  • Audio generation support (new in v2.6)

Quality Modes

ModeDescription
stdStandard Mode - Cost-effective, suitable for quick previews
proProfessional Mode - Higher quality output, longer processing time

Audio Generation

The sound parameter enables automatic audio generation:
  • on: Generate video with synchronized audio
  • off: Generate silent video (default)

Example Requests

Basic Text-to-Video with Audio

{
  "prompt": "A beautiful woman is dancing in a lively room with music",
  "mode": "std",
  "duration": 5,
  "sound": "on"
}

Professional Quality Video

{
  "prompt": "Cinematic shot of ocean waves crashing against rocks",
  "negative_prompt": "ugly, bad, distorted",
  "mode": "pro",
  "aspect_ratio": "16:9",
  "duration": 10,
  "sound": "on"
}

Silent Video

{
  "prompt": "A person walking through a city at night",
  "mode": "std",
  "duration": 5,
  "sound": "off"
}

Parameters

sound

  • Options: on, off
  • Default: off
  • Note: Only v2.6 and later versions support this parameter

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
prompt
string
required

Positive text prompt. Cannot exceed 2500 characters.

Maximum string length: 2500
negative_prompt
string

Negative text prompt. Cannot exceed 2500 characters.

Maximum string length: 2500
sound
enum<string>
default:off

Generate audio simultaneously when generating videos.

  • on: Enable audio generation
  • off: Disable audio generation (silent video)
Available options:
on,
off
mode
enum<string>
default:std

Video generation mode

std: Standard Mode, which is cost-effective. pro: Professional Mode, generates videos use longer duration but higher quality video output.

Available options:
std,
pro
aspect_ratio
enum<string>
default:16:9

The aspect ratio of the generated video frame (width:height)

Available options:
16:9,
9:16,
1:1
duration
enum<integer>
default:5

Video Length in seconds

Available options:
5,
10

Response

202 - application/json

Accepted - Task created successfully

task_info
object