> ## 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.

# 生成 API 參數：請求結構與模型輸入

> 建立產生請求，選擇輪詢或回呼，並檢查特定於模型的模式、參考輸入和限制。

生成請求分為兩部分。最外層的欄位指定如何取得結果，`input` 物件則指定路徑中的模型要執行什麼任務。切換模型時，請先查閱新模型的輸入參數表，再決定能否沿用原本的請求本文。

## 請求結構

以下範例向 `POST /api/v1/generateTask/nano-banana` 提交一個只使用提示詞的任務：

```json theme={null}
{
  "request_type": "async",
  "input": {
    "mode": "text-to-image",
    "prompt": "A green ceramic teapot on a white shelf",
    "aspect_ratio": "1:1"
  }
}
```

### 頂級參數

| 欄位 | 使用 |
| - | - |
| `input` | 包含所選模型和模式欄位的必需物件。 |
| `request_type` | 省略時預設為 `async`。輪詢傳回的任務 ID，或將此欄位設為 `callback` 以進行 Webhook 傳遞。檢查型號參考以了解其他支援的選項。 |
| `callback_url` | 當`request_type`為`callback`時需要。提供可公開存取的 HTTPS 端點。在 `async` 模式下輪詢時可以省略此欄位。請參閱 [Webhooks](https://apixo.ai/docs/zh-hant/api-reference/webhooks.md)。 |

## 影像生成參數

對於 [Nano Banana](https://apixo.ai/docs/zh-hant/models/image/nano-banana.md)，僅使用 `text-to-image` 進行提示，或使用 `image-to-image` 和一到五個參考影像進行編輯。 [GPT Image 1](https://apixo.ai/docs/zh-hant/models/image/gpt-image-1.md) 使用 `gpt-image-1` 作為這兩個任務的模式。僅更改端點中的模型 ID 會在主體中保留舊模式。

## 影片產生參數

檢查每個媒體插槽的含義。對於 [Kling 2.5 Turbo Pro](https://apixo.ai/docs/zh-hant/models/video/kling-2-5-turbo-pro.md)，兩個影像 URL 指定開頭影格和結束影格。對於 [Wan 2.2 Animate](https://apixo.ai/docs/zh-hant/models/video/wan-2-2-animate.md)，角色進入 `image_urls`，運動剪輯進入 `video_urls`。檢查所選模型參考中的持續時間、解析度和必填欄位。

## 音訊生成參數

[MiniMax Speech 2.8](https://apixo.ai/docs/zh-hant/models/audio/minimax-speech-2-8.md) 使用語音 ID 進行語音合成。[Suno](https://apixo.ai/docs/zh-hant/models/audio/suno.md) 公開音樂控件，例如 `instrumental`。使用您實際想要執行的音訊任務的請求範例。

## 長寬比參考

`1:1`（方形）、`16:9`（橫向）和 `9:16`（縱向）等值描述了輸出形狀。支援的比率和預設值取決於型號和模式。在轉發使用者的選擇之前檢查這些值。

## 快速參考

1. 從 [模型目錄](https://apixo.ai/docs/zh-hant/models.md) 選擇公共模型 ID。
2. 複製該模型的範例以取得預期模式，並取代其提示和媒體 URL。
3. [送出任務](https://apixo.ai/docs/zh-hant/api-reference/generate-task.md)。對於輪詢，儲存模型和傳回的任務 ID 並使用 [查詢任務狀態](https://apixo.ai/docs/zh-hant/api-reference/status-task.md) 檢索結果。


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