APIMODELSAPIMODELS
Документация API

apimodels.app

Docs/Kling Effects API
FX

Kling Effects API

136+ creative video effects including holiday themes, dynamic effects, and style transforms. Apply effects to photos for stunning video output.

Quick Start

1
Get your API key from the Console
2
Choose an effect scene
3
Send POST request to create task
4
Poll GET request for video result

Authentication

Add Authorization header with Bearer token to all requests:

Authorization: Bearer YOUR_API_KEY

Available Model

ModelAPI NameFeatures
Kling Effectskling-effects136+ creative video effects, single & dual person support

Pricing (up to 60% off)

Category$Examples
Ultra Low$0.0110pet_lion, pet_cat, pet_dog
Low$0.0190santa_gift
Medium (base)$0.0220santa_express, balloon_parade
Medium-High$0.0380bloombloom, dizzydizzy, face_warp
High$0.0430happy_birthday, birthday_cake
Ultra High$0.0750bullet_time

Endpoints

POST/api/v1/video/generations

Create a Kling effects video generation task. Applies a creative effect to one or two person photos.

GET/api/v1/video/generations?task_id=xxx

Query task status and get video URL

Request Parameters

modelrequiredstring
"kling-effects"
effect_scenerequiredstring
Effect scene name, e.g. "balloon_parade", "happy_birthday", "bullet_time"
inputrequiredobject
Input object containing image(s) and options
callback_urlstring
Webhook URL for completion notification

input Object Fields

imagestring
Single person photo URL or base64 (for single-person effects)
imagesarray
Array of image URLs or base64 strings (for dual-person effects)
model_namestring
Model name for dual effects, e.g. "kling-v1-6"
modestring
"std" or "pro" for dual effects
durationstring
Video duration in seconds

Code Examples

curl -X POST https://api.apimodels.app/v1/video/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "kling-effects",
    "effect_scene": "balloon_parade",
    "input": {
      "image": "https://example.com/person.jpg"
    }
  }'

Response Format

Create Task Response

{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "clxxx...",
    "state": "pending",
    "model": "kling-video/kling-effects"
  }
}

Success Response

{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "clxxx...",
    "state": "completed",
    "model": "kling-video/kling-effects",
    "resultUrls": ["https://...video.mp4"],
    "createTime": 1705123450000,
    "completeTime": 1705123500000
  }
}

Failed Response

{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "clxxx...",
    "state": "failed",
    "model": "kling-video/kling-effects",
    "failMsg": "Content policy violation"
  }
}

Webhook Callback (callback_url)

Pass callback_url in the create request. When the task reaches the completed or failed terminal state, our server sends a single HTTP POST to that URL with Content-Type: application/json (no signing header). Delivery is retried up to 3 times (exponential backoff 1s/2s/4s, 10s per attempt); if still unsuccessful, a background job keeps retrying for up to 30 minutes until your endpoint returns 2xx.

Payload Structure

POST {your callback_url}
Content-Type: application/json

{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "clxxx...",
    "model": "kling-video/kling-effects",
    "state": "completed" | "failed",
    "param": "<JSON string>",            // request params, JSON.parse once
    "resultJson": "<JSON string> | null", // result object, JSON.parse once
    "failCode": null | "CONTENT_MODERATION | INVALID_INPUT | INSUFFICIENT_BALANCE | UPSTREAM_BUSY | UPSTREAM_FAILED | TIMEOUT | INTERNAL_ERROR | OTHER",
    "failMsg": null | "string",
    "retryable": true | false,           // present when state=failed: safe to retry/fallback
    "costTime": 12345,                    // duration in ms
    "completeTime": 1705123500000,        // ms epoch
    "createTime": 1705123450000           // ms epoch
  }
}

Note: data.param and data.resultJson are both JSON strings — call JSON.parse once on each.

Video task: shape after JSON.parse(data.resultJson)

{
  "resultUrls":    ["https://r2.apimodels.app/videos/xxx.mp4"],
  "videoDuration": 5                   // optional, seconds
}

resultUrls is always present (length 1 in success, [] on failure). Other fields are optional. When state=failed, resultJson is typically null or {"resultUrls":[]}.

Node.js receiver example

app.post('/webhook/kling-effects', express.json(), (req, res) => {
  const { taskId, state, resultJson, failMsg } = req.body.data
  if (state === 'completed') {
    const r = JSON.parse(resultJson)
    console.log('video ready', taskId, r.resultUrls[0], r.videoDuration)
  } else {
    console.warn('video failed', taskId, failMsg)
  }
  res.status(200).end()                 // must be 2xx, otherwise we retry
})

Notes

  • -A task stops retrying only after a 2xx response — once delivered it is never pushed again.
  • -Callbacks are not signed today. Embed a random token in your callback_url path and verify it on receipt.
  • -Effects video jobs typically take 30s to several minutes — strongly prefer callback_url over polling.
  • -Use a public HTTPS endpoint that responds within 10 seconds (per-attempt timeout).

Task States

pendingTask queued, waiting to process
processingVideo is being generated
completedVideo generation successful
failedVideo generation failed

Error Codes

400Bad Request - Missing or invalid parameters
401Unauthorized - Invalid API key
402Payment Required - Insufficient credits
404Not Found - Task ID not found
500Internal Server Error

Important Notes

  • *Video files are stored for 30 days, download promptly
  • *136+ effects available across holiday, dynamic, and style categories
  • *Single-person effects use the "image" field, dual-person effects use the "images" array
  • *Pricing varies by effect category, from $0.0110 to $0.0750
  • *Poll every 5-10 seconds to check status
  • *Effect scene names are case-sensitive

FAQ

How do Kling video effects work?

Pick a preset effect and pass an input image/video; the API returns a video with the effect applied. One key, per-clip pricing, charged only on success.