> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anyfast.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Kling 3.0

> Use Kling 3.0 through AnyFast's upgraded v2 text-to-video and image-to-video APIs.

Kling 3.0 uses model-specific Kling v2 creation paths. The model is selected in the URL; do not send `model_name`.
Output resolution supports `720p`, `1080p`, and `4k` through `settings.resolution`.

## Capabilities

* **Text to video** — Generate 3–15 second videos with optional multi-shot prompt formatting.
* **Image to video** — Animate a first frame, with optional middle or last keyframes where supported.
* **Task query** — Query all v2 creation tasks through one endpoint.

| Capability | Endpoint | Main input |
| - | - | - |
| Text to video | `POST /kling/v2/text-to-video/kling-3.0` | `prompt` |
| Image to video | `POST /kling/v2/image-to-video/kling-3.0` | `contents` |
| Query task | `GET /kling/v2/tasks?task_ids=TASK_ID` | System task ID |

## Text to video

```bash cURL theme={null}
curl --request POST \
  --url https://www.anyfast.ai/kling/v2/text-to-video/kling-3.0 \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "prompt": "A cat walks through a field of sunflowers at golden hour",
    "settings": {"resolution": "720p", "duration": 3, "aspect_ratio": "16:9"}
  }'
```

For multi-shot generation, format the prompt with one `Shot n, duration, description;` segment per shot. The shot durations must add up to `settings.duration`.

## Image to video

```bash cURL theme={null}
curl --request POST \
  --url https://www.anyfast.ai/kling/v2/image-to-video/kling-3.0 \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "contents": [
      {"type": "prompt", "text": "The person smiles and waves to the camera"},
      {"type": "first_frame", "url": "https://example.com/photo.jpg"}
    ],
    "settings": {"resolution": "720p", "duration": 3}
  }'
```

The v2 create response returns `data.id` with an initial `submitted` status. Poll `GET /kling/v2/tasks?task_ids=TASK_ID` and read the video from `data[].outputs[]` after success.

> [!NOTE]
>
> Use `settings.resolution`, `settings.duration`, and `settings.aspect_ratio`. Do not send Legacy `model_name`, `mode`, top-level `duration`, or `image` fields.

## Additional Kling 3.0 controls

### Storyboards, sound, and voices

A multi-shot prompt contains one `Shot n, duration, description;` segment per shot. Use one to six shots, keep each shot at least one second, and make the total equal to `settings.duration`. When the channel supports synchronized sound, enable it in the supported options. Voice references use up to two `voice_id` values from Voice Management and must be referenced in prompt order.

### Camera control and motion brush

Camera control supports preset movements and a `simple` configuration with `horizontal`, `vertical`, `pan`, `tilt`, `roll`, or `zoom`. Image-to-video can use a static mask or up to six dynamic masks; each dynamic trajectory contains 2–77 coordinates for a 5-second video. End-frame input, motion brush, and camera control are mutually exclusive. Elements and voice references cannot be combined in the same request.

### Motion control

Motion control uses a character image and an MP4 or MOV reference video. The image must show a clear upper or full body. The reference video must be at least 3 seconds; the maximum is 10 seconds with image orientation and 30 seconds with video orientation. Complex motion can produce a shorter result when only a continuous usable segment can be extracted.

> [card] [Kling 3.0 API reference](https://docs.anyfast.ai/api-reference/model-api/kling/kling-3.0.md)
>
> View the v2 request and response fields.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.