由 0G Foundation 提供
Asynchronous text-to-image model with Base64 output. Generates at most 2 images per request — requesting more (n > 2) returns 2 images, not an error.
2K
2,048 個詞元
—
$0.04
每張圖片
—
圖片不適用
非同步 API — 圖片生成使用非同步流程:提交任務,然後輪詢結果。以下範例顯示了這兩個步驟。
# 1. Submit async job
curl "https://router-api.0g.ai/v1/async/images/generations" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-d '{
"model": "z-image-turbo",
"prompt": "A futuristic city skyline at sunset",
"n": 1,
"size": "1024x1024",
"response_format": "b64_json"
}'
# Response: {"jobId": "abc123", "status": "pending", "provider_address": "0x..."}
# 2. Poll for result (repeat until status is "completed")
curl "https://router-api.0g.ai/v1/async/jobs/<JOB_ID>?provider_address=<PROVIDER_ADDRESS>&model=z-image-turbo" \
-H "Authorization: Bearer <YOUR_API_KEY>"TEE 驗證
使用 verify_tee 請求鏈上簽章驗證。回應的追蹤中包含 tee_verified 欄位。
{
"model": "z-image-turbo",
"prompt": "A futuristic city skyline at sunset",
"verify_tee": true
}
# Then poll with verify_tee query param
curl "https://router-api.0g.ai/v1/async/jobs/<JOB_ID>?provider_address=<ADDR>&model=z-image-turbo&verify_tee=true" \
-H "Authorization: Bearer <YOUR_API_KEY>"供應商路由
使用 X-0G-Provider-* 請求標頭,控制哪個供應商處理您的請求。
curl "https://router-api.0g.ai/v1/async/images/generations" \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-H "X-0G-Provider-Sort: latency" \
-H "X-0G-Provider-Allow-Fallbacks: true" \
-d '{
"model": "z-image-turbo",
"prompt": "A futuristic city skyline at sunset"
}'僅限私人模型
此模型為私密模型。若要將請求固定至 TEE 支援的供應商,請加上 X-0G-Provider-Trust-Mode: private 標頭。此為選擇性設定,並非預設套用。
X-0G-Provider-Trust-Mode: private