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

# GPT-Image-2.5 公式チャネルの画像生成

> Sunburst と Flare の非同期画像タスク, R2 への保存, 公式料金の 80% によるトークン課金

Azure 公式チャネル経由で 2 つの GPT-Image-2.5 モデルを利用できます. 送信すると非同期タスク ID がすぐに返ります. バックグラウンドで画像を生成し, R2 に保存してから提供します.

| モデル               | model                             |
| ----------------- | --------------------------------- |
| Sunburst Official | `gpt-image-2.5-sunburst-official` |
| Flare Official    | `gpt-image-2.5-flare-official`    |

表にある完全なモデル名を指定してください. `gpt-image-2.5-official` はシリーズ名であり, リクエストの model には指定できません.

中国本土では `https://api.toapis.com` を `https://api.toapis.cn` に置き換えてください. [コンソール](https://toapis.com/console/token) で API Key を作成し, 環境変数 `TOAPIS_API_KEY` に設定します.

## 送信と照会

Flare で画像を 1 枚生成します. Sunburst を使う場合は model を変更してください:

```bash theme={null}
curl --fail-with-body --request POST \
  --url https://api.toapis.com/v1/images/generations \
  --header "Authorization: Bearer $TOAPIS_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "gpt-image-2.5-flare-official",
    "prompt": "A small blue circle on a plain white background",
    "quality": "low",
    "size": "1024x1024",
    "n": 1
  }'
```

```json theme={null}
{
  "id": "tsk_img_example",
  "object": "generation.task",
  "model": "gpt-image-2.5-flare-official",
  "status": "pending",
  "progress": 0,
  "created_at": 1789099098,
  "metadata": {}
}
```

送信レスポンスの `id` を保存し, 以下の `TASK_ID` に指定します:

```bash theme={null}
curl --fail-with-body \
  --url https://api.toapis.com/v1/images/generations/TASK_ID \
  --header "Authorization: Bearer $TOAPIS_API_KEY"
```

送信時の状態は `pending` です. 照会時は `queued` または `in_progress` を経て, `completed` または `failed` になります. `completed` では `result.data[].url` から R2 の画像 URL を取得し, `failed` では `error` を確認します. 同じタスク ID を数秒おきに照会してください. 高品質の生成には数分かかる場合があるため, 重複送信せず照会を続けてください. 全フィールドは [画像タスク状態 API](../../tasks/image-status) を参照してください.

## リクエストパラメーター

<ParamField header="Authorization" type="string" required>
  ToAPIs API Key を `Bearer YOUR_API_KEY` 形式で指定します. Azure の認証情報は不要です.
</ParamField>

<ParamField body="model" type="string" required>
  `gpt-image-2.5-sunburst-official` / `gpt-image-2.5-flare-official`.
</ParamField>

<ParamField body="prompt" type="string" required>
  生成する画像の説明です. 参照画像を使う場合は, 維持する部分と変更する部分を指定します.
</ParamField>

<ParamField body="quality" type="string" default="high">
  `low`, `medium`, `high`, `xhigh`, `max` に対応します. 品質とサイズにより実際のトークン使用量と処理時間が変わります.
</ParamField>

<ParamField body="size" type="string" default="1024x1024">
  `1024x1024`, `1536x1024`, `1024x1536` などのピクセル寸法を指定します. カスタム寸法は上流の検証条件を満たす必要があります. この例では追加の resolution は不要です.
</ParamField>

<ParamField body="background" type="string">
  省略可能です. 透明背景を指定するには `transparent` を設定します. 省略時は上流のデフォルトを使用します. デフォルトの PNG 出力は透明度を保持できます.
</ParamField>

<ParamField body="n" type="integer" default={1}>
  現在, 公式チャネルでは 1 回のリクエストで画像を 1 枚生成します. `1` を指定してください.
</ParamField>

## 参照画像 URL

画像から画像を生成する場合, 同じ JSON 生成リクエストに `image_urls` を追加します. サーバーからアクセス可能な URL を使ってください. [画像アップロード API](../../uploads/images) で URL を取得できます. 参照画像には画像入力トークン料金が発生します. 送信と照会は同じ非同期フローです.

```bash theme={null}
curl --fail-with-body --request POST \
  --url https://api.toapis.com/v1/images/generations \
  --header "Authorization: Bearer $TOAPIS_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "gpt-image-2.5-sunburst-official",
    "prompt": "Keep the subject and replace the background with a snowy forest",
    "image_urls": ["https://example.com/reference.png"],
    "quality": "high",
    "size": "1024x1024",
    "n": 1
  }'
```

## トークン料金

2026-09-11 に確認した標準料金です. 両方の公式モデルは公式トークン料金の 80%, つまり 20% 割引で課金されます:

| 種類            | USD / 1,000,000 tokens |
| ------------- | ---------------------: |
| テキスト入力        |                   4.00 |
| キャッシュ済みテキスト入力 |                   1.00 |
| 画像入力          |                   6.40 |
| キャッシュ済み画像入力   |                   1.60 |
| 画像出力          |                  24.00 |

送信時にクォータを仮確保し, 成功後に上流の実際のテキストと画像のトークン使用量に基づいて差額を精算します. 5 段階の品質で同じ単価を使用し, 品質別の画像 1 枚あたりの固定料金はありません. 送信前に十分な残高と API Key クォータが必要です.

USD 単位の料金計算式:

```text theme={null}
USD = (
  uncached_text_input_tokens * 4
  + cached_text_input_tokens * 1
  + uncached_image_input_tokens * 6.4
  + cached_image_input_tokens * 1.6
  + image_output_tokens * 24
) / 1,000,000
```

例として, 未キャッシュのテキスト入力 17 tokens と画像出力 196 tokens の料金は `(17 * 4 + 196 * 24) / 1,000,000 = $0.004772` です. 画像 1 枚あたりの固定料金ではありません.

アカウント別の料金や割引も適用されます. 最終請求は使用ログで確認できます. 最新料金は [料金ページ](https://toapis.com/pricing) とアカウント設定に従います.

## 関連モデル

[通常版](../gpt-image-2.5/generation) と [VIP 版](../gpt-image-2.5-vip/generation) にはそれぞれ完全なモデル名があります. この公式チャネルでは `-official` 接尾辞を使用してください.
