Z-Image-Turbo API Documentation
Check Status - Request Code
POST https://gateway.pixazo.ai/z-image-turbo-834/v1/z-image-turbo-request-result Content-Type: application/json Cache-Control: no-cache Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY { "request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8" } import requests url = "https://gateway.pixazo.ai/z-image-turbo-834/v1/z-image-turbo-request-result" headers = { "Content-Type": "application/json", "Cache-Control": "no-cache", "Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY" } data = { "request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8" } response = requests.post(url, json=data, headers=headers) print(response.json()) const url = 'https://gateway.pixazo.ai/z-image-turbo-834/v1/z-image-turbo-request-result'; const headers = { 'Content-Type': 'application/json', 'Cache-Control': 'no-cache', 'Ocp-Apim-Subscription-Key': 'YOUR_SUBSCRIPTION_KEY' }; const data = { request_id: 'a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8' }; fetch(url, { method: 'POST', headers: headers, body: JSON.stringify(data) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); curl -X POST "https://gateway.pixazo.ai/z-image-turbo-834/v1/z-image-turbo-request-result" \ -H "Content-Type: application/json" \ -H "Cache-Control: no-cache" \ -H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \ --data-raw '{ "request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8" }' import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.time.Duration; public class ApiCall { public static void main(String[] args) throws Exception { HttpClient client = HttpClient.newHttpClient(); String json = """ { "request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8" } """; HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://gateway.pixazo.ai/z-image-turbo-834/v1/z-image-turbo-request-result")) .header("Content-Type", "application/json") .header("Cache-Control", "no-cache") .header("Ocp-Apim-Subscription-Key", "YOUR_SUBSCRIPTION_KEY") .timeout(Duration.ofSeconds(10)) .POST(HttpRequest.BodyPublishers.ofString(json)) .build(); HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body()); } } <?php $url = 'https://gateway.pixazo.ai/z-image-turbo-834/v1/z-image-turbo-request-result'; $headers = [ 'Content-Type: application/json', 'Cache-Control: no-cache', 'Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY' ]; $data = [ 'request_id' => 'a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8' ]; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); echo $response; ?> Output
Successful API response:
{ "status": "COMPLETED", "request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8", "images": [ { "url": "https://storage.pixazo.ai/output/a1b2c3d4.png" } ] } Request Body - Check Status
Parameters for /z-image-turbo-request-result:
| Parameter | Required | Type | Description |
|---|---|---|---|
| request_id | Yes | string | Unique identifier of the image generation request to check. Returned from the initial /z-image-turbo-request call. |
Example Request - Check Status
JSON
{ "request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8" } Response - Check Status
JSON
{ "status": "COMPLETED", "request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8", "images": [ { "url": "https://storage.pixazo.ai/output/a1b2c3d4.png", "width": 1333, "height": 1000, "content_type": "image/png" } ] } Request Headers
| Header | Description |
|---|---|
| Content-Type | Must be set to application/json |
| Cache-Control | Must be set to no-cache |
| Ocp-Apim-Subscription-Key | Your subscription key for API authentication |
Response Handling
The z-image turbo returns specific HTTP status codes and response bodies to indicate the success or failure of a request. Developers should implement error handling in their applications to manage these responses effectively.
Common Status Codes and Responses
| Status Code | Description | Response Body |
|---|---|---|
| 200 | Success - The request was successfully processed. | { "success": true, ... } |
| 400 | Bad Request - The request contains invalid parameters or missing fields. | { "error": "Invalid request parameters" } |
| 401 | Unauthorized - The provided subscription key is missing or invalid. | { "error": "Invalid or missing authentication" } |
| 403 | Forbidden - The subscription does not have access to this API or action. | { "error": "Access denied for this operation" } |
| 404 | Not Found - The requested resource or endpoint could not be found. | { "error": "Endpoint not found" } |
| 429 | Too Many Requests - The request rate limit has been exceeded. | { "error": "Rate limit exceeded, please retry later" } |
| 500 | Internal Server Error - An unexpected error occurred on the server. | { "error": "An unexpected error occurred, please try again later" } |
Example Error Response
{ "error": "Invalid parameters" } Retrieving Image Result and URL
After submitting your request, use this endpoint to check status and retrieve results.
Endpoint
POST https://gateway.pixazo.ai/z-image-turbo-834/v1/z-image-turbo-request-result
Request Body
{ "request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8" } Example Polling Request
curl -X POST "https://gateway.pixazo.ai/z-image-turbo-834/v1/z-image-turbo-request-result" \ -H "Content-Type: application/json" \ -H "Cache-Control: no-cache" \ -H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \ --data-raw '{ "request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8" }' Response States
| Status | Description |
|---|---|
| IN_QUEUE | The request is queued and waiting for processing. |
| IN_PROGRESS | The model is currently generating the image(s). |
| COMPLETED | Image generation succeeded. Results are available in the images array. |
| FAILED | The request failed. An error field describes the cause. |
Example Success Response
{ "status": "COMPLETED", "request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8", "images": [ { "url": "https://storage.pixazo.ai/output/a1b2c3d4.png", "width": 1333, "height": 1000, "content_type": "image/png" } ] } Example In-Progress Response
{ "status": "IN_PROGRESS", "request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8", "queue_position": 2 } Example Failed Response
{ "status": "FAILED", "request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8", "error": "Prompt failed safety check. Please refine your input." } z-image turbo API Pricing
| Resolution | Price (USD) |
|---|---|
| All Resolution | $0.008 |