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

# 图像

> 使用 Images API 生成或编辑图片。

<Info>
  你可以用 OpenAI 兼容接口调用图片生成与编辑接口。
  你需要先在 **Console** 创建 **API key**。
</Info>

<CardGroup cols={2}>
  <Card title="获取 API key" icon="key" href="/faq/token-management">
    在 **Console** 复制 key。
  </Card>

  <Card title="模型列表" icon="list" href="/api-reference/models">
    先确认 `model` 该填哪个 id。
  </Card>
</CardGroup>

## 文生图（generations）

* **接口地址**：`POST https://api.yelinai.com/v1/images/generations`

```bash theme={"system"}
curl https://api.yelinai.com/v1/images/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "gpt-4o-image",
    "prompt": "A serene Japanese garden with cherry blossoms",
    "size": "1024x1024"
  }'
```

## 图像编辑（edits）

* **接口地址**：`POST https://api.yelinai.com/v1/images/edits`

<Note>
  不同模型对编辑参数支持不同。
  你先用最小示例跑通再扩展参数。
</Note>
