# 知格科技 API 文档

通过统一的 API 接入对话、图片与视频生成，可用于应用开发及智能体工具对接。

- 文档地址：[API 文档](https://zhigekeji.com/docs)
- Base URL：`https://zhigekeji.com/api/v1`
- 认证方式：`Authorization: Bearer <API_KEY>`
- JSON 请求使用 `Content-Type: application/json`
- 在[控制台创建 API Key](https://zhigekeji.com/console/api-keys)，示例中的密钥和素材地址均需自行替换。

## 异步图片生成

适用于需要批量生成或对响应时间不敏感的场景。接口立即返回 `task_id`，图片生成在后台异步执行，通过状态查询接口获取结果。

```http
POST https://zhigekeji.com/api/v1/images/generations/async
Authorization: Bearer sk-xxxx...
Content-Type: application/json

{
  "model": "ernie-image",
  "prompt": "保持人物特征，将背景改为雪山",
  "images": [
    "https://example.com/reference.jpg"
  ],
  "size": "768x1344"
}
```

请求参数与同步接口相同，立即返回：

```json
{
  "created": 1716652800,
  "task_id": "42",
  "status": "pending",
  "object": "image_generation.task"
}
```
