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

# Grok Imagine 画像モデル

> WideRouter上のxAIの3つの画像モデル：それぞれの用途、解像度と品質の比較表、参照画像、実測レイテンシ。

Grok Imagineは、xAIの生成メディアモデルファミリーです。そのうち3つが
画像を生成し、3つすべてが[非同期タスク API](/ja/api/async-tasks)上で、プラットフォーム上の
他のすべてのモデルと同じエンベロープを使用して動作します。

モデルIDはxAIの公式名称と完全に一致します。WideRouterはエイリアスを公開していません。

## シリーズの概要

|                 | Grok Imagine 2.0         | Grok Imagine Quality         | Grok Imagine         |
| --------------- | ------------------------ | ---------------------------- | -------------------- |
| **モデル ID**      | `grok-imagine-image-2.0` | `grok-imagine-image-quality` | `grok-imagine-image` |
| 非同期タスク API      | はい                       | はい                           | はい                   |
| 同期画像 API        | はい                       | はい                           | はい                   |
| `quality` パラメータ | **はい**、`low` / `medium`  | いいえ                          | いいえ                  |
| 解像度ティア          | `1k` / `2k`              | `1k` / `2k`                  | `1k` / `2k`          |
| デフォルトの構図        | 横長、1248 × 832            | **縦長、864 × 1152**            | 横長、1248 × 832        |
| 1回の呼び出しあたりの画像数  | 最大 4 枚                   | 最大 4 枚                       | 最大 4 枚               |
| 参照画像            | 最大 3 枚                   | 最大 3 枚                       | 最大 3 枚               |

この3つは、1つの点を除いて**同じパラメータ**を受け付けます。`grok-imagine-image-2.0`
だけが`quality`を受け付けます。他の2つでは、品質が選択式ではなく固定されているため、
`unknown field`として拒否されます。

これが、3つの中から選ぶ際の基本的な判断基準です。

* \*\*`grok-imagine-image-2.0`\*\*は調整可能なモデルです。コストと忠実度のバランスを取りたい場合や、特定のアスペクト比と解像度が必要な場合に使用してください。
* \*\*`grok-imagine-image-quality`\*\*は高品質に固定されており、デフォルトでは縦長の構図になります。制御性よりも品質を重視する場合に使用してください。
* \*\*`grok-imagine-image`\*\*は3つの中で圧倒的に低コストです。下書き、サムネイル、その他大量に生成するものに使用してください。

## パラメーター

エンベロープは、[非同期タスク API](/ja/api/async-tasks) で説明した
`model`、`input`、およびオプションの`callback_url`という同じ3つのキーで構成されます。以下の内容はすべて`input`内に指定します。

| フィールド          | 型         | デフォルト     | 注記                                                    |
| -------------- | --------- | --------- | ----------------------------------------------------- |
| `prompt`       | string    | —         | 必須です。空にすることはできず、最大32000バイトです。                         |
| `resolution`   | string    | `1k`      | `1k` または `2k`。小文字です。                                  |
| `quality`      | string    | `low`     | `low` または `medium`。**`grok-imagine-image-2.0` のみです。** |
| `aspect_ratio` | string    | モデルのデフォルト | 以下の16個の値のいずれか、または`auto`です。                            |
| `n`            | integer   | 1         | 1～4です。各画像は`outputs`内の個別のエントリになります。                    |
| `images`       | string\[] | —         | 参照画像は最大3枚で、`https` URL または base64 データ URI として指定します。   |

`input`内のバリデーションは厳格です。認識されないキーは直ちに拒否され、
`invalid_params`およびキー名を正確に示す`param`が返されます。誤字は黙って無視されず、
明確にエラーになります。

<Warning>
  `resolution`の値は**小文字**（`1k`、`2k`）です。これは、
  `1K` / `2K` / `4K`を`image_size`で大文字として使用する
  Nano Banana シリーズとは反対です。
  ここでは2つのファミリーでパラメーター名を共有していないため、引き継ぐものはありません。この表を参照し、もう一方の表は参照しないでください。
</Warning>

## 解像度と品質

`grok-imagine-image-2.0`では、2つの寸法は独立しており、どちらも出力に影響します。測定したピクセルサイズの例（各1件）：

| `resolution` | `quality`    | 出力                |
| ------------ | ------------ | ----------------- |
| `1k`（デフォルト）  | `low`（デフォルト） | 832 × 1248        |
| `1k`         | `medium`     | `16:9`で1280 × 720 |
| `2k`         | `low`        | 1664 × 2496       |
| `2k`         | `medium`     | 2816 × 1584       |

残り2つのモデルでは`resolution`のみ適用されます。測定結果：`2k`で`grok-imagine-image`を指定すると2816 × 1584、`2k`で`grok-imagine-image-quality`を指定すると
1776 × 2368が返されます。

正確なピクセル寸法は固定グリッドではなく、モデルが決定します。同じ
ティアでも、指定するアスペクト比によって異なる数値になります。
この表はおおよその目安として扱い、実際のサイズはファイルから確認してください。

## アスペクト比

3つのモデルはすべて同じ16種類の値に対応しています。

|        |        |          |          |
| ------ | ------ | -------- | -------- |
| `auto` | `1:1`  | `16:9`   | `9:16`   |
| `4:3`  | `3:4`  | `3:2`    | `2:3`    |
| `2:1`  | `1:2`  | `19.5:9` | `9:19.5` |
| `20:9` | `9:20` | `21:9`   | `5:2`    |

