> ## 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.

# CogView-4

CogView-4 是智谱首个支持生成汉字的开源文生图模型，在语义理解、图像生成质量、中英文字生成能力等方面全面提升，支持任意长度的中英双语输入，能够生成在给定范围内的任意分辨率图像。

### 模型参数

* 模型ID：`cogview-4`
* 模型价格：你可以在[模型广场](https://geekai.co/models?platform=bigmodel\&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 中的以下参数：

  * `image`
  * `strength`
  * `aspect_ratio`
  * `style_preset`
  * `response_format`
  * `output_format`
  * `mask`
  * `background`

  附：[CogView-4 官方 API 文档](https://docs.bigmodel.cn/cn/guide/models/image-generation/cogview-4)
</Note>

CogView-4 可以通过 `size` 字段实现输出图像的尺寸：

推荐枚举值：1024x1024 (默认), 768x1344, 864x1152, 1344x768, 1152x864, 1440x720, 720x1440，也可以自定义参数：长宽均需满足512px-2048px之间，需被16整除，并保证最大像素数不超过2^21px。

```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": "cogview-4",
    "prompt": "画一只小兔子",
    "size": "1024x1024",
    "quality": "hd",
    "watermark": false
}'
```

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

```json theme={null}
{
    "model": "cogview-4",
    "created": 1768283267,
    "task_id": "df16c905-ca9c-46e7-8048-b6cbaa109ef5",
    "task_status": "succeed",
    "data": [
        {
            "url": "https://static.geekai.co/image/2026/01/13/1ccfa836c78bed1025b7ef52431866f7.jpeg"
        }
    ]
}
```
