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

# 可灵画图 v1

### 模型参数

* 模型ID：`kling-image-v1`/`kling-image-v1-5`
* 模型价格：你可以在[模型广场](https://geekai.co/models?platform=kling\&type=image)查看最新价格信息
* 调用入口：`https://geekai.co/api/v1/images/generations`
* 模型参数：参考[画图 API 手册](https://docs.geekai.co/cn/api/image/generations)
* API认证：[获取 API KEY](https://docs.geekai.co/cn/docs/quick_start)

<Note>
  不支持画图公共 API 中的以下参数：

  * `size`
  * `seed`
  * `quality`
  * `style_preset`
  * `response_format`
  * `output_format`
  * `mask`
  * `watermark`
  * `background`

  附：[可灵画图 v1 官方 API 文档](https://app.klingai.com/cn/dev/document-api/apiReference/model/imageGeneration)
</Note>

`kling-image-v1`对应支持的`aspect_ratio`包括： 1:1，16:9，4:3，3:2，2:3，3:4，9:16
`kling-image-v1-5`对应支持的`aspect_ratio`包括： 1:1，16:9，4:3，3:2，2:3，3:4，9:16，21:9

同样，参考图像也支持传入图片Base64编码，直接在image里面传入图片Base64编码即可，但是请不要在Base64编码字符串前添加任何前缀，例如data:image/png;base64,。正确的参数格式应该直接是Base64编码后的字符串。
可以使用`strength`来替代官方的`image_fidelity`参数，取值范围：\[0,1]，数值越大参考强度越大

### 文生图

通过文字描述来生成对应图像：

```bash theme={null}
curl --location --request POST 'https://geekai.co/api/v1/images/generations' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--data '{
    "model":"kling-image-v1",
    "prompt": "画一只可爱的小猫",
    "negative_prompt": "低质量",
    "aspect_ratio": "16:9",
    "n": 2
}'
```

### 图生图

```bash theme={null}
curl --location --request POST 'https://geekai.co/api/v1/images/generations' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--data '{
    "model":"kling-image-v1",
    "prompt":"修复这张破损的照片",
    "image":"https://static.geekai.co/storage/2025/04/02/broken-picture.jpg",
    "negative_prompt": "低质量",
    "aspect_ratio": "16:9"
}'
```

响应是一个 JSON 对象，包含生成图片的 URL：

```json theme={null}
{
    "model": "kling-image-v1",
    "created": 1768455363,
    "task_id": "a6c11baf-2e26-4710-b20c-f8f4e6fae319",
    "task_status": "succeed",
    "data": [
        {
            "url": "https://static.geekai.co/image/2026/01/15/8a6b49a664bb8b7cc97dd84d9de53aea.png"
        }
    ]
}
```
