> ## 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.6 Sunburst API：影像生成與編輯

> 使用 GPT Image 2.6 Sunburst 透過 APIXO 產生和編輯影像，支援 GIF 與 SVG 生成、有序參考影像，以及遮罩或標記編輯。

## 概覽

GPT Image 2.6 Sunburst 是一個異步 API，用於文字生成圖像與參考引導的圖像編輯。每項成功任務會回傳一個檔案。

| 功能 | 值 |
| - | - |
| 模型 ID | `gpt-image-2.6-sunburst` |
| 模式 | `text-to-image`, `image-to-image` |
| 輸出格式 | 兩種模式下皆支援 PNG、JPEG、WebP、GIF 與 SVG。 |
| 參考圖片 | `image-to-image` 中最多支援 1 至 16 個排序的 URL，GIF 編輯僅需一個 URL。 |
| 編輯指南 | PNG、JPEG 與 WebP 編輯時，可在第一張參考影像上附加一個可選的遮罩或標記。 |
| 解析度級距 | `1k`, `2k`, `4k` |
| 品質等級 | `low`, `medium`, `high`, `xhigh`, `max` |

## 端點和身分驗證

API 基底網址：

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

| 方法 | 端點 | 用途 |
| - | - | - |
| `POST` | `/generateTask/gpt-image-2.6-sunburst` | 建立影像任務 |
| `GET` | `/statusTask/gpt-image-2.6-sunburst?taskId={taskId}` | 讀取任務狀態和結果 |

使用`Authorization: Bearer YOUR_API_KEY`和`Content-Type: application/json`。

## 快速入門

產生具有自訂尺寸的影像。此範例請求 2304 × 1536 像素並使用 2K 計費層。

```bash theme={null}
curl -X POST "https://api.apixo.ai/api/v1/generateTask/gpt-image-2.6-sunburst" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input":{"mode":"text-to-image","prompt":"A botanical illustration of a fern","size":"2304x1536"}}'
```

生成GIF：

```bash theme={null}
curl -X POST "https://api.apixo.ai/api/v1/generateTask/gpt-image-2.6-sunburst" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input":{"mode":"text-to-image","prompt":"A paper boat rocking gently in a seamless loop","output_format":"gif","frame_count":9}}'
```

對於SVG，將`output_format`設定為`svg`。若要使用帶有註釋的指南編輯參考影像，請提交以下請求主體：

```json theme={null}
{
  "input": {
    "mode": "image-to-image",
    "prompt": "Replace the circled object with a blue vase.",
    "image_urls": ["https://example.com/room.png"],
    "markup_url": "https://example.com/markup.png"
  }
}
```

## 參數

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

使用 `async` 輪詢結果或使用 `callback` 進行 Webhook 傳遞。

**callback\_url** `string`

