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

# GPT Image 2.5 Sunburst API：画像の生成と編集

> GPT Image 2.5 Sunburst API を APIXO で利用することで、高忠実度のスタイル、5段階の品質設定、および非同期タスク配信をサポートした画像の生成および編集が可能です。

## 概要

サンバースト バリアントの場合は、`gpt-image-2.5-sunburst`（`2.5` にドットが付いている）に提出してください。既存の画像のスタイルを変更するには、[画像間リクエスト](#image-to-image)を使用します。参照を指定し、変更を記述し、品質とは別に出力解像度を設定します。例えば、編集サンプルでは`2k`と`max`を併用しています。

[GPT Image 2.5 Flare](https://apixo.ai/docs/ja/models/image/gpt-image-2-5-flare.md) は、`max` を含む同じ 5 つの品質値をサポートします。同じ編集でバリアントを比較する場合は、プロンプト、参照、解像度、品質を固定したままにして、モデル ID のみを変更します。

| 機能 | 値 |
| - | - |
| モデル ID | `gpt-image-2.5-sunburst` |
| モード | `text-to-image`, `image-to-image` |
| プロンプトの長さ | 1-32,000文字 |
| 参考画像 | 1-16 `image-to-image` の URL |
| マスク編集 | `image-to-image` 用のオプション `mask_url` |
| アスペクト比 | `auto`, `1:1`, `1:2`, `2:1`, `2:3`, `3:2`, `4:3`, `3:4`, `4:5`, `5:4`, `16:9`, `9:16`, `21:9` |
| 出力制御 | `aspect_ratio` または `size` (サポートされている比率またはカスタム `WIDTHxHEIGHT`) |
| 背景 | `auto`, `transparent`, `opaque` |
| 出力フォーマット | `png`, `jpeg`, `webp` |
| 解像度の区分 | `1k`, `2k`, `4k` |
| 品質レベル | `low`, `medium`, `high`, `xhigh`, `max` |

## エンドポイントと認証

ベース URL：

```text theme={null}
https://api.apixo.ai/api/v1
```

| メソッド | エンドポイント | 用途 |
| - | - | - |
| `POST` | `/generateTask/gpt-image-2.5-sunburst` | 生成タスクを送信する |
| `GET` | `/statusTask/gpt-image-2.5-sunburst?taskId={taskId}` | タスクの状態を確認して結果を取得する |

```http theme={null}
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
```

## クイックスタート

```bash theme={null}
curl -X POST "https://api.apixo.ai/api/v1/generateTask/gpt-image-2.5-sunburst" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_type": "async",
    "input": {
      "mode": "text-to-image",
      "prompt": "A cinematic aerial view of a futuristic coastal city at sunrise, warm golden light, detailed architecture, realistic clouds and ocean, no text or watermark",
      "aspect_ratio": "16:9",
      "resolution": "4k",
      "quality": "max"
    }
  }'
```

受け付けられた応答には`data.taskId`が含まれます。それを保存し、`state` が `success` または `failed` になるまでポーリングします。

## リクエストボディ

### テキストから画像を生成

```json theme={null}
{
  "request_type": "async",
  "input": {
    "mode": "text-to-image",
    "prompt": "A cinematic travel poster of mountains, a lake, and a cabin at sunrise, rich natural colors, no text",
    "aspect_ratio": "3:2",
    "resolution": "2k",
    "quality": "high"
  }
}
```

### 参照画像から画像を生成

```json theme={null}
{
  "request_type": "async",
  "input": {
    "mode": "image-to-image",
    "prompt": "Turn the supplied portrait into a refined editorial fashion photograph. Preserve the person's identity and pose, natural skin texture, beige studio backdrop, soft directional light.",
    "image_urls": [
      "https://your-domain.com/images/portrait-source.jpg"
    ],
    "mask_url": "https://your-domain.com/images/portrait-mask.png",
    "aspect_ratio": "4:5",
    "background": "opaque",
    "output_format": "png",
    "resolution": "2k",
    "quality": "max"
  }
}
```

## パラメーター

**request\_type** `string` *required* (default: async)

結果の取得方法です。`async` では `statusTask` をポーリングし、`callback` では Webhook で結果を受け取ります。

**callback\_url** `string`

`request_type`が`callback`の場合は必須です。最終タスク ペイロードを受信できる公開 HTTPS URL である必要があります。[Webhook](https://apixo.ai/docs/ja/api-reference/webhooks.md)を参照してください。

**input** `object` *required*

GPT Image 2.5 Sunburst の入力パラメータです。

**HTTP ステータスコードです。**

**mode** `string` *required*

生成モードです。指定できる値は `text-to-image`、`image-to-image` です。

**prompt** `string` *required*

要求された画像または編集を説明するテキスト プロンプト。1～32,000文字をサポートします。

**image\_urls** `string[]`

公開アクセス可能な参照画像の URL です。`image-to-image` では必須で、1～16 件指定できます。

**aspect\_ratio** `string` (default: auto)

出力アスペクト比。サポートされている値: `auto`、`1:1`、`1:2`、`2:1`、`2:3`、`3:2`、`4:3`、`3:4`、`4:5`、`5:4`、`16:9`、`9:16`、`21:9`。`1:2` および `2:1` の場合、`resolution` は `2k` または `4k` でなければなりません。`size` が指定された場合は無視されます。

**size** `string`

オプションの出力サイズ。サポートされているアスペクト比またはカスタム `WIDTHxHEIGHT`（例: `1536x1024`）を使用します。`aspect_ratio`よりも優先されます。カスタム `WIDTHxHEIGHT`、`1:2`、および `2:1` では、`resolution` が `2k` または `4k` である必要があります。

**resolution** `string` (default: 1k)

出力解像度の区分です。指定できる値は `1k`、`2k`、`4k` です。

**quality** `string` (default: medium)

品質と課金レベル。サポートされている値: `low`、`medium`、`high`、`xhigh`、`max`。各レベルには独自の課金価格があります。

**background** `string` (default: auto)

出力背景。サポートされている値: `auto`、`transparent`、`opaque`。`transparent`を使用する場合は、`output_format`を`png`または`webp`に設定してください。

**output\_format** `string` (default: png)

出力画像フォーマット。サポートされている値: `png`、`jpeg`、`webp`。`jpeg`は`background=transparent`と併用できません。

**mask\_url** `string`

オプションの公開 HTTP(S) マスク画像URL。`image-to-image`でのみ利用可能で、`image_urls`が必要です。

## 結果をポーリングする

```bash theme={null}
curl -X GET "https://api.apixo.ai/api/v1/statusTask/gpt-image-2.5-sunburst?taskId=task_12345678" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

成功すると、 `data.resultJson` です JSON を含む文字列 `resultUrls`:

```json theme={null}
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "success",
    "resultJson": "{\"resultUrls\":[\"https://file.apixo.ai/xxx.png\"]}",
    "createTime": 1767965610929,
    "completeTime": 1767965652317,
    "costTime": 41388
  }
}
```

タスクが失敗した場合、`state` は `failed` であり、応答には `failCode` と `failMsg` が含まれます。

## 料金

新規の非 LLM リクエストは **1 クレジット = `$0.001`** で換算します。利用量と追加項目から合計額を求め、アカウントの割引を適用してから、クレジットの端数を切り上げます。個別に固定単価を取り決めている場合は、その精度を保ったまま計算し、標準料金や割引は適用しません。この場合も最終額の端数は切り上げます。詳しくは[クレジットの換算と端数処理](https://apixo.ai/docs/ja/pricing.md#credit-conversion-and-rounding)を参照してください。

請求は正常に生成された画像ごとに発生します。以下に示す標準単価は米ドル（USD）単位で小数点第3位までとします。テキストから画像への変換および画像から画像への変換では、同じ出力層の価格が適用され、参考画像の利用は追加料金はかかりません。

| 品質 | `1k` | `2k` | `4k` |
| - | -: | -: | -: |
| `low` | `$0.010` | `$0.020` | `$0.030` |
| `medium` | `$0.024` | `$0.040` | `$0.070` |
| `high` | `$0.090` | `$0.150` | `$0.270` |
| `xhigh` | `$0.160` | `$0.270` | `$0.480` |
| `max` | `$0.360` | `$0.600` | `$1.000` |

ライブ価格カタログについては、[API 価格設定](https://apixo.ai/pricing/api) をご参照ください。

## レイテンシとポーリング

生成時間はプロンプトの複雑さ、参照画像、選択された解像度、および現在のキューの負荷に依存します。30～60秒後にポーリングを開始し、その後は10秒間隔でポーリングを行います。実稼働環境ではコールバックモードの使用を推奨します。

## MCP 連携

[モデルの完全なスキーマ](https://apixo.ai/docs/models/schemas/image/gpt-image-2-5-sunburst.json)では、`mcp.result` に結果のデコード方法、`mcp.attachments` にファイルを割り当てられるフィールドを定義しています。いずれもクライアント実装用のメタデータで、生成リクエストの入力パラメータには含めません。添付先は `image_urls`, `mask_url` です。ユーザーが指定したファイルの順序を維持してください。モデルのパラメータは API 側で検証します。

## 関連リンク

* [画像モデル](https://apixo.ai/docs/ja/models/image)
* [生成 API の概要](https://apixo.ai/docs/ja/models.md)
* [生成タスクを送信](https://apixo.ai/docs/ja/api-reference/generate-task.md)
* [タスクステータス](https://apixo.ai/docs/ja/api-reference/status-task.md)
* [Webhook](https://apixo.ai/docs/ja/api-reference/webhooks.md)
* [API 価格](https://apixo.ai/pricing/api)


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