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

# GPT Image 1

> GPT Image 1：根據提示詞生成圖片，或編輯現有圖片。生成和編輯使用不同端點。

根據提示詞生成圖片，或編輯現有圖片。生成和編輯使用不同端點。

`POST /v1/images/generations`

## 快速範例

執行前請設定 `MIXROUTE_API_KEY`。

```bash theme={null}
curl --request POST 'https://api.mixroute.ai/v1/images/generations' \
  --header "Authorization: Bearer $MIXROUTE_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "gpt-image-1",
  "prompt": "A red ceramic mug on a white table.",
  "size": "1024x1024",
  "n": 1
}'
```

解碼 `data[].b64_json` 以儲存生成圖片。

## 參數與限制

| 欄位 | 說明 |
| - | - |
| `model` | `gpt-image-1`. 請填寫範例中的完整模型 ID。 |
| `prompt` | 描述要生成的圖片。 |
| `size` | 使用 `1024x1024` 等標準尺寸，或 `auto`。 |
| `n` | 要求生成的圖片張數；範例輸出一張。 |

## API 參考

* [GPT Image 圖片生成](https://mixroute.ai/docs/zh-Hant/api-reference/endpoint/gpt-image.md)
* [GPT Image 圖片編輯](https://mixroute.ai/docs/zh-Hant/api-reference/endpoint/gpt-image-edit.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.