> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.beatapi.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.beatapi.io/_mcp/server.

# Kling 3.0 Motion Control

POST https://api.beatapi.io/v1/videos/tasks
Content-Type: application/json

이미지 한 장의 인물이 3\~30초 영상 하나의 움직임을 720p 또는 1080p로 따라 하게 하고, 배경을 영상에서 가져올지 이미지에서 가져올지 고릅니다. 결과는 이미지 방향 기준 최대 10초, 영상 방향 기준 최대 30초입니다.- 비동기: 생성 호출은 작업 ID를 반환하며, 작업이 성공하면 영상이 준비됩니다.
- 두 입력 모두 필수입니다. 인물 이미지 하나와 3\~30초 길이의 동작 영상 하나입니다. 이미지 속 인물이 영상의 움직임을 따라 합니다.
- `character_orientation`은 인물의 방향을 무엇에 맞출지와 결과 길이를 정합니다. `image`(기본값)는 최대 10초, `video`는 최대 30초입니다.
- `duration` 필드는 없습니다. 결과는 선택한 방향의 제한 안에서 동작 영상 길이와 같습니다.
- 완성된 영상의 초 단위로, 720p 또는 1080p 요금이 과금되며 생성 시 보류된 금액에서 정산됩니다. 실패한 작업은 비용이 들지 않습니다.이 문서 작성 시점에 두 Kling 모션 컨트롤 모델은 실시간 `GET /v1/media/models` 목록에 없습니다. 목록에 없는 동안 작업을 만들면 `503 processing_unavailable`로 응답하며 비용은 청구되지 않습니다. 개발하기 전에 목록을 확인하세요.POST/v1/videos/tasks실행해 보기API Explorer에서 이 모델을 엽니다. BeatAPI API 키를 입력해 작업을 만드세요. 실제 호출이며 본인 잔액에서 과금됩니다.## 모델 ID두 모델이 이 엔드포인트와 같은 입력을 사용합니다. 아래 값은 게이트웨이 계약에서 그대로 가져왔으며, `background_source`는 Kling 3.0 Motion Control만 받습니다.| 모델 ID                        | `resolution`    | `character_orientation` | `background_source`          | 인물 이미지 | 동작 영상 | 이럴 때 선택하세요                                                                    |
| ---------------------------- | --------------- | ----------------------- | ---------------------------- | ------ | ----- | ----------------------------------------------------------------------------- |
| `kling-2.6-motion-control`   | `720p`, `1080p` | `image`, `video`        | —                            | 1      | 1     | 초당 가격이 더 낮은 쪽을 원하고, 동작 영상의 배경을 그대로 써도 되는 경우.                                  |
| **`kling-3-motion-control`** | `720p`, `1080p` | `image`, `video`        | `input_video`, `input_image` | 1      | 1     | 배경을 동작 영상에서 가져올지 인물 이미지에서 가져올지(`background_source`) 고르고 싶은 경우. 초당 가격이 더 높습니다. |## 엔드포인트와 인증`POST https://api.beatapi.io/v1/videos/tasks`Authorization
string
필수BeatAPI API 키를 `Bearer <BEATAPI_API_KEY>`로 보내세요. 키는 [대시보드](https://beatapi.io/dashboard)에서 만듭니다. 키는 서버에 보관하고, 브라우저나 모바일 앱에 포함하지 마세요.본문은 `Content-Type: application/json`과 함께 JSON으로 보냅니다. `Idempotency-Key`는 선택 사항입니다. 논리적 요청마다 고유한 값(최대 255자)을 보내고, 완전히 같은 본문을 재시도할 때만 다시 사용하세요. 24시간 안에 같은 키와 본문으로 재시도하면 첫 응답을 `Idempotent-Replayed: true`와 함께 다시 반환하고, 같은 키에 다른 본문을 보내면 `409 idempotency_conflict`를 반환합니다. 2xx 이외의 응답은 저장되지 않으므로 400이나 402 이후의 재시도는 다시 실행됩니다.## 요청 처리 방식아래 파라미터를 엔드포인트로 `POST`하세요. `201`은 작업이 접수되었고 가격만큼 잔액이 보류되었다는 뜻이며, 작업은 백그라운드에서 실행됩니다. `data.id`를 저장하세요.`status`가 `succeeded` 또는 `failed`가 될 때까지 `GET /v1/tasks/{task_id}`를 호출하고, 호출 사이에 `data.poll_after_seconds`만큼 기다리세요(이미지 5초, 영상 8초). 또는 `task.succeeded`와 `task.failed`에 대한 [웹훅](/webhooks)을 등록하세요. 처리 시간 초과로 중단된 작업은 이벤트를 보내지 않으므로 폴링은 대비책으로 유지하세요.`succeeded`이면 모든 `data.output.media[].url`을 다운로드해 필요한 파일을 저장하세요. BeatAPI는 결과 URL을 얼마 동안 사용할 수 있는지 보장하지 않습니다. `failed`이면 `data.error_code`와 `data.error_message`를 확인하세요. 보류된 금액은 잔액으로 돌아왔으며, `data.retryable`은 같은 요청을 다시 보내면 성공할 수 있는지 알려 줍니다.## 입력 모드| 모드    | 필수 입력                                               | 참고                                                                                                           |
| ----- | --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| 동작 전이 | `model`, `images`(링크 1개), `reference_videos`(링크 1개) | 인물 이미지가 영상의 움직임을 따라 합니다. `prompt`는 선택 사항입니다. 그 밖의 입력은 받지 않습니다. `duration`, `aspect_ratio`, 오디오, 추가 참조는 없습니다. |## 요청 파라미터model
string
필수실행할 모델입니다.**값**: `kling-3-motion-control`**값이 잘못된 경우**- 누락: `"model" is required`
- 이 엔드포인트에 이미지 모델을 보낸 경우: `"model" nano-banana-2 is served by POST /v1/images/tasks, not this endpoint`prompt
string
선택인물이나 장면에 대한 선택적 텍스트 안내입니다. 움직임 자체는 영상에서 가져옵니다.**길이**: 2500자 이하- 길이는 문자 수로 계산합니다(CJK 문자도 1자). 빈 문자열도 받습니다.**값이 잘못된 경우**- 제한보다 긴 경우: `"prompt" has an unsupported length`images
string[]
필수인물 이미지: 링크는 정확히 하나입니다. 움직임을 따라 할 인물입니다.**항목 수**: 1–1  \
각 항목은 공개 `https://` URL입니다. 로컬 파일은 `POST /v1/files`로 [먼저 업로드](/quick-guide#upload-an-input-file)한 뒤 반환된 `data.url`을 전달하세요.- 공개 HTTPS 링크 하나가 든 목록을 보내세요. 로컬 파일은 `POST /v1/files`로 업로드한 뒤 반환된 `data.url`을 여기에 쓰면 됩니다.
- 작업 생성 시 이미지 크기, 형식, 픽셀 크기는 검사하지 않습니다.**값이 잘못된 경우**- 누락: `"images" is required`
- 빈 목록: `"images" requires at least 1 item`
- 링크가 둘 이상: `"images" accepts at most 1 items`
- https\:// 링크가 아닌 경우: `"images[0]" must be a public HTTPS URL`reference_videos
string[]
필수동작 영상: 링크는 정확히 하나입니다. `images`의 인물이 이 영상의 움직임을 따라 합니다.**항목 수**: 1–1  \
각 항목은 공개 `https://` URL입니다. 로컬 파일은 `POST /v1/files`로 [먼저 업로드](/quick-guide#upload-an-input-file)한 뒤 반환된 `data.url`을 전달하세요.- 길이는 3\~30초여야 합니다(미디어 제한 참고). 결과는 `character_orientation`으로 정한 제한 안에서 이 영상 길이와 같습니다.
- 호스트가 허용하면 게이트웨이는 작업 생성 전에 바이트 범위 요청으로 파일 헤더에서 길이를 읽습니다.
- 로컬 파일은 `POST /v1/files`로 업로드하고(영상 최대 100 MB) 반환된 `data.url`을 여기에 쓰면 됩니다.생성된 영상의 초 수만큼 과금되므로 필요한 동작만 남도록 클립을 잘라 두세요. `character_orientation: "image"`에서는 결과가 최대 10초입니다.**값이 잘못된 경우**- 누락: `"reference_videos" is required`
- 빈 목록: `"reference_videos" requires at least 1 item`
- 링크가 둘 이상: `"reference_videos" accepts at most 1 items`
- https\:// 링크가 아닌 경우: `"reference_videos[0]" must be a public HTTPS URL`
- 3초보다 짧거나 30초보다 긴 경우: `reference_videos[0] is 2 seconds long; this model takes reference video of 3 to 30 seconds.`
- 호스트가 오류나 빈 파일로 응답하는 경우: `reference_videos[0] could not be downloaded: the URL returned HTTP 404.`resolution
string
선택기본값: 720p출력 해상도이자 가격 등급입니다. 1080p는 720p보다 초당 가격이 높습니다.**허용 값**: `720p`, `1080p`  \
**기본값**: `720p`- 소문자만 가능합니다. 생략하면 `720p`가 사용됩니다.**값이 잘못된 경우**- 목록에 없는 값(예: `480p`, `4k`, `1080P`): `"resolution" must be one of: [720p 1080p]`character_orientation
string
선택기본값: image인물의 방향을 인물 이미지(`image`)에 맞출지 동작 영상(`video`)에 맞출지 정합니다.**허용 값**: `image`, `video`  \
**기본값**: `image`- 결과의 최대 길이도 정합니다. `image`는 최대 10초, `video`는 최대 30초입니다(방향에 따른 길이 참고).
- 생략하면 `image`가 사용되므로, 10초보다 긴 동작 영상에는 `video`를 명시해야 합니다.
- 작업 생성 시 잔액에서 보류되는 금액도 정합니다. 방향이 허용하는 최대 길이 기준입니다(과금 참고).**값이 잘못된 경우**- 목록에 없는 값: `"character_orientation" must be one of: [image video]`background_source
string
선택기본값: input_video결과의 배경을 어디서 가져올지 정합니다. `input_video`는 동작 영상의 배경을, `input_image`는 인물 이미지의 배경을 유지합니다.**허용 값**: `input_video`, `input_image`  \
**기본값**: `input_video`- 생략하면 `input_video`가 사용됩니다.
- 이 필드는 Kling 3.0 Motion Control만 받습니다.**값이 잘못된 경우**- 목록에 없는 값: `"background_source" must be one of: [input_video input_image]`게이트웨이는 작업을 만들기 전에 다음 조합도 검사합니다.- 인물 이미지 정확히 하나와 업로드한 3\~30초 동작 영상 하나. character\_orientation image에서는 출력이 최대 10초입니다## 입력 미디어 제한게이트웨이는 작업을 만들기 전에 모든 입력을 읽고, 아래 제한을 벗어난 입력은 해당 입력을 명시한 `400 bad_request`로 거부합니다. 과금되지 않습니다.| 미디어 | 작업 생성 전에 검사하는 제한 |
| --- | ---------------- |
| 영상  | 각각 3\~30초        |- 작업 생성 시 길이 제한을 검사하는 것은 동작 영상뿐입니다. 파일 헤더로 측정하며 3\~30초, 허용 오차 0.1초입니다. 메시지에는 필드 오류처럼 0부터 센 위치로 입력이 표시됩니다: `reference_videos[0] is 45 seconds long; this model takes reference video of 3 to 30 seconds.`
- 길이를 읽을 수 없는 클립(호스트가 바이트 범위 요청을 허용하지 않거나 파일이 MP4·MOV가 아님)은 이 단계에서 거부되지 않으며 측정되지도 않습니다. 생성 호출은 호스트가 오류나 빈 파일로 응답할 때만 거부됩니다(예: `reference_videos[0] could not be downloaded: the URL returned HTTP 404.`).
- 최대 10초 클립에는 `image`를 사용하세요. 10초보다 긴 동작 영상에는 `character_orientation: "video"`를 보내세요.
- 작업 생성 시 이미지 크기, 형식, 픽셀 크기는 검사하지 않습니다.
- 로컬 파일이 있나요? `POST /v1/files`로 업로드하고(png, jpg, jpeg, webp 이미지 최대 50 MB, mp4·mov 영상 최대 100 MB) 반환된 `data.url`을 전달하세요.## 방향에 따른 길이`duration` 필드는 없습니다. 결과는 동작 영상 길이와 같으며, `character_orientation`이 상한을 정합니다.| `character_orientation` | 인물 방향 기준 | 최대 결과 길이 | 생성 시 잔액에서 보류되는 금액 |
| ----------------------- | -------- | -------- | ----------------- |
| `image`(기본값)            | 인물 이미지   | 10초      | 해상도 요금 기준 10초분    |
| `video`                 | 동작 영상    | 30초      | 해상도 요금 기준 30초분    |- 작업이 끝나면 생성된 영상에 대해 보고된 사용량으로 금액을 정산하며, 보통 길이에 정가 초당 요금을 곱한 값입니다. 보류 금액과의 차액은 반환됩니다. 사용량이 보고되지 않으면 보류 금액이 청구됩니다. 과금을 참고하세요.## 이 모델이 받지 않는 필드다음 필드를 보내면 무시되지 않고 과금 전에 거부됩니다.- `duration`, `aspect_ratio`, `generate_audio`, `seed`, `task_type`, `output_format`, `reference_images`, `reference_audios`, `quality`, `sound`, `watermark` 및 다른 영상 모델의 모든 필드 → `field "duration" is not supported by model kling-3-motion-control`(보낸 필드 포함).
- API가 전혀 모르는 필드 → `unknown field: <name>`.## 요청 예시```bash title="cURL"
curl --request POST \
  --url https://api.beatapi.io/v1/videos/tasks \
  --header "Authorization: Bearer $BEATAPI_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "kling-3-motion-control",
  "prompt": "Keep the singer’s look and outfit; follow the movement of the video.",
  "images": [
    "https://cdn.beatapi.io/samples/neon-singer.png"
  ],
  "reference_videos": [
    "https://your-cdn.example.com/clips/source.mp4"
  ],
  "resolution": "720p"
}'
``````python title="Python"
import os
import requests

response = requests.post(
    "https://api.beatapi.io/v1/videos/tasks",
    headers={"Authorization": f"Bearer {os.environ['BEATAPI_API_KEY']}"},
    json={
      "model": "kling-3-motion-control",
      "prompt": "Keep the singer’s look and outfit; follow the movement of the video.",
      "images": [
        "https://cdn.beatapi.io/samples/neon-singer.png"
      ],
      "reference_videos": [
        "https://your-cdn.example.com/clips/source.mp4"
      ],
      "resolution": "720p"
    },
    timeout=60,
)
body = response.json()
if not response.ok:
    raise RuntimeError(f"{response.status_code} {body['error']['code']}: {body['error']['message']}")
task = body["data"]
print(task["id"], task["status"])
``````javascript title="JavaScript"
const response = await fetch('https://api.beatapi.io/v1/videos/tasks', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.BEATAPI_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "model": "kling-3-motion-control",
    "prompt": "Keep the singer’s look and outfit; follow the movement of the video.",
    "images": [
      "https://cdn.beatapi.io/samples/neon-singer.png"
    ],
    "reference_videos": [
      "https://your-cdn.example.com/clips/source.mp4"
    ],
    "resolution": "720p"
  }),
});
const body = await response.json();
if (!response.ok) throw new Error(`${response.status} ${body.error.code}: ${body.error.message}`);
console.log(body.data.id, body.data.status);
```### 동작 전이영상 링크를 3\~30초 길이의 직접 준비한 MP4 또는 MOV로 바꾸세요(공개 샘플 영상은 없습니다). `character_orientation`을 생략했으므로 `image`가 적용되어 결과는 최대 10초입니다.```bash
curl --request POST \
  --url https://api.beatapi.io/v1/videos/tasks \
  --header "Authorization: Bearer $BEATAPI_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "kling-3-motion-control",
  "prompt": "Keep the singer’s look and outfit; follow the movement of the video.",
  "images": [
    "https://cdn.beatapi.io/samples/neon-singer.png"
  ],
  "reference_videos": [
    "https://your-cdn.example.com/clips/source.mp4"
  ],
  "resolution": "720p"
}'
```### 1080p, 방향은 영상 기준10초보다 긴 클립: `video`에서는 최대 30초 결과가 가능합니다. 영상 링크를 직접 준비한 클립으로 바꾸세요. 결과가 길수록 작업 생성 시 잔액에서 더 많이 보류됩니다.```bash
curl --request POST \
  --url https://api.beatapi.io/v1/videos/tasks \
  --header "Authorization: Bearer $BEATAPI_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "kling-3-motion-control",
  "images": [
    "https://cdn.beatapi.io/samples/neon-singer.png"
  ],
  "reference_videos": [
    "https://your-cdn.example.com/clips/source.mp4"
  ],
  "resolution": "1080p",
  "character_orientation": "video"
}'
```### 인물 이미지의 배경 유지결과에 동작 영상의 배경 대신 인물 이미지의 배경이 유지됩니다. 영상 링크를 직접 준비한 클립으로 바꾸세요.```bash
curl --request POST \
  --url https://api.beatapi.io/v1/videos/tasks \
  --header "Authorization: Bearer $BEATAPI_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "kling-3-motion-control",
  "images": [
    "https://cdn.beatapi.io/samples/neon-singer.png"
  ],
  "reference_videos": [
    "https://your-cdn.example.com/clips/source.mp4"
  ],
  "resolution": "720p",
  "background_source": "input_image"
}'
```## 응답### 작업 생성(201)작업 객체입니다. 작업이 성공할 때까지 `output`는 `null`입니다. '실행 중'으로 표시된 필드는 작업이 끝나면 사라집니다.```json
{
  "data": {
    "id": "task_7Qm2Xc9LpR4vT8sKa1Nf6YbH3eWdJ0uZ",
    "object": "task",
    "task_kind": "video",
    "capability_id": "kling-3-motion-control",
    "capability_version": 1,
    "media_type": "video",
    "model": "kling-3-motion-control",
    "status": "queued",
    "stage": "queued",
    "created_at": 1791993600,
    "updated_at": 1791993600,
    "completed_at": null,
    "poll_after_seconds": 8,
    "output": null,
    "usage": {
      "credits_reserved": 1.1,
      "credits_settled": 0,
      "credits_refunded": 0,
      "credits_charged": 1.1,
      "billable_duration_seconds": 10
    },
    "request_id": "req_5f0c2a9e4b7d4e31",
    "error_code": null,
    "error_message": null
  }
}
```| 필드                                     | 타입                | 설명                                                                            |
| -------------------------------------- | ----------------- | ----------------------------------------------------------------------------- |
| `data.id`                              | `string`          | 작업 ID: `task_` 뒤에 영문자와 숫자 32자가 붙습니다. 폴링과 웹훅 이벤트 매칭에 사용합니다.                    |
| `data.object`                          | `string`          | 항상 `task`.                                                                    |
| `data.task_kind`                       | `string`          | `image` 또는 `video`.                                                           |
| `data.capability_id`                   | `string`          | 보낸 모델 ID입니다.                                                                  |
| `data.capability_version`              | `integer`         | 모델의 계약 버전으로, 현재 `1`입니다.                                                       |
| `data.media_type`                      | `string`          | `image` 또는 `video`.                                                           |
| `data.model`                           | `string`          | 보낸 모델 ID입니다(`capability_id`와 같음).                                             |
| `data.status`                          | `string`          | `queued`, `processing`, `succeeded` 또는 `failed`. 마지막 두 개만 최종 상태입니다.           |
| `data.stage`                           | `string`          | `status`와 같은 값으로, 오래된 클라이언트를 위해 유지합니다.                                        |
| `data.created_at`                      | `integer`         | 작업 생성 시각(Unix 초)입니다.                                                          |
| `data.updated_at`                      | `integer`         | 마지막 변경 시각(Unix 초)입니다.                                                         |
| `data.completed_at`                    | `integer \| null` | 작업 완료 시각(Unix 초)입니다. 실행 중에는 `null`입니다.                                        |
| `data.poll_after_seconds`              | `integer`         | 실행 중: 다음 폴링까지 기다릴 시간입니다(이미지 5, 영상 8).                                         |
| `data.typical_seconds`                 | `object`          | 실행 중이며 최근 작업이 충분할 때: 최근 `window` 동안 `samples`개 작업의 `p50` 및 `p90` 완료 시간(초)입니다. |
| `data.output`                          | `object \| null`  | 결과입니다. `status`가 `succeeded`가 될 때까지 `null`입니다. 아래 출력 필드를 참고하세요.               |
| `data.usage.credits_reserved`          | `number`          | 작업 생성 시 잔액에서 보류한 USD 금액입니다.                                                   |
| `data.usage.credits_charged`           | `number`          | 이 작업의 비용(USD)입니다. 실패한 작업에서는 `0`입니다.                                           |
| `data.usage.credits_settled`           | `number`          | 최종 청구 금액(USD)입니다. 작업이 성공하면 설정되고, 그렇지 않으면 `0`입니다.                              |
| `data.usage.credits_refunded`          | `number`          | 잔액으로 환불된 금액(USD)입니다. 실패한 작업에서는 환불이 기록되면 보류 금액과 같아집니다.                         |
| `data.usage.billable_duration_seconds` | `integer`         | 영상만 해당: 가격 산정의 기준이 되는 초입니다. 모델이 길이를 보고하지 않으면 없습니다.                            |
| `data.request_id`                      | `string`          | 요청 ID입니다. 지원팀에 문의할 때 함께 알려 주세요.                                               |
| `data.error_code`                      | `string \| null`  | 실패 코드입니다. 작업이 실패하지 않았다면 `null`입니다.                                            |
| `data.error_message`                   | `string \| null`  | 무엇이 잘못되었고 무엇을 바꿔야 하는지 설명합니다. 작업이 실패하지 않았다면 `null`입니다.                         |### 완료된 작업`GET /v1/tasks/{task_id}`는 HTTP 200과 함께 `status: "succeeded"`, 그리고 `data.output`에 결과를 반환합니다.```json
{
  "data": {
    "id": "task_7Qm2Xc9LpR4vT8sKa1Nf6YbH3eWdJ0uZ",
    "object": "task",
    "task_kind": "video",
    "capability_id": "kling-3-motion-control",
    "capability_version": 1,
    "media_type": "video",
    "model": "kling-3-motion-control",
    "status": "succeeded",
    "stage": "succeeded",
    "created_at": 1791993600,
    "updated_at": 1791993690,
    "completed_at": 1791993690,
    "output": {
      "media": [
        {
          "type": "video",
          "url": "https://media.beatapi.io/outputs/task_7Qm2Xc9LpR4vT8sKa1Nf6YbH3eWdJ0uZ/0.mp4",
          "mime_type": "video/mp4"
        }
      ],
      "r2_url": "https://media.beatapi.io/outputs/task_7Qm2Xc9LpR4vT8sKa1Nf6YbH3eWdJ0uZ/0.mp4"
    },
    "usage": {
      "credits_reserved": 1.1,
      "credits_settled": 1.1,
      "credits_refunded": 0,
      "credits_charged": 1.1,
      "billable_duration_seconds": 10
    },
    "request_id": "req_5f0c2a9e4b7d4e31",
    "error_code": null,
    "error_message": null
  }
}
```#### 출력 필드| 필드                         | 타입         | 설명                                                 |
| -------------------------- | ---------- | -------------------------------------------------- |
| `output.media`             | `object[]` | 생성된 파일입니다. 이 모델은 영상 하나를 만듭니다.                      |
| `output.media[].type`      | `string`   | 항상 `video`.                                        |
| `output.media[].url`       | `string`   | 저장된 영상의 HTTPS 링크입니다. 내려받아 보관하세요. 보관 기간은 보장하지 않습니다. |
| `output.media[].mime_type` | `string`   | 저장된 영상의 MIME 형식입니다(예: `video/mp4`).                |
| `output.r2_url`            | `string`   | 이전 클라이언트를 위해 다시 넣은 영상 URL입니다. 대신 `media`를 읽으세요.    |### 실패한 작업실패한 작업도 `GET /v1/tasks/{task_id}`에서는 HTTP 200입니다. 실패 정보는 본문에 있습니다. 보류 금액이 전액 환불되므로 과금되지 않습니다.```json
{
  "data": {
    "id": "task_7Qm2Xc9LpR4vT8sKa1Nf6YbH3eWdJ0uZ",
    "object": "task",
    "task_kind": "video",
    "capability_id": "kling-3-motion-control",
    "capability_version": 1,
    "media_type": "video",
    "model": "kling-3-motion-control",
    "status": "failed",
    "stage": "failed",
    "created_at": 1791993600,
    "updated_at": 1791993690,
    "completed_at": 1791993690,
    "output": null,
    "usage": {
      "credits_reserved": 1.1,
      "credits_settled": 0,
      "credits_refunded": 1.1,
      "credits_charged": 0,
      "billable_duration_seconds": 10
    },
    "retryable": true,
    "request_id": "req_5f0c2a9e4b7d4e31",
    "error_code": "processing_failed",
    "error_message": "The task failed during processing on our side. Retry; a failed task is refunded."
  }
}
```| 필드                   | 타입        | 설명                                                                                                                                                                                           |
| -------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `data.error_code`    | `string`  | `bad_request`, `content_policy_violation`(요청 수정 필요) 또는 `processing_unavailable`, `processing_timeout`, `processing_failed`, `result_transfer_failed`(나중에 재시도) 중 하나입니다. [오류](/errors)를 참고하세요. |
| `data.error_message` | `string`  | 문제와 해결 방법을 설명하는 문장입니다.                                                                                                                                                                       |
| `data.retryable`     | `boolean` | 실패한 작업에만 있습니다. 같은 요청을 다시 보내면 성공할 수 있을 때 `true`입니다.                                                                                                                                           |
| `data.usage`         | `object`  | 환불이 기록되면(보통 작업이 실패하는 시점): `credits_charged`와 `credits_settled`는 `0`이고, `credits_refunded`는 `credits_reserved`와 같습니다.                                                                         |## 전체 예시작업을 만들고, 서버의 폴링 안내에 따라 기다린 뒤 결과 URL을 출력합니다. 환경 변수에 `BEATAPI_API_KEY`를 설정하고 `requests`를 설치하세요.```python
import os
import time
import uuid

