APIMaster.ai

z-image-spicy-pro — 使用與參數

文字生圖。公開模型 ID 為 z-image-spicy-pro,基礎價格為每張成功圖片 $0.020。

z-image-spicy-pro

文字生圖。公開模型 ID 為 z-image-spicy-pro,基礎價格為每張成功圖片 $0.020。

使用 APIMaster API key,標頭為 Authorization: Bearer。JSON 使用 Content-Type: application/json;multipart 讓 cURL/requests 自動設定 boundary。https://apimaster.ai/v1 已含 /v1。

POST https://apimaster.ai/v1/images/generations · application/json

範例使用同步介面:伺服器等待並輪詢已受理的上游任務,客戶端收到最終 Images 結果,而非供應商任務 UUID。請設定足夠長的讀取逾時(如 750 秒),不使用串流。

參數說明

欄位 / 型別 規則與預設值
model · string 必填,必須使用上方正確的公開模型 ID。
prompt · string 必填非空字串,描述目標圖片或編輯指令。
n · integer = 1 選填整數,只支援 1,預設 1。
response_format · string = url 選填字串:url(預設)或 b64_json。
width / height · integer = 1024 選填整數,寬高各為 256–2560 像素。上游預設 1024 × 1024。
size · string 選填 寬x高,例如 512x512,或 auto。必須與明確指定的 width/height 一致;省略全部尺寸欄位時使用上游預設。
seed · integer | null = 0 選填整數或 null,範圍 0–2147483647,預設 0。0 或 null 使用隨機種子,不保證重現。
prompt_extend · boolean | null = false 選填布林值或 null,預設 false。true 由上游改寫、擴展提示詞;null 使用預設值。
quality · standard; stream · false 不支援:n>1、stream=true、mask/mask_url、style、background、output_format、watermark。quality 省略或使用 standard,不提供額外品質檔位。未知額外參數會被拒絕。
resolution Z Image 不接受參考圖。使用 size 或 width/height;省略 resolution(相容舊值 1K,但不設定輸出尺寸)。

呼叫範例

cURL · JSON

curl --max-time 750 'https://apimaster.ai/v1/images/generations' \
  -H "Authorization: Bearer $APIMASTER_API_KEY" \
  -H 'Content-Type: application/json' \
  --data '{
  "model": "z-image-spicy-pro",
  "prompt": "A red paper boat on a calm blue pond, no text.",
  "n": 1,
  "response_format": "url",
  "seed": 0,
  "width": 512,
  "height": 512,
  "prompt_extend": false
}'

Python · requests

import os
import requests

api_base = "https://apimaster.ai/v1"
payload = {
    "model": "z-image-spicy-pro",
    "prompt": "A red paper boat on a calm blue pond, no text.",
    "n": 1,
    "response_format": "url",
    "seed": 0,
    "width": 512,
    "height": 512,
    "prompt_extend": False
}
response = requests.post(
    api_base + "/images/generations",
    headers={"Authorization": "Bearer " + os.environ["APIMASTER_API_KEY"]},
    json=payload,
    timeout=(20, 750),
)
response.raise_for_status()
result = response.json()
print(result)

回應與計費

成功時 HTTP 200 回傳 created(Unix 秒)與只有一個元素的 data 陣列。url 為圖片下載位址,請及時儲存;b64_json 為圖片位元組的 base64。除了狀態碼,也應檢查圖片內容。

{"created": 1793380000, "data": [{"url": "https://example.com/generated.png"}]}
{"created": 1793380000, "data": [{"b64_json": "BASE64_IMAGE_BYTES"}]}

基礎價格按張計費,最終扣費受既有渠道、群組及帳號倍率影響,以模型廣場與消費紀錄為準。支援範圍內的尺寸、參考圖數量不另外加價,範例皆為 n=1。

z-image-spicy-pro

限制與排錯

不支援:n>1、stream=true、mask/mask_url、style、background、output_format、watermark。quality 省略或使用 standard,不提供額外品質檔位。未知額外參數會被拒絕。

Z Image 不接受參考圖。使用 size 或 width/height;省略 resolution(相容舊值 1K,但不設定輸出尺寸)。

400 參數錯誤需修正參數;上游拒絕或失敗會回傳錯誤。逾時、斷線或受理結果未知不代表沒有生成:保留請求 ID,先查消費紀錄或聯絡支援,再決定是否提交新的付費 POST。轉接器不會自動重新提交已受理任務。


圖片 API 總覽 · qwen_image_edit_spicy

上游規格核查日期 2026-10-30。本文以已部署的 APIMaster 轉接器為準,不直接照搬上游建立與輪詢介面。

MuleRouter API