接收最終任務負載的公開 HTTPS URL。當`request_type`為`callback`時需要。請參閱 [Webhooks](https://apixo.ai/docs/zh-hant/api-reference/webhooks.md)。

**input** `object` *required*

GPT Image 2.6 Sunburst 的輸入參數。

**屬性**

**mode** `string` *required*

生成模式。使用`text-to-image`或`image-to-image`。

**prompt** `string` *required*

描述影像或編輯的非空白提示。

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

依參考順序排列、可公開存取的 HTTP(S) 影像 URL。`image-to-image` 模式必填。PNG、JPEG、WebP 或 SVG 可提供 1–16 個 URL，GIF 必須恰好提供一個 URL。

**mask\_url** `string`

第一個參考影像的選填的公開 HTTP(S) 掩模 URL。可用於 PNG、JPEG 和 WebP 編輯。白色或透明區域指示編輯位置。提供 `mask_url` 或 `markup_url`。

**markup\_url** `string`

選填的公開 HTTP(S) URL 一個透明的 PNG 標記第一張參考影像。可用於 PNG、JPEG 和 WebP 編輯。使用箭頭、圓圈或文字來指導編輯。提供任一 `markup_url` 或 `mask_url`。

**size** `string`

要求的寬度與高度，以像素為單位，例如 `2304x1536`。寬與高分別取最接近的 16 的倍數，恰好介於兩個倍數中間時取較大者。取整後，最長邊不得超過 3,840 像素，最長邊與最短邊的比值不得超過 3:1，總畫素數須在 655,360–8,294,400 之間。提供 `size` 時，優先於 `resolution` 和 `aspect_ratio`。實際輸出尺寸可能不同。以 `size` 編輯 GIF 時，1:1 限為 `832x832`，16:9 限為 `1280x720`，9:16 限為 `720x1280`。

**aspect\_ratio** `string`

輸出縱橫比。使用 `1:1`、`1:2`、`2:1`、`1:3`、`3:1`、`2:3`、`3:2`、`3:4`、`4:3`、`4:5`、`5:4`、`9:16`、`16:9`、`9:21` 或 `21:9`。省略時，`text-to-image` 使用 `1:1`，`image-to-image` 跟隨第一個參考影像。

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

輸出分辨率層。使用 `1k`、`2k` 或 `4k`。省略 `size` 時會影響定價。

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

輸出品質等級。使用 `low`、`medium`、`high`、`xhigh` 或 `max`。影響定價。

**complexity** `string` (default: high)

規劃強度，選填 `low`、`medium` 或 `high`。

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

兩種模式皆支援 `png`、`jpeg`、`webp`、`gif` 與 `svg`。編輯 GIF 時必須使用 `1k` 和 `medium`，提供一張參考影像，並採用 9 個影格、每格 200 ms，以及 `1:1`、`16:9` 或 `9:16` 的長寬比。

**frame\_count** `integer` (default: 9)

GIF 影格數。文生圖支援 2–16 影格。圖生圖使用 9 影格。

**frame\_duration\_ms** `integer` (default: 200)

每個 GIF 影格的持續時間（以毫秒為單位）。文生圖支援 20–2,000 毫秒。圖生圖需要 200 毫秒。

## 輪詢結果

建立回應傳回 `data.taskId`。儲存並使用它來查詢任務：

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

當`data.state`為`success`時，將`data.resultJson`解碼為JSON，讀取`resultUrls`：

```json theme={null}
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "YOUR_TASK_ID",
    "state": "success",
    "resultJson": "{\"resultUrls\":[\"https://example.com/result.gif\"]}"
  }
}
```

只要 `state` 仍是 `processing` 或 `processing_r2`，就應繼續輪詢。如果 `state` 變為 `failed`，請檢視回應中是否有 `failCode` 和 `failMsg`。使用 `request_type: "callback"` 時，最終結果會傳送到你提供的 Webhook URL。詳見 [Webhook](https://apixo.ai/docs/zh-hant/api-reference/webhooks.md)。

## 計費

當您提供 `size` 時，計費將使用捨入尺寸。第一個匹配行適用。

| 等級 | 最長邊 | 總像素 |
| - | -: | -: |
| 1K | 最大 1,536 像素 | 最多 1,572,864 像素 |
| 2K | 最大 3,072 像素 | 最多 4,194,304 像素 |
| 4K | 所有其他有效尺寸 | |

文生圖 GIF 使用相同品質和解析度的靜態基本價格。文生圖 SVG 將 `$0.020` 加到該基本價格。GIF 和 SVG 編輯對每個參考影像（包括第一個影像）使用匹配的文生圖格式價格加上 `$0.015`。PNG、JPEG 和 WebP 編輯包含基本價格中的第一張參考影像。每個額外的參考影像都會花費 `$0.015`，選填的遮罩或標記會增加 `$0.015` 一次。複雜性和影格持續時間不會影響標準價格。

在 `medium` 和 `1k` 處，PNG 和 GIF 文生圖的成本分別為 `$0.050`，SVG 的成本為 `$0.070`。對於一張參考影像，GIF 編輯成本為 `$0.065`，SVG 編輯成本為 `$0.085`。使用三張參考影像和一張標記進行靜態編輯的成本為 `$0.110`。這些是折扣前的標準價格。請參閱[完整定價表](https://apixo.ai/docs/zh-hant/pricing.md#gpt-image-2-6-flare-and-sunburst)和[點數換算與進位](https://apixo.ai/docs/zh-hant/pricing.md#credit-conversion-and-rounding)。

## 耗時與輪詢

狀態請求之間建議間隔 3–5 秒。對於正式環境，建議使用回呼傳遞。

## MCP 整合

[完整模型架構](https://apixo.ai/docs/models/schemas/image/gpt-image-2-6-sunburst.json) 在 `mcp.result` 中定義結果格式，於 `mcp.attachments` 中定義附件路徑。將檔案綁定至 `image_urls`、`mask_url` 或 `markup_url`，並保留參考影像的順序。API 會驗證模式需求及僅選擇一種編輯引導。

## 相關連結

* [GPT Image 2.6 Flare](https://apixo.ai/docs/zh-hant/models/image/gpt-image-2-6-flare.md)
* [影像模型](https://apixo.ai/docs/zh-hant/models/image)
* [生成 API 總覽](https://apixo.ai/docs/zh-hant/models.md)
* [API定價](https://apixo.ai/pricing/api)


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