import requests

API = "https://api.beatapi.io"
HEADERS = {"Authorization": f"Bearer {os.environ['BEATAPI_API_KEY']}"}


def create_task(body: dict) -> dict:
    # One Idempotency-Key per logical request: a retry with the same key cannot create a second task.
    headers = {**HEADERS, "Idempotency-Key": str(uuid.uuid4())}
    for attempt in range(3):
        response = requests.post(f"{API}/v1/videos/tasks", headers=headers, json=body, timeout=60)
        if response.status_code in (429, 503) and attempt < 2:
            time.sleep(int(response.headers.get("Retry-After", 10)))
            continue
        break
    try:
        payload = response.json()
    except ValueError:  # an edge error page is not JSON
        response.raise_for_status()
        raise
    if not response.ok:
        error = payload["error"]
        raise RuntimeError(f"{response.status_code} {error['code']}: {error['message']} (request_id={error.get('request_id')})")
    return payload["data"]


def wait_for_task(task_id: str, timeout_seconds: int = 1800) -> dict:
    deadline = time.monotonic() + timeout_seconds
    while time.monotonic() < deadline:
        response = requests.get(f"{API}/v1/tasks/{task_id}", headers=HEADERS, timeout=30)
        if response.status_code == 429 or response.status_code >= 500:
            time.sleep(int(response.headers.get("Retry-After", 10)))
            continue
        response.raise_for_status()
        task = response.json()["data"]
        if task["status"] in ("succeeded", "failed"):
            return task
        time.sleep(task.get("poll_after_seconds", 5))
    raise TimeoutError(f"task {task_id} is still running; keep polling later")


