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

# 附录：Images API

> FocusAPI Images API 附录参考：POST /v1/images/generations 路径、常见字段、返回结果、异步任务和错误处理。

FocusAPI 支持多种图像能力，具体可用模型与路径以 **模型广场** 为准。新用户请优先阅读 [图像生成](/models/image-generation)，本页作为接口附录。

## OpenAI 兼容图像生成（常见）

```http theme={null}
POST /v1/images/generations
```

### 示例

```bash theme={null}
curl https://www.focusapi.cn/v1/images/generations \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "dall-e-3",
    "prompt": "A minimal blue icon of a cloud",
    "n": 1,
    "size": "1024x1024"
  }'
```

将 `model` 替换为平台上架的图片模型 ID。

## 请求注意点

| 项目                 | 说明                             |
| ------------------ | ------------------------------ |
| 模型名                | 必须与模型广场一致                      |
| `size` / `quality` | 部分模型仅支持特定尺寸，以模型文档为准            |
| 异步任务               | 部分视频/图像厂商为异步任务，需轮询任务 ID（见模型说明） |

## 错误与限流

* 余额不足、模型不可用 → 查看响应 body 中的 `message` 或 `error` 字段
* [429 限流](/errors/429)
* 生成时间过长 → [524 超时](/errors/524)

## 相关文档

* [图像生成](/models/image-generation)
* [多模态理解](/models/multimodal)
* [视频生成](/models/video-generation)
