跳转到主要内容
POST
/
v1
/
tasks
Z.ai Image
curl --request POST \
  --url https://www.qingbo.dev/v1/tasks \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "action": "<string>",
  "prompt": "<string>",
  "n": 123,
  "aspect_ratio": "<string>",
  "resolution": "<string>",
  "callback_url": "<string>",
  "callback_events": [
    "<string>"
  ],
  "prompt_extend": true
}
'
import requests

url = "https://www.qingbo.dev/v1/tasks"

payload = {
"model": "<string>",
"action": "<string>",
"prompt": "<string>",
"n": 123,
"aspect_ratio": "<string>",
"resolution": "<string>",
"callback_url": "<string>",
"callback_events": ["<string>"],
"prompt_extend": True
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
action: '<string>',
prompt: '<string>',
n: 123,
aspect_ratio: '<string>',
resolution: '<string>',
callback_url: '<string>',
callback_events: ['<string>'],
prompt_extend: true
})
};

fetch('https://www.qingbo.dev/v1/tasks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://www.qingbo.dev/v1/tasks"

payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"action\": \"<string>\",\n \"prompt\": \"<string>\",\n \"n\": 123,\n \"aspect_ratio\": \"<string>\",\n \"resolution\": \"<string>\",\n \"callback_url\": \"<string>\",\n \"callback_events\": [\n \"<string>\"\n ],\n \"prompt_extend\": true\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://www.qingbo.dev/v1/tasks")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"action\": \"<string>\",\n \"prompt\": \"<string>\",\n \"n\": 123,\n \"aspect_ratio\": \"<string>\",\n \"resolution\": \"<string>\",\n \"callback_url\": \"<string>\",\n \"callback_events\": [\n \"<string>\"\n ],\n \"prompt_extend\": true\n}")
.asString();
{
  "task_id": "task-wave1775285160b950328499",
  "model": "z-image-turbo",
  "action": "generate",
  "status": "queued",
  "created_at": 1775285160040,
  "progress": 0
}
智谱 Z.ai 推出的轻量快速图像生成模型,中英双语 Prompt 均良好支持,延迟低、单价低,适合批量草图、运营素材、快速预览等高频场景。 按张计费,纯文生图(不接受参考图),固定单次返回 1 张。

定价

模型单价(每张)
z-image-turbo$0.01125

调用示例

curl -X POST https://www.qingbo.dev/v1/tasks \
  -H "Authorization: Bearer $WAVE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "z-image-turbo",
    "prompt": "夕阳下的海边咖啡馆,木质露台,暖色调",
    "aspect_ratio": "16:9",
    "resolution": "1K"
  }'
curl -X POST https://www.qingbo.dev/v1/tasks \
  -H "Authorization: Bearer $WAVE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "z-image-turbo",
    "prompt": "一只柴犬",
    "prompt_extend": true,
    "aspect_ratio": "1:1",
    "resolution": "2K"
  }'
{
  "task_id": "task-wave1775285160b950328499",
  "model": "z-image-turbo",
  "action": "generate",
  "status": "queued",
  "created_at": 1775285160040,
  "progress": 0
}
提交后用 GET /v1/tasks/{task_id} 轮询状态,详见 任务系统

可用模型

模型 ID说明
z-image-turbo轻量快速,中英双语,1K/2K,纯文生(无参考图)

通用参数

model
string
必填
可用模型 列表中选一个
action
string
默认值:"generate"
操作类型,z-image-turbo 仅支持 generate(文生图)
prompt
string
必填
图像描述文本,中英文均良好支持。最长 800 字符
n
integer
默认值:"1"
生成数量。该模型固定单次返回 1 张,不支持 n > 1
aspect_ratio
string
默认值:"1:1"
画面宽高比,可选值:
  • 1:1 — 正方形
  • 4:3 / 3:4 — 横/竖版标准
  • 16:9 / 9:16 — 横/竖版宽屏
  • 3:2 / 2:3 — 横/竖版相机比
resolution
string
默认值:"1K"
输出分辨率,可选 1K / 2K
callback_url
string
Webhook 回调地址,任务终态时调用。详见 回调机制
callback_events
string[]
指定要回调的事件,默认仅终态事件。详见 回调机制

模型特定参数

prompt_extend
boolean
默认值:"false"
智能改写提示词。开启后 AI 自动优化提示词,效果更好但费用增加

注意事项

  • 单次只能 1 张n 字段固定为 1,如需多张请多次提交任务
  • Prompt 上限 800 字符 — 超长 Prompt 请自行裁剪
  • prompt_extend 开启后费用上升 — AI 改写会消耗额外推理成本,批量场景请按需开启
  • 纯文生图 — 不接受 image_urls 参考图,如需图生图请选择其他模型

资源限制

项目限制
单次生成数量固定 1 张
Prompt 长度≤ 800 字符
输出分辨率1K / 2K
输出文件JPG,链接 24 小时有效

相关文档