task = create_task({
  "model": "kling-3-motion-control",
  "prompt": "Keep the singer’s look and outfit; follow the movement of the video.",
  "images": [
    "https://cdn.beatapi.io/samples/neon-singer.png"
  ],
  "reference_videos": [
    "https://your-cdn.example.com/clips/source.mp4"
  ],
  "resolution": "720p"
})
print("created", task["id"])
task = wait_for_task(task["id"])
if task["status"] == "failed":
    raise SystemExit(f"{task['error_code']}: {task['error_message']}")
for item in task["output"]["media"]:
    print(item["url"])
```## 과금- 이 가격은 모델이 목록에 오른 뒤부터 적용됩니다. 그전까지는 생성 요청이 거부되며 비용이 청구되지 않습니다.
- 완성된 영상의 초 단위로 `resolution`에 따라 과금됩니다. `character_orientation`과 프롬프트는 요금에 영향을 주지 않습니다. 아래 표는 8초 결과 기준 가격입니다.
- 결과가 동작 영상 길이와 같으므로 작업 생성 시점에는 최종 가격을 알 수 없습니다. 게이트웨이는 방향이 허용하는 최대치(`image`는 10초, `video`는 30초)를 해상도 요금으로 보류합니다. `image`에서는 약 $1.10(720p) 또는 $1.40(1080p), `video`에서는 약 $3.30(720p) 또는 $4.20(1080p)입니다. 잔액이 이 금액을 감당하지 못하면 생성 호출이 `402 insufficient_credits`로 실패합니다.
- 작업이 끝나면 생성된 영상에 대해 보고된 사용량(보통 길이에 정가 초당 요금을 곱한 값)으로 정산하고 나머지 보류 금액은 반환합니다. 사용량이 보고되지 않으면 보류 금액이 청구됩니다. 청구 금액은 `usage.credits_charged`와 `usage.credits_settled`에 표시됩니다. 이 모델의 `usage.billable_duration_seconds`는 완성된 영상의 길이가 아니라 생성 시 보류한 초 수(10 또는 30)를 나타내므로, 실제 지불 금액은 크레딧 필드에서 확인하세요.
- 실패한 작업은 제출 후 콘텐츠 검수에서 거부된 경우를 포함해 전액 환불됩니다. 작업이 생기기 전에 거부된 요청은 비용이 들지 않습니다.현재 정가이며 [가격](https://beatapi.io/pricing) 페이지와 같습니다. 별도 할인 계약이 있는 계정은 더 적게 지불하며, 실제 청구 금액은 항상 작업의 `data.usage`에서 확인할 수 있습니다.| 옵션         | 정가(USD) |
| ---------- | ------- |
| 8초 · 720p  | \$0.88  |
| 8초 · 1080p | \$1.12  |## 자주 발생하는 오류| 오류 또는 증상                                                                                          | 원인                                                                          | 해결 방법                                                                     |
| ------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| 400 `field "duration" is not supported by model kling-3-motion-control`                           | 이 모델이 받지 않는 필드(`aspect_ratio`, `seed`, `generate_audio`, `task_type` 등 포함). | 해당 필드를 삭제하세요. 길이는 동작 영상을 따릅니다.                                            |
| 400 `"images" accepts at most 1 items` 또는 `"reference_videos" accepts at most 1 items`            | 인물 이미지나 동작 영상이 둘 이상입니다.                                                     | 각 목록에 링크를 정확히 하나씩 보내세요.                                                   |
| 400 `"reference_videos" is required`                                                              | 동작 영상이 없습니다. 이 모델에는 텍스트 전용이나 이미지 전용 모드가 없습니다.                               | `reference_videos`와 `images`에 링크를 하나씩 보내세요.                               |
| 400 `reference_videos[0] is 2 seconds long; this model takes reference video of 3 to 30 seconds.` | 동작 영상이 3초보다 짧거나 30초보다 깁니다.                                                  | 클립을 자르거나 교체하세요. 비용은 청구되지 않았습니다.                                           |
| 400 `reference_videos[0] could not be downloaded: the URL returned HTTP 404.`                     | 링크가 오류나 빈 파일로 응답합니다.                                                        | 클립을 공개 HTTPS 링크에 올리거나 `POST /v1/files`로 업로드하세요.                           |
| 400 `"resolution" must be one of: [720p 1080p]`                                                   | `480p`, `4k` 또는 `1080P` 같은 대문자.                                             | `720p` 또는 `1080p`를 보내세요.                                                  |
| 400 `"background_source" must be one of: [input_video input_image]`                               | `input_video` 또는 `input_image`가 아닌 값.                                       | 둘 중 하나를 보내거나, `input_video`로 두려면 필드를 생략하세요.                               |
| 402 `insufficient_credits`                                                                        | 잔액이 생성 시 보류 금액, 즉 방향이 허용하는 최대 결과 길이(`image`는 10초, `video`는 30초)의 금액보다 적습니다. | 충전하거나, 보류 금액이 더 적은 `character_orientation: "image"`를 최대 10초 클립과 함께 사용하세요. |
| 작업 생성 시 503 `processing_unavailable`                                                              | 현재 이 모델을 제공하지 않습니다. `GET /v1/media/models`에 없습니다.                           | 비용은 청구되지 않았습니다. 목록을 확인한 뒤 백오프를 두고 재시도하세요.                                 |
| 작업이 `content_policy_violation`과 함께 `failed`                                                       | 프롬프트, 입력 또는 결과가 콘텐츠 검수에서 거부되었습니다.                                           | 입력을 바꾸세요. 그대로 재시도하면 다시 실패하며, 비용은 청구되지 않습니다.                               |## HTTP 오류 요약작업이 생성되기 전의 오류는 2xx가 아닌 응답으로 오며 과금되지 않습니다. `error.code` 또는 `error.retryable`로 분기하세요. `message`에 문제가 표시됩니다. 전체 목록과 재시도 정책은 [오류](/errors)에 있습니다.```json
{
  "error": {
    "code": "bad_request",
    "message": "\"prompt\" is required",
    "retryable": false,
    "request_id": "req_5f0c2a9e4b7d4e31"
  }
}
```| HTTP 상태 | `error.code`                                                                                  | 조치                                                                     |
| ------- | --------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| 400     | `bad_request`, `content_policy_violation`                                                     | 요청을 수정하세요. 메시지에 해당 필드가 표시됩니다. 그대로 재시도하지 마세요.                           |
| 401     | `missing_api_key`, `invalid_api_key`(오래된 클라이언트에서는 `unauthorized`가 보일 수 있음)                    | 유효한 키를 `Authorization: Bearer <key>`로 보내세요.                            |
| 402     | `insufficient_credits`                                                                        | 충전하거나 키 한도를 올린 뒤 다시 보내세요.                                              |
| 403     | `forbidden`                                                                                   | 이 키나 계정으로는 이 모델을 사용할 수 없습니다(예: 무료 크레딧은 일부 모델만 지원). 그대로 재시도하지 마세요.      |
| 404     | `not_found`                                                                                   | `GET /v1/tasks/{task_id}`에서: 이 키의 계정에 해당 작업이 없습니다. ID를 확인하세요.          |
| 409     | `idempotency_conflict`                                                                        | 새 `Idempotency-Key`를 사용하거나, 이 키를 쓴 첫 요청이 끝날 때까지 기다리세요.                 |
| 429     | `rate_limit_exceeded`                                                                         | `Retry-After`에 표시된 시간(또는 `error.retry_after_seconds`초)만큼 기다린 뒤 재시도하세요. |
| 500     | `internal_error`                                                                              | 백오프를 적용해 재시도하고, 계속되면 `request_id`와 함께 지원팀에 문의하세요.                      |
| 503     | `processing_unavailable`, `processing_timeout`, `processing_failed`, `result_transfer_failed` | 과금되지 않았습니다. 지수 백오프를 적용해 재시도하세요.                                        |## 두 모델의 차이|                         | Kling 2.6 Motion Control   | Kling 3.0 Motion Control          |
| ----------------------- | -------------------------- | --------------------------------- |
| 입력                      | 인물 이미지 하나, 3\~30초 동작 영상 하나 | 동일                                |
| `resolution`            | `720p`, `1080p`            | 동일                                |
| `character_orientation` | `image`(기본값), `video`      | 동일                                |
| `background_source`     | 받지 않음                      | `input_video`(기본값), `input_image` |
| 초당 가격                   | 낮음                         | 높음(각 페이지의 가격표 참고)                 |

Reference: https://docs.beatapi.io/api-reference/video-api/kling-3-motion-control

## Authentication

- `Authorization` header (bearer token, required) — API 키를 `Authorization: Bearer <BEATAPI_API_KEY>`로 보내세요.

## Servers

- `https://api.beatapi.io` (Direct, default)
- `https://api.beatapi.io` (API)

