Skip to main content
The Kling text-to-video endpoint accepts a text prompt and asynchronously generates a video clip. Submit a task, receive a task_id and platform_id, then poll until the status reaches succeed. The request and response format matches the official Kling API exactly.
export TOKEN="oh-xxxxxxxxxxxxxxxx"
Authorization: Bearer <TOKEN>
Content-Type: application/json

Endpoint

POST https://aiapi.fhddos.com/kling/v1/videos/text2video

Request Parameters

ParameterTypeRequiredDescription
model_namestringNoModel to use (default: kling-v1). See supported models below.
promptstringYesText description of the video. Max 2500 characters.
negative_promptstringNoElements to exclude from the video.
cfg_scalenumberNoGeneration freedom [0, 1]. Only supported on kling-v1, kling-v1-5, kling-v1-6.
modestringNoGeneration quality: std (standard) or pro (professional). Default: std.
soundstringNoGenerate audio: on or off. Only supported on kling-v2-6.
camera_controlobjectNoCamera motion configuration. See Camera Control below.
aspect_ratiostringNoOutput aspect ratio: 16:9, 9:16, or 1:1. Default: 16:9.
durationstringNoVideo length in seconds: "5" or "10". Default: "5".
watermark_infoobjectNoWatermark settings.
callback_urlstringNoWebhook URL for status notifications.
external_task_idstringNoYour own task ID for idempotency and business correlation.

Supported Models

ModelNotes
kling-v1Baseline, widely compatible
kling-v1-5Improved quality
kling-v1-6Supports multi-image reference and multimodal editing
kling-v2-masterAdvanced video generation
kling-v2-1Professional generation
kling-v2-1-masterProfessional with enhanced quality
kling-v2-5Latest generation
kling-v2-5-turboLatest generation, faster
kling-v2-6Audio and motion control support

Camera Control

The camera_control object configures how the camera moves throughout the video:
{
  "camera_control": {
    "type": "simple",
    "config": {
      "horizontal": 5
    }
  }
}
type ValueDescription
simpleCustom single-axis motion — requires config
down_backCamera moves down and backward
forward_upCamera moves forward and upward
right_turn_forwardPan right while moving forward
left_turn_forwardPan left while moving forward
When type is simple, the config object may contain exactly one non-zero field:
FieldRangeAxis
horizontal[-10, 10]Left–right pan
vertical[-10, 10]Up–down tilt
pan[-10, 10]Camera rotation around vertical axis
tilt[-10, 10]Camera rotation around horizontal axis
roll[-10, 10]Camera rotation around depth axis
zoom[-10, 10]Zoom in/out
When type is simple, only one config field may be non-zero. Setting multiple non-zero fields will cause the request to fail.

Examples

Simple Text-to-Video

curl --request POST \
  --url https://aiapi.fhddos.com/kling/v1/videos/text2video \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model_name": "kling-v1",
    "prompt": "A man picks up a book and reads with a focused expression",
    "mode": "std",
    "duration": "5",
    "aspect_ratio": "16:9"
  }'
Response:
{
  "code": 0,
  "message": "success",
  "request_id": "req_1735558800_abc123",
  "data": {
    "task_id": "task_01JGHK...",
    "task_status": "submitted",
    "created_at": 1735558800000,
    "updated_at": 1735558800000
  }
}

With Camera Motion

Use a preset camera movement with kling-v2-master in pro mode:
curl --request POST \
  --url https://aiapi.fhddos.com/kling/v1/videos/text2video \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model_name": "kling-v2-master",
    "prompt": "Sunset over mountains, golden light spreading across valleys",
    "mode": "pro",
    "duration": "10",
    "aspect_ratio": "16:9",
    "camera_control": {
      "type": "forward_up"
    }
  }'

Custom Camera Axis (Simple Mode)

Control a single camera axis with a numeric value:
curl --request POST \
  --url https://aiapi.fhddos.com/kling/v1/videos/text2video \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model_name": "kling-v1-6",
    "prompt": "A timelapse of clouds rolling over a city skyline",
    "mode": "std",
    "duration": "5",
    "camera_control": {
      "type": "simple",
      "config": {
        "horizontal": 5
      }
    }
  }'

Audio Generation (kling-v2-6)

Generate a video with synchronized audio using the latest model:
curl --request POST \
  --url https://aiapi.fhddos.com/kling/v1/videos/text2video \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model_name": "kling-v2-6",
    "prompt": "A calm ocean scene with gentle waves and seagulls in the distance",
    "mode": "std",
    "duration": "5",
    "aspect_ratio": "16:9",
    "sound": "on"
  }'

With External Task ID (Idempotency)

Pass your own external_task_id to safely retry submissions:
curl --request POST \
  --url https://aiapi.fhddos.com/kling/v1/videos/text2video \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model_name": "kling-v1",
    "prompt": "A fox running through an autumn forest",
    "mode": "std",
    "duration": "5",
    "external_task_id": "my-video-job-001"
  }'

Task Status

StatusDescription
submittedTask accepted and queued
processingVideo is being generated
succeedVideo is ready — check task_result for the URL
failedGeneration failed — check task_status_msg for the reason

Polling for Completion

Query the task status using the task_id from the creation response:
curl "https://aiapi.fhddos.com/kling/v1/videos/text2video/$TASK_ID" \
  -H "Authorization: Bearer $TOKEN"
When task_status is succeed, the response will include a task_result.videos array with the video URL and duration. For full response field documentation, see Task Query.

Constraints Summary

  • prompt must be 2500 characters or fewer
  • cfg_scale is only supported on kling-v1, kling-v1-5, and kling-v1-6 — not on kling-v2 series
  • sound is only supported on kling-v2-6
  • camera_control.type = simple requires exactly one non-zero field in config