# 官转图像模型

官转图像模型的文生图和图生图调用。

不要传 `response_format`。结果读 `data[0].url`。

模型：`gpt-image-2-t`、`gpt-image-2.5-flare-t`、`gpt-image-2.5-sunburst-t`、`gpt-image-2.6-flare-t`、`gpt-image-2.6-sunburst-t`。

## 文生图

```bash
curl https://kaienapi.com/v1/images/generations \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2-t",
    "prompt": "A small red paper boat on calm blue water, no text",
    "size": "1024x1024",
    "n": 1
  }'
```

## 图生图

同样调用 `POST /v1/images/generations`。`image` 里放你自己的公网图片 URL。

```bash
curl https://kaienapi.com/v1/images/generations \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2.6-flare-t",
    "prompt": "Keep the same subject. Place a small yellow rubber duck beside it. No text.",
    "image": [
      "https://example.com/reference.png"
    ],
    "size": "1024x1024",
    "n": 1
  }'
```

多张参考图按顺序放进同一个数组，在 prompt 里说明每张图的用途：

```bash
curl https://kaienapi.com/v1/images/generations \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2.6-flare-t",
    "prompt": "Keep the subject from image 1. Use the outfit from image 2.",
    "image": [
      "https://example.com/subject.png",
      "https://example.com/outfit.png"
    ],
    "size": "1024x1024",
    "n": 1
  }'
```
