by 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 tokens
—
0.1351 0G
per image
—
N/A for image
Async API — Image generation uses an asynchronous flow: submit a job, then poll for the result. The examples below show both steps.
# 1. Submit async job
curl https://router-api-staging.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-staging.0g.ai/v1/async/jobs/<JOB_ID>?provider_address=<PROVIDER_ADDRESS>&model=z-image-turbo" \
-H "Authorization: Bearer <YOUR_API_KEY>"TEE Verification
Request on-chain signature verification with verify_tee. The response includes a tee_verified field in the trace.
{
"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-staging.0g.ai/v1/async/jobs/<JOB_ID>?provider_address=<ADDR>&model=z-image-turbo&verify_tee=true" \
-H "Authorization: Bearer <YOUR_API_KEY>"Provider Routing
Control which provider handles your request using the provider parameter.
{
"model": "z-image-turbo",
"prompt": "A futuristic city skyline at sunset",
"provider": {
"sort": "latency",
"allow_fallbacks": true
}
}Private models only
This model is Private. To pin requests to a TEE-backed provider, add the X-0G-Provider-Trust-Mode: private header. Opt-in — not applied by default.
X-0G-Provider-Trust-Mode: private