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

# Kling V2.1 Standard

Generate videos from a source image using the `kling/v2-1-standard` model.

## Authentication

All API requests require a Bearer Token.

```http theme={null}
Authorization: Bearer YOUR_API_KEY
```

## Create a Video Task

Submit an image-to-video generation task using:

```http theme={null}
POST /api/v1/jobs/createTask
```

## Request Body

| Field   | Type   | Required | Description                                                   |
| ------- | ------ | -------- | ------------------------------------------------------------- |
| `model` | string | Yes      | The model used for generation. Must be `kling/v2-1-standard`. |
| `input` | object | Yes      | Input parameters for the video generation task.               |

<ParamField body="model" type="string" required>
  Must be `kling/v2-1-standard`.
</ParamField>

<ParamField body="input" type="object" required>
  ## Input Parameters

  The `input` object contains the parameters used to generate the video.

  <ParamField body="prompt" type="string" required>
    Use `prompt` to describe the video you want to generate.

    **Maximum length:** `5000` characters.
  </ParamField>

  <ParamField body="image_url" type="string" required>
    Use `image_url` to provide the URL of the image used as the source for the generated video.

    Supported image formats:

    * `image/jpeg`
    * `image/png`

    Maximum file size: `10 MB`
  </ParamField>

  <ParamField body="duration" type="string">
    Use `duration` to specify the length of the generated video.

    Supported values:

    * `"5"`
    * `"10"`

    Default value: `"5"`
  </ParamField>

  <ParamField body="negative_prompt" type="string">
    Use `negative_prompt` to describe elements you want to avoid in the generated video.

    **Maximum length:** `500` characters.
  </ParamField>

  <ParamField body="cfg_scale" type="string">
    The `cfg_scale` parameter controls how closely the model follows your prompt.

    | Setting | Value |
    | ------- | ----- |
    | Minimum | `0`   |
    | Maximum | `1`   |
    | Step    | `0.1` |
    | Default | `0.5` |
  </ParamField>
</ParamField>

## Example Request

```json theme={null}
{
  "model": "kling/v2-1-standard",
  "input": {
    "prompt": "Begin with the uploaded image as the first frame. Gradually animate the scene: steam rises and drifts upward from the train; lantern lights flicker subtly; cloaked figures begin to move slowly — walking, turning, adjusting their belongings. Floating dust or magical particles catch the light.",
    "image_url": "https:///17552565961692.png",
    "duration": "5",
    "negative_prompt": "blur, distort, and low quality",
    "cfg_scale": 0.5
  }
}
```

## Response

### Successful Response

A successful request returns a task ID.

<ResponseField name="code" type="number">
  Response status code.
</ResponseField>

<ResponseField name="msg" type="string">
  Response message. Contains the error description when the request fails.

  **Example:** `success`
</ResponseField>

<ResponseField name="data" type="object" required>
  The task data object containing task id.

  <ResponseField name="taskId" type="string" required>
    The unique identifier for this task.

    **Example:** `task_123456`
  </ResponseField>
</ResponseField>

Use the returned `taskId` with the task details endpoint to check generation progress and retrieve the final results.

<Card title="Get Task Details" icon="search" href="/market/common/get-task-detail">
  Learn how to query task status and retrieve generation results.
</Card>

### Error Response

```json theme={null}
{
  "code": 500,
  "msg": "Server Error - An unexpected error occurred while processing the request",
  "data": null
}
```

## Response Codes

|  Code | Meaning                                                                   |
| ----: | ------------------------------------------------------------------------- |
| `200` | Success — the request was successfully processed.                         |
| `401` | Unauthorized — authentication credentials are missing or invalid.         |
| `402` | Insufficient Credits — the account does not have enough credits.          |
| `404` | Not Found — the requested resource or interface does not exist.           |
| `408` | Upstream service issue — no result has been returned for over 10 minutes. |
| `422` | Validation Error — request parameters failed validation.                  |
| `429` | Rate Limited — request frequency limit has been exceeded.                 |
| `433` | Request Limit — sub-key usage exceeded the limit.                         |
| `455` | Service Unavailable — system is undergoing maintenance.                   |
| `500` | Server Error — an unexpected error occurred while processing the request. |
| `501` | Generation Failed — content generation failed.                            |
| `505` | Feature Disabled — the requested feature is disabled.                     |
