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