## Request

### Headers

- `Idempotency-Key` (string, optional) — 본문은 `Content-Type: application/json`과 함께 JSON으로 보냅니다. `Idempotency-Key`는 선택 사항입니다. 논리적 요청마다 고유한 값(최대 255자)을 보내고, 완전히 같은 본문을 재시도할 때만 다시 사용하세요. 24시간 안에 같은 키와 본문으로 재시도하면 첫 응답을 `Idempotent-Replayed: true`와 함께 다시 반환하고, 같은 키에 다른 본문을 보내면 `409 idempotency_conflict`를 반환합니다. 2xx 이외의 응답은 저장되지 않으므로 400이나 402 이후의 재시도는 다시 실행됩니다.

### Body (application/json)

This endpoint expects a Kling3MotionControlVideoRequest.

- `images` (list of string, required) — 인물 이미지: 링크는 정확히 하나입니다. 움직임을 따라 할 인물입니다. **항목 수**: 1–1 각 항목은 공개 `https://` URL입니다. 로컬 파일은 `POST /v1/files`로 [먼저 업로드](/quick-guide#upload-an-input-file)한 뒤 반환된 `data.url`을 전달하세요. - 공개 HTTPS 링크 하나가 든 목록을 보내세요. 로컬 파일은 `POST /v1/files`로 업로드한 뒤 반환된 `data.url`을 여기에 쓰면 됩니다. - 작업 생성 시 이미지 크기, 형식, 픽셀 크기는 검사하지 않습니다. **값이 잘못된 경우** - 누락: `"images" is required` - 빈 목록: `"images" requires at least 1 item` - 링크가 둘 이상: `"images" accepts at most 1 items` - https:// 링크가 아닌 경우: `"images[0]" must be a public HTTPS URL`
- `model` (enum, required) — 실행할 모델입니다. **값**: `kling-3-motion-control` **값이 잘못된 경우** - 누락: `"model" is required` - 이 엔드포인트에 이미지 모델을 보낸 경우: `"model" nano-banana-2 is served by POST /v1/images/tasks, not this endpoint`
  - Allowed values: `kling-3-motion-control`
- `reference_videos` (list of string, required) — 동작 영상: 링크는 정확히 하나입니다. `images`의 인물이 이 영상의 움직임을 따라 합니다. **항목 수**: 1–1 각 항목은 공개 `https://` URL입니다. 로컬 파일은 `POST /v1/files`로 [먼저 업로드](/quick-guide#upload-an-input-file)한 뒤 반환된 `data.url`을 전달하세요. - 길이는 3~30초여야 합니다(미디어 제한 참고). 결과는 `character_orientation`으로 정한 제한 안에서 이 영상 길이와 같습니다. - 호스트가 허용하면 게이트웨이는 작업 생성 전에 바이트 범위 요청으로 파일 헤더에서 길이를 읽습니다. - 로컬 파일은 `POST /v1/files`로 업로드하고(영상 최대 100 MB) 반환된 `data.url`을 여기에 쓰면 됩니다. **참고**: 생성된 영상 초 수만큼 과금되므로 필요한 동작만 남도록 클립을 자르세요. `character_orientation: "image"`를 쓰면 결과는 최대 10초입니다. **값이 잘못된 경우** - 누락: `"reference_videos" is required` - 빈 목록: `"reference_videos" requires at least 1 item` - 링크가 둘 이상: `"reference_videos" accepts at most 1 items` - https:// 링크가 아닌 경우: `"reference_videos[0]" must be a public HTTPS URL` - 3초보다 짧거나 30초보다 긴 경우: `reference_videos[0] is 2 seconds long; this model takes reference video of 3 to 30 seconds.` - 호스트가 오류나 빈 파일로 응답하는 경우: `reference_videos[0] could not be downloaded: the URL returned HTTP 404.`
- `background_source` (enum, optional, default: input_video) — 결과의 배경을 어디서 가져올지 정합니다. `input_video`는 동작 영상의 배경을, `input_image`는 인물 이미지의 배경을 유지합니다. **허용 값**: `input_video`, `input_image` **기본값**: `input_video` - 생략하면 `input_video`가 사용됩니다. - 이 필드는 Kling 3.0 Motion Control만 받습니다. **값이 잘못된 경우** - 목록에 없는 값: `"background_source" must be one of: [input_video input_image]`
  - Allowed values: `input_video`, `input_image`
- `character_orientation` (enum, optional, default: image) — 인물의 방향을 인물 이미지(`image`)에 맞출지 동작 영상(`video`)에 맞출지 정합니다. **허용 값**: `image`, `video` **기본값**: `image` - 결과의 최대 길이도 정합니다. `image`는 최대 10초, `video`는 최대 30초입니다(방향에 따른 길이 참고). - 생략하면 `image`가 사용되므로, 10초보다 긴 동작 영상에는 `video`를 명시해야 합니다. - 작업 생성 시 잔액에서 보류되는 금액도 정합니다. 방향이 허용하는 최대 길이 기준입니다(과금 참고). **값이 잘못된 경우** - 목록에 없는 값: `"character_orientation" must be one of: [image video]`
  - Allowed values: `image`, `video`
- `prompt` (string, optional) — 인물이나 장면에 대한 선택적 텍스트 안내입니다. 움직임 자체는 영상에서 가져옵니다. **길이**: 2500자 이하 - 길이는 문자 수로 계산합니다(CJK 문자도 1자). 빈 문자열도 받습니다. **값이 잘못된 경우** - 제한보다 긴 경우: `"prompt" has an unsupported length`
- `resolution` (enum, optional, default: 720p) — 출력 해상도이자 가격 등급입니다. 1080p는 720p보다 초당 가격이 높습니다. **허용 값**: `720p`, `1080p` **기본값**: `720p` - 소문자만 가능합니다. 생략하면 `720p`가 사용됩니다. **값이 잘못된 경우** - 목록에 없는 값(예: `480p`, `4k`, `1080P`): `"resolution" must be one of: [720p 1080p]`
  - Allowed values: `720p`, `1080p`

## Response

### 201

작업 객체입니다. 작업이 성공할 때까지 `output`는 `null`입니다. '실행 중'으로 표시된 필드는 작업이 끝나면 사라집니다.

- `map from string to any`

## Errors

### 400 Bad Request Error

`bad_request`, `content_policy_violation` 요청을 수정하세요. 메시지에 해당 필드가 표시됩니다. 그대로 재시도하지 마세요.

- `map from string to any`

### 401 Unauthorized Error

`missing_api_key`, `invalid_api_key`(오래된 클라이언트에서는 `unauthorized`가 보일 수 있음) 유효한 키를 `Authorization: Bearer <key>`로 보내세요.

- `map from string to any`

### 402 Payment Required Error

`insufficient_credits` 충전하거나 키 한도를 올린 뒤 다시 보내세요.

- `map from string to any`

### 403 Forbidden Error

`forbidden` 이 키나 계정으로는 이 모델을 사용할 수 없습니다(예: 무료 크레딧은 일부 모델만 지원). 그대로 재시도하지 마세요.

- `map from string to any`

### 409 Conflict Error

`idempotency_conflict` 새 `Idempotency-Key`를 사용하거나, 이 키를 쓴 첫 요청이 끝날 때까지 기다리세요.

- `map from string to any`

### 429 Too Many Requests Error

`rate_limit_exceeded` `Retry-After`에 표시된 시간(또는 `error.retry_after_seconds`초)만큼 기다린 뒤 재시도하세요.

- `map from string to any`

### 500 Internal Server Error

`internal_error` 백오프를 적용해 재시도하고, 계속되면 `request_id`와 함께 지원팀에 문의하세요.

- `map from string to any`

### 503 Service Unavailable Error

`processing_unavailable`, `processing_timeout`, `processing_failed`, `result_transfer_failed` 과금되지 않았습니다. 지수 백오프를 적용해 재시도하세요.

- `map from string to any`

## Examples

### 동작 전이

**Request**

```json
{
  "images": [
    "https://cdn.beatapi.io/samples/neon-singer.png"
  ],
  "model": "kling-3-motion-control",
  "reference_videos": [
    "https://your-cdn.example.com/clips/source.mp4"
  ],
  "prompt": "Keep the singer’s look and outfit; follow the movement of the video.",
  "resolution": "720p"
}
```

**Response**

```json
{
  "data": {
    "capability_id": "kling-3-motion-control",
    "capability_version": 1,
    "completed_at": null,
    "created_at": 1791993600,
    "error_code": null,
    "error_message": null,
    "id": "task_7Qm2Xc9LpR4vT8sKa1Nf6YbH3eWdJ0uZ",
    "media_type": "video",
    "model": "kling-3-motion-control",
    "object": "task",
    "output": null,
    "poll_after_seconds": 8,
    "request_id": "req_5f0c2a9e4b7d4e31",
    "stage": "queued",
    "status": "queued",
    "task_kind": "video",
    "updated_at": 1791993600,
    "usage": {
      "billable_duration_seconds": 10,
      "credits_charged": 1.1,
      "credits_refunded": 0,
      "credits_reserved": 1.1,
      "credits_settled": 0
    }
  }
}
```

**SDK Code**

```python 동작 전이
import requests

url = "https://api.beatapi.io/v1/videos/tasks"

payload = {
    "images": ["https://cdn.beatapi.io/samples/neon-singer.png"],
    "model": "kling-3-motion-control",
    "reference_videos": ["https://your-cdn.example.com/clips/source.mp4"],
    "prompt": "Keep the singer’s look and outfit; follow the movement of the video.",
    "resolution": "720p"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript 동작 전이
const url = 'https://api.beatapi.io/v1/videos/tasks';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"images":["https://cdn.beatapi.io/samples/neon-singer.png"],"model":"kling-3-motion-control","reference_videos":["https://your-cdn.example.com/clips/source.mp4"],"prompt":"Keep the singer’s look and outfit; follow the movement of the video.","resolution":"720p"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go 동작 전이
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.beatapi.io/v1/videos/tasks"

	payload := strings.NewReader("{\n  \"images\": [\n    \"https://cdn.beatapi.io/samples/neon-singer.png\"\n  ],\n  \"model\": \"kling-3-motion-control\",\n  \"reference_videos\": [\n    \"https://your-cdn.example.com/clips/source.mp4\"\n  ],\n  \"prompt\": \"Keep the singer’s look and outfit; follow the movement of the video.\",\n  \"resolution\": \"720p\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby 동작 전이
require 'uri'
require 'net/http'

url = URI("https://api.beatapi.io/v1/videos/tasks")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"images\": [\n    \"https://cdn.beatapi.io/samples/neon-singer.png\"\n  ],\n  \"model\": \"kling-3-motion-control\",\n  \"reference_videos\": [\n    \"https://your-cdn.example.com/clips/source.mp4\"\n  ],\n  \"prompt\": \"Keep the singer’s look and outfit; follow the movement of the video.\",\n  \"resolution\": \"720p\"\n}"

response = http.request(request)
puts response.read_body
```

```java 동작 전이
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.beatapi.io/v1/videos/tasks")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"images\": [\n    \"https://cdn.beatapi.io/samples/neon-singer.png\"\n  ],\n  \"model\": \"kling-3-motion-control\",\n  \"reference_videos\": [\n    \"https://your-cdn.example.com/clips/source.mp4\"\n  ],\n  \"prompt\": \"Keep the singer’s look and outfit; follow the movement of the video.\",\n  \"resolution\": \"720p\"\n}")
  .asString();
```

```php 동작 전이
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.beatapi.io/v1/videos/tasks', [
  'body' => '{
  "images": [
    "https://cdn.beatapi.io/samples/neon-singer.png"
  ],
  "model": "kling-3-motion-control",
  "reference_videos": [
    "https://your-cdn.example.com/clips/source.mp4"
  ],
  "prompt": "Keep the singer’s look and outfit; follow the movement of the video.",
  "resolution": "720p"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp 동작 전이
using RestSharp;

var client = new RestClient("https://api.beatapi.io/v1/videos/tasks");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"images\": [\n    \"https://cdn.beatapi.io/samples/neon-singer.png\"\n  ],\n  \"model\": \"kling-3-motion-control\",\n  \"reference_videos\": [\n    \"https://your-cdn.example.com/clips/source.mp4\"\n  ],\n  \"prompt\": \"Keep the singer’s look and outfit; follow the movement of the video.\",\n  \"resolution\": \"720p\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift 동작 전이
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "images": ["https://cdn.beatapi.io/samples/neon-singer.png"],
  "model": "kling-3-motion-control",
  "reference_videos": ["https://your-cdn.example.com/clips/source.mp4"],
  "prompt": "Keep the singer’s look and outfit; follow the movement of the video.",
  "resolution": "720p"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.beatapi.io/v1/videos/tasks")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### 1080p, 방향은 영상 기준

**Request**

```json
{
  "images": [
    "https://cdn.beatapi.io/samples/neon-singer.png"
  ],
  "model": "kling-3-motion-control",
  "reference_videos": [
    "https://your-cdn.example.com/clips/source.mp4"
  ],
  "character_orientation": "video",
  "resolution": "1080p"
}
```

**Response**

```json
{
  "data": {
    "capability_id": "kling-3-motion-control",
    "capability_version": 1,
    "completed_at": null,
    "created_at": 1791993600,
    "error_code": null,
    "error_message": null,
    "id": "task_7Qm2Xc9LpR4vT8sKa1Nf6YbH3eWdJ0uZ",
    "media_type": "video",
    "model": "kling-3-motion-control",
    "object": "task",
    "output": null,
    "poll_after_seconds": 8,
    "request_id": "req_5f0c2a9e4b7d4e31",
    "stage": "queued",
    "status": "queued",
    "task_kind": "video",
    "updated_at": 1791993600
  }
}
```

**SDK Code**

```python 1080p, 방향은 영상 기준
import requests

url = "https://api.beatapi.io/v1/videos/tasks"

payload = {
    "images": ["https://cdn.beatapi.io/samples/neon-singer.png"],
    "model": "kling-3-motion-control",
    "reference_videos": ["https://your-cdn.example.com/clips/source.mp4"],
    "character_orientation": "video",
    "resolution": "1080p"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript 1080p, 방향은 영상 기준
const url = 'https://api.beatapi.io/v1/videos/tasks';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"images":["https://cdn.beatapi.io/samples/neon-singer.png"],"model":"kling-3-motion-control","reference_videos":["https://your-cdn.example.com/clips/source.mp4"],"character_orientation":"video","resolution":"1080p"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go 1080p, 방향은 영상 기준
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.beatapi.io/v1/videos/tasks"

	payload := strings.NewReader("{\n  \"images\": [\n    \"https://cdn.beatapi.io/samples/neon-singer.png\"\n  ],\n  \"model\": \"kling-3-motion-control\",\n  \"reference_videos\": [\n    \"https://your-cdn.example.com/clips/source.mp4\"\n  ],\n  \"character_orientation\": \"video\",\n  \"resolution\": \"1080p\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby 1080p, 방향은 영상 기준
require 'uri'
require 'net/http'

url = URI("https://api.beatapi.io/v1/videos/tasks")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"images\": [\n    \"https://cdn.beatapi.io/samples/neon-singer.png\"\n  ],\n  \"model\": \"kling-3-motion-control\",\n  \"reference_videos\": [\n    \"https://your-cdn.example.com/clips/source.mp4\"\n  ],\n  \"character_orientation\": \"video\",\n  \"resolution\": \"1080p\"\n}"

response = http.request(request)
puts response.read_body
```

```java 1080p, 방향은 영상 기준
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.beatapi.io/v1/videos/tasks")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"images\": [\n    \"https://cdn.beatapi.io/samples/neon-singer.png\"\n  ],\n  \"model\": \"kling-3-motion-control\",\n  \"reference_videos\": [\n    \"https://your-cdn.example.com/clips/source.mp4\"\n  ],\n  \"character_orientation\": \"video\",\n  \"resolution\": \"1080p\"\n}")
  .asString();
```

```php 1080p, 방향은 영상 기준
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.beatapi.io/v1/videos/tasks', [
  'body' => '{
  "images": [
    "https://cdn.beatapi.io/samples/neon-singer.png"
  ],
  "model": "kling-3-motion-control",
  "reference_videos": [
    "https://your-cdn.example.com/clips/source.mp4"
  ],
  "character_orientation": "video",
  "resolution": "1080p"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp 1080p, 방향은 영상 기준
using RestSharp;

var client = new RestClient("https://api.beatapi.io/v1/videos/tasks");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"images\": [\n    \"https://cdn.beatapi.io/samples/neon-singer.png\"\n  ],\n  \"model\": \"kling-3-motion-control\",\n  \"reference_videos\": [\n    \"https://your-cdn.example.com/clips/source.mp4\"\n  ],\n  \"character_orientation\": \"video\",\n  \"resolution\": \"1080p\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift 1080p, 방향은 영상 기준
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "images": ["https://cdn.beatapi.io/samples/neon-singer.png"],
  "model": "kling-3-motion-control",
  "reference_videos": ["https://your-cdn.example.com/clips/source.mp4"],
  "character_orientation": "video",
  "resolution": "1080p"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.beatapi.io/v1/videos/tasks")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### 인물 이미지의 배경 유지

**Request**

```json
{
  "images": [
    "https://cdn.beatapi.io/samples/neon-singer.png"
  ],
  "model": "kling-3-motion-control",
  "reference_videos": [
    "https://your-cdn.example.com/clips/source.mp4"
  ],
  "background_source": "input_image",
  "resolution": "720p"
}
```

**Response**

```json
{
  "data": {
    "capability_id": "kling-3-motion-control",
    "capability_version": 1,
    "completed_at": null,
    "created_at": 1791993600,
    "error_code": null,
    "error_message": null,
    "id": "task_7Qm2Xc9LpR4vT8sKa1Nf6YbH3eWdJ0uZ",
    "media_type": "video",
    "model": "kling-3-motion-control",
    "object": "task",
    "output": null,
    "poll_after_seconds": 8,
    "request_id": "req_5f0c2a9e4b7d4e31",
    "stage": "queued",
    "status": "queued",
    "task_kind": "video",
    "updated_at": 1791993600
  }
}
```

**SDK Code**

```python 인물 이미지의 배경 유지
import requests

url = "https://api.beatapi.io/v1/videos/tasks"

payload = {
    "images": ["https://cdn.beatapi.io/samples/neon-singer.png"],
    "model": "kling-3-motion-control",
    "reference_videos": ["https://your-cdn.example.com/clips/source.mp4"],
    "background_source": "input_image",
    "resolution": "720p"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript 인물 이미지의 배경 유지
const url = 'https://api.beatapi.io/v1/videos/tasks';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"images":["https://cdn.beatapi.io/samples/neon-singer.png"],"model":"kling-3-motion-control","reference_videos":["https://your-cdn.example.com/clips/source.mp4"],"background_source":"input_image","resolution":"720p"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go 인물 이미지의 배경 유지
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.beatapi.io/v1/videos/tasks"

	payload := strings.NewReader("{\n  \"images\": [\n    \"https://cdn.beatapi.io/samples/neon-singer.png\"\n  ],\n  \"model\": \"kling-3-motion-control\",\n  \"reference_videos\": [\n    \"https://your-cdn.example.com/clips/source.mp4\"\n  ],\n  \"background_source\": \"input_image\",\n  \"resolution\": \"720p\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby 인물 이미지의 배경 유지
require 'uri'
require 'net/http'

url = URI("https://api.beatapi.io/v1/videos/tasks")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"images\": [\n    \"https://cdn.beatapi.io/samples/neon-singer.png\"\n  ],\n  \"model\": \"kling-3-motion-control\",\n  \"reference_videos\": [\n    \"https://your-cdn.example.com/clips/source.mp4\"\n  ],\n  \"background_source\": \"input_image\",\n  \"resolution\": \"720p\"\n}"

response = http.request(request)
puts response.read_body
```

```java 인물 이미지의 배경 유지
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.beatapi.io/v1/videos/tasks")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"images\": [\n    \"https://cdn.beatapi.io/samples/neon-singer.png\"\n  ],\n  \"model\": \"kling-3-motion-control\",\n  \"reference_videos\": [\n    \"https://your-cdn.example.com/clips/source.mp4\"\n  ],\n  \"background_source\": \"input_image\",\n  \"resolution\": \"720p\"\n}")
  .asString();
```

```php 인물 이미지의 배경 유지
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.beatapi.io/v1/videos/tasks', [
  'body' => '{
  "images": [
    "https://cdn.beatapi.io/samples/neon-singer.png"
  ],
  "model": "kling-3-motion-control",
  "reference_videos": [
    "https://your-cdn.example.com/clips/source.mp4"
  ],
  "background_source": "input_image",
  "resolution": "720p"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp 인물 이미지의 배경 유지
using RestSharp;

var client = new RestClient("https://api.beatapi.io/v1/videos/tasks");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"images\": [\n    \"https://cdn.beatapi.io/samples/neon-singer.png\"\n  ],\n  \"model\": \"kling-3-motion-control\",\n  \"reference_videos\": [\n    \"https://your-cdn.example.com/clips/source.mp4\"\n  ],\n  \"background_source\": \"input_image\",\n  \"resolution\": \"720p\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift 인물 이미지의 배경 유지
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "images": ["https://cdn.beatapi.io/samples/neon-singer.png"],
  "model": "kling-3-motion-control",
  "reference_videos": ["https://your-cdn.example.com/clips/source.mp4"],
  "background_source": "input_image",
  "resolution": "720p"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.beatapi.io/v1/videos/tasks")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```