---
title: "Expand an image with Kling"
method: POST
path: "/kling/v1/images/editing/expand"
---

# Expand an image with Kling

`POST /kling/v1/images/editing/expand`

## Headers

- `Content-Type` string

## Request body

- object
  - `image` string, required — Source image to expand. Image URL or raw Base64 string without a `data:` prefix. Supported formats: JPG, JPEG, PNG. Maximum 10 MB, minimum 300x300 px, aspect ratio between 1:2.5 and 2.5:1.
  - `up_expansion_ratio` number, required — Upward expansion ratio as a multiple of the original image dimension. Range: 0-2. Send `0` for sides you do not want to expand.
  - `down_expansion_ratio` number, required — Downward expansion ratio as a multiple of the original image dimension. Range: 0-2. Send `0` for sides you do not want to expand.
  - `left_expansion_ratio` number, required — Leftward expansion ratio as a multiple of the original image dimension. Range: 0-2. Send `0` for sides you do not want to expand.
  - `right_expansion_ratio` number, required — Rightward expansion ratio as a multiple of the original image dimension. Range: 0-2. Send `0` for sides you do not want to expand.
  - `prompt` string — Optional text prompt to guide the expanded area content. Maximum 2500 characters.
  - `n` integer — Number of expanded images to generate. Range: 1-9.
  - `watermark_info` object — Watermark options.
    - `enabled` boolean
  - `callback_url` string — Webhook URL for task status notifications.
  - `external_task_id` string — Optional user-defined task ID for your own tracking. Must be unique per account.

## Response `200`

Task request accepted or an error response returned by the API.

- object
  - `code` union, required — Response code. `0` means the task request was accepted.
    - integer
    - string
  - `message` string, required — Response message.
  - `request_id` string — Request identifier returned when present.
  - `data` object, required
    - `task_id` string, required — System-generated task ID.
    - `task_status` 'submitted' | 'processing' | 'succeed' | 'failed', required — Task status.
    - `task_status_msg` string, nullable — Task status detail when present.
    - `task_info` object
      - `external_task_id` string, nullable — Caller-provided external task ID when supplied.
    - `task_result` object, nullable — Task result payload after the task completes.
    - `created_at` integer, required — Task creation time as a Unix timestamp in milliseconds.
    - `updated_at` integer, required — Task update time as a Unix timestamp in milliseconds.

---

[API](https://skmtc.net/cometapi/apis/create-api-key.md) · [All operations](https://skmtc.net/cometapi/apis/create-api-key/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/cometapi/create-api-key/revisions/0863102dbf34/schema)
