# kling/kling-2.6-i2v

Source: https://docs.sociaro.com/models/kling-kling-2-6-i2v/

Kling 2.6 image-to-video.

The body is Kling's own: contents[] with type prompt, first_frame (req; public image URL) and optional last_frame (first + last frame needs settings.resolution 1080p, so it is refused at the default 720p); settings.resolution 720p|1080p (def 720p); settings.duration 5|10 (def 5); settings.audio native|off (def off; native audio needs settings.resolution 1080p); options.watermark_info {enabled: false}. Not accepted: options.callback_url (poll instead), options.external_task_id (the gateway sets its own), options.watermark_info.enabled true (only false is accepted), contents[] types element and voice, bodies over 1 MiB (pass images as URLs).

Unknown fields are rejected.

Served via the relay: POST /v1/kling/generations, poll GET /v1/kling/generations/{job_id}. Per-second pricing by resolution and audio, billed by the relay.

|  |  |
| --- | --- |
| Slug | `kling/kling-2.6-i2v` |
| Kind | video |
| Vendor | kling |
| Endpoint | `POST /v1/kling/generations` |

[View pricing and billing conditions](https://docs.sociaro.com/models/kling-kling-2-6-i2v/#pricing)

## Example request

cURL

```bash
curl https://api.sociaro.com/v1/kling/generations \
  -H "Authorization: Bearer $SOCIARO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
        "model": "kling/kling-2.6-i2v",
        "contents": [
          {"type": "prompt", "text": "a paper boat drifts down a rain-soaked street"},
          {"type": "first_frame", "url": "https://your-cdn.example.com/first.png"}
        ]
      }'

# then poll the job id it returns:
curl https://api.sociaro.com/v1/kling/generations/JOB_ID \
  -H "Authorization: Bearer $SOCIARO_API_KEY"
```

Python

```python
# Requires Python 3 and requests (pip install requests).
import os
import time
import requests

payload = {'model': 'kling/kling-2.6-i2v',
 'contents': [{'type': 'prompt',
               'text': 'a paper boat drifts down a rain-soaked street'},
              {'type': 'first_frame',
               'url': 'https://your-cdn.example.com/first.png'}]}

response = requests.post(
    'https://api.sociaro.com/v1/kling/generations',
    headers={
        'Authorization': 'Bearer ' + os.environ['SOCIARO_API_KEY'],
        'Content-Type': 'application/json',
    },
    json=payload,
    timeout=120,
)
response.raise_for_status()
submitted = response.json()
job_id = submitted['job_id']
print(submitted)

# then poll the job id it returns:
while True:
    response = requests.get(
        'https://api.sociaro.com/v1/kling/generations/' + job_id,
        headers={
            'Authorization': 'Bearer ' + os.environ['SOCIARO_API_KEY'],
        },
        timeout=120,
    )
    response.raise_for_status()
    result = response.json()
    status = result['status']
    if status == 'completed':
        break
    if status not in ('submitted', 'processing'):
        raise RuntimeError(result)
    time.sleep(5)
print(result)
```

JavaScript

```javascript
// Run as an .mjs file with Node.js 22 or later.
let jobId;
let result;

{
  const payload = {
    "model": "kling/kling-2.6-i2v",
    "contents": [
      {
        "type": "prompt",
        "text": "a paper boat drifts down a rain-soaked street"
      },
      {
        "type": "first_frame",
        "url": "https://your-cdn.example.com/first.png"
      }
    ]
  };
  
  const response = await fetch("https://api.sociaro.com/v1/kling/generations", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + process.env.SOCIARO_API_KEY,
      "Content-Type": "application/json",
    },
    body: JSON.stringify(payload),
  });
  if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
  const submitted = await response.json();
  jobId = submitted.job_id;
  console.log(submitted);
}

// then poll the job id it returns:
{
  while (true) {
    const response = await fetch("https://api.sociaro.com/v1/kling/generations/" + jobId, {
      headers: {
        "Authorization": "Bearer " + process.env.SOCIARO_API_KEY,
      },
    });
    if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
    result = await response.json();
    const status = result.status;
    if (status === "completed") break;
    if (!["submitted", "processing"].includes(status)) throw new Error(JSON.stringify(result));
    await new Promise(resolve => setTimeout(resolve, 5000));
  }
  console.log(result);
}
```

## Parameters

- `contents`
- `settings.resolution`
- `settings.duration`
- `settings.audio`
- `options.watermark_info`

The endpoint rejects unknown request fields.

## Pricing

| Billable unit and options | Rate (USD) |
| --- | --- |
| per second of video requested 720p, silent | $0.042 |
| per second of video requested 1080p, silent | $0.07 |
| per second of video requested 1080p, with sound | $0.14 |

- Billed on the length you ask for: 5 or 10 s, 5 s when it is left out.
- 720p and silent unless you ask otherwise.
- Sound or a last frame needs 1080p.

[View this model in the pricing catalogue](https://sociaro.com/pricing?model=kling%2Fkling-2.6-i2v). Your [billing logs](https://docs.sociaro.com/billing/index.md) show the actual charge for each request.
