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

# Grok Imagine Image

> Grok Imagine Image：圖片生成模型。包含 MixRoute 呼叫範例與參數。

Grok Imagine Image 是 xAI 推出的圖片生成模型。

可使用下方端點透過 MixRoute 呼叫 `grok-imagine-image`。

## 核心能力

* 文字生成圖片 - 根據自然語言提示詞生成圖片
* 輸出控制 - 設定尺寸與品質
* Images API - 使用 /v1/images/generations

## 輸出規格

| 屬性     | 取值                       |
| ------ | ------------------------ |
| 生成端點   | `/v1/images/generations` |
| 範例尺寸   | `1024x1024`              |
| 單次生成數量 | `n`                      |

## 快速範例

<Tabs>
  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.mixroute.ai/v1/images/generations" \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
      "model": "grok-imagine-image",
      "prompt": "A minimal red circle centered on a white background",
      "size": "1024x1024",
      "n": 1
    }'
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    import requests

    response = requests.post(
        "https://api.mixroute.ai/v1/images/generations",
        headers={"Authorization": "Bearer YOUR_API_KEY"},
        json={'model': 'grok-imagine-image',
              'prompt': 'A minimal red circle centered on a white background',
              'size': '1024x1024',
              'n': 1},
    )

    print(response.json())
    ```
  </Tab>
</Tabs>

## 參數

| 參數        | 類型      | 必填 | 說明                        |
| --------- | ------- | -- | ------------------------- |
| `model`   | string  | 是  | 固定為 `grok-imagine-image`。 |
| `prompt`  | string  | 是  | 需要生成圖片的文字描述。              |
| `n`       | integer | 否  | 生成圖片數量。                   |
| `size`    | string  | 否  | 輸出圖片尺寸。                   |
| `quality` | string  | 否  | 模型支援時設定輸出品質。              |