省略すると、各モデルは独自のデフォルトフレーミングを使用します。`grok-imagine-image`と`grok-imagine-image-2.0`では横長、`grok-imagine-image-quality`では縦長です。`auto`を使用すると、モデルがプロンプトに基づいて選択します。

## 参照画像

`input.images` に最大3枚の画像を渡して、編集または合成に使用できます。各
エントリは、`https` URL または base64 データ URI のいずれかです。

```json theme={null}
{
  "model": "grok-imagine-image-2.0",
  "input": {
    "prompt": "put the teapot on a marble counter, warm morning light",
    "images": ["https://example.com/teapot.jpg"],
    "resolution": "2k"
  }
}
```

4枚目の画像は送信時に拒否されます:
`input.images` — `must contain at most 3 items`。形式が不正なエントリは、その
インデックスを示します: `input.images[0]` — `must be an https URL or a base64 image data URI`。

WideRouter はURLをサーバー側で取得するため、URLは公開インターネットから
アクセス可能である必要があります。名前解決できないホストや、画像以外の
ものを返すホストの場合、送信時ではなくキューに追加された後にタスクが失敗します。

## Pricing

These models are served through the **`Grok-Official`** group. WideRouter's list
price matches xAI's official price exactly — the discount lives in the **group
multiplier**, which is `0.8` for `Grok-Official`. So what you pay is:

```
list price × group multiplier = charge
```

Per-image list prices, all confirmed against the billing figures the API returns:

| Model                        | `resolution` | `quality` | List price                           |
| ---------------------------- | ------------ | --------- | ------------------------------------ |
| `grok-imagine-image`         | `1k` or `2k` | —         | \$0.02 — the two tiers cost the same |
| `grok-imagine-image-2.0`     | `1k`         | `low`     | \$0.04                               |
| `grok-imagine-image-2.0`     | `1k`         | `medium`  | \$0.06                               |
| `grok-imagine-image-2.0`     | `2k`         | `low`     | \$0.06                               |
| `grok-imagine-image-2.0`     | `2k`         | `medium`  | \$0.08                               |
| `grok-imagine-image-quality` | `1k`         | —         | \$0.05                               |
| `grok-imagine-image-quality` | `2k`         | —         | \$0.07                               |

Two rules that are easy to miss:

* **Reference images cost extra**, about \$0.01 per input image, on top of the
  output price. A three-image composition is priced as one output plus three
  inputs.
* **`n` multiplies.** Four images at `2k` / `medium` is four times the single-image
  price, not a bulk rate.

<Info>
  A completed task carries `usage.cost_in_usd_ticks`, where `10000000000` ticks
  is \$1. That figure is the **list price** — before your group multiplier.
  Multiply it by your group's rate to get what actually leaves your balance.
</Info>

## レイテンシー

非同期 API でエンドツーエンドの時間を測定しました。`completed` への送信から、デフォルト設定で各 1 サンプルを実行した結果です。

| モデル                          | エンドツーエンド |
| ---------------------------- | -------- |
| `grok-imagine-image`         | 6.6 秒    |
| `grok-imagine-image-quality` | 6.6 秒    |
| `grok-imagine-image-2.0`     | 10 秒     |

十分に高速であるため、非同期のラウンドトリップ（送信後、2～3 秒ごとにポーリング）にかかる実時間は、生成自体にかかる時間を上回ることがよくあります。通常は 2 回のポーリングで完了します。

## 同期サーフェス

3つのモデルはすべて `POST /v1/images/generations` でも応答し、接続を開いたままにして画像を直接返します。

```bash theme={null}
curl https://api.widerouter.com/v1/images/generations \
  -H "Authorization: Bearer $WIDEROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "grok-imagine-image-2.0",
    "prompt": "a small ceramic teapot on a light-grey studio backdrop",
    "resolution": "2k",
    "response_format": "b64_json"
  }'
```

レスポンスは `data` と `usage` で構成されます。`data[0]` に格納される内容は
`response_format` によって異なります。インラインのバイト列の場合は `b64_json`、リンクの場合は `url` です。

<Warning>
  **`response_format: "url"` を使用すると、リンクは WideRouter の CDN ではなく xAI 自身のホストを指します**。また、その有効期間を保証できるのは当社ではありません。実測では、`imgen.x.ai` 上で `2k` 画像生成の結果が 5.2 MB の **PNG** として返されました。同じモデルを非同期 API で使用した場合は、WideRouter CDN 経由で、24時間の有効期間が明記された JPEG が返されます。ここでは `b64_json` を優先するか、非同期 API を使用してください。
</Warning>

同期パスは、バイト列をすぐに受け取りたいスクリプトにはより簡単ですが、生成が完了するまで接続を保持します。`2k` での実測時間は 19.4 秒でした。サーバーレス関数、リバースプロキシ、またはモバイルクライアントの背後で動作するものは、代わりに非同期 API を使用してください。

## 次のステップ

<CardGroup cols={2}>
  <Card title="Playground" icon="play" href="/ja/models/grok-imagine/image/playground">
    ブラウザから実際のリクエストを送信し、タスクが完了する様子を確認します。
  </Card>

  <Card title="Grok Imagine 動画" icon="film" href="/ja/models/grok-imagine/video/overview">
    ファミリーの動画機能です。クリップの生成、編集、延長に対応しています。
  </Card>
</CardGroup>
