GPT-Image 1.5 API Documentation
GPT-Image 1.5 API generate request - Request Code
POST https://gateway.pixazo.ai/gpt-image-1-5-api-923/v1/gpt-image-1-5-api-request Content-Type: application/json Cache-Control: no-cache Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY { "prompt": "create a realistic image taken with iphone at these coordinates 41°43′32″N 49°56′49″W 15 April 1912", "image_size": "1024x1024", "background": "auto", "quality": "high", "num_images": 1, "output_format": "png" } import requests url = "https://gateway.pixazo.ai/gpt-image-1-5-api-923/v1/gpt-image-1-5-api-request" headers = { "Content-Type": "application/json", "Cache-Control": "no-cache", "Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY" } data = { "prompt": "create a realistic image taken with iphone at these coordinates 41°43′32″N 49°56′49″W 15 April 1912", "image_size": "1024x1024", "background": "auto", "quality": "high", "num_images": 1, "output_format": "png" } response = requests.post(url, json=data, headers=headers) print(response.json()) fetch('https://gateway.pixazo.ai/gpt-image-1-5-api-923/v1/gpt-image-1-5-api-request', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Cache-Control': 'no-cache', 'Ocp-Apim-Subscription-Key': 'YOUR_SUBSCRIPTION_KEY' }, body: JSON.stringify({ prompt: 'create a realistic image taken with iphone at these coordinates 41°43′32″N 49°56′49″W 15 April 1912', image_size: '1024x1024', background: 'auto', quality: 'high', num_images: 1, output_format: 'png' }) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); curl -X POST "https://gateway.pixazo.ai/gpt-image-1-5-api-923/v1/gpt-image-1-5-api-request" \ -H "Content-Type: application/json" \ -H "Cache-Control: no-cache" \ -H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \ --data-raw '{ "prompt": "create a realistic image taken with iphone at these coordinates 41°43′32″N 49°56′49″W 15 April 1912", "image_size": "1024x1024", "background": "auto", "quality": "high", "num_images": 1, "output_format": "png" }' 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 GptImageApi { public static void main(String[] args) throws Exception { String json = """ { "prompt": "create a realistic image taken with iphone at these coordinates 41°43′32″N 49°56′49″W 15 April 1912", "image_size": "1024x1024", "background": "auto", "quality": "high", "num_images": 1, "output_format": "png" } """; HttpClient client = HttpClient.newBuilder() .connectTimeout(Duration.ofSeconds(10)) .build(); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://gateway.pixazo.ai/gpt-image-1-5-api-923/v1/gpt-image-1-5-api-request")) .header("Content-Type", "application/json") .header("Cache-Control", "no-cache") .header("Ocp-Apim-Subscription-Key", "YOUR_SUBSCRIPTION_KEY") .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/gpt-image-1-5-api-923/v1/gpt-image-1-5-api-request'; $data = json_encode([ 'prompt' => 'create a realistic image taken with iphone at these coordinates 41°43′32″N 49°56′49″W 15 April 1912', 'image_size' => '1024x1024', 'background' => 'auto', 'quality' => 'high', 'num_images' => 1, 'output_format' => 'png' ]); $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Content-Type: application/json', 'Cache-Control: no-cache', 'Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY' ]); $response = curl_exec($ch); curl_close($ch); echo $response; ?> Output
Successful API response:
{ "status": "IN_QUEUE", "request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8", "response_url": "https://gateway-falai-automate.appypie.workers.dev/gpt-image-1-5-api-request-result" } Request Body - GPT-Image 1.5 API generate request
Parameters for /gpt-image-1-5-api-request:
| Parameter | Required | Type | Description |
|---|---|---|---|
| prompt | Yes | string | A detailed text description of the desired image. The model interprets this prompt to generate visuals with high fidelity. |
| image_size | No | string | Dimensions of the generated image. Supports standard aspect ratios. |
| background | No | string | Background handling mode. Use "auto" for intelligent background inference, or specify a color/texture if supported. |
| quality | No | string | Rendering quality level. "high" produces more detailed outputs with longer processing. "standard" is faster but less detailed. |
| num_images | No | integer | Number of distinct images to generate in a single request. |
| output_format | No | string | File format of the generated image. Supported formats: "png", "jpeg", "webp". |
Example Request - GPT-Image 1.5 API generate request
JSON
{ "prompt": "create a realistic image taken with iphone at these coordinates 41°43′32″N 49°56′49″W 15 April 1912", "image_size": "1024x1024", "background": "auto", "quality": "high", "num_images": 1, "output_format": "png" } Response - GPT-Image 1.5 API generate request
JSON
{ "status": "IN_QUEUE", "request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8", "response_url": "https://gateway-falai-automate.appypie.workers.dev/gpt-image-1-5-api-request-result" } 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 authentication |
Response Handling
The GPT-Image 1.5 API 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/gpt-image-1-5-api-923/v1/gpt-image-1-5-api-request-result
Request Body
{ "request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8" } Code Examples
POST https://gateway.pixazo.ai/gpt-image-1-5-api-923/v1/gpt-image-1-5-api-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/gpt-image-1-5-api-923/v1/gpt-image-1-5-api-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()) fetch('https://gateway.pixazo.ai/gpt-image-1-5-api-923/v1/gpt-image-1-5-api-request-result', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Cache-Control': 'no-cache', 'Ocp-Apim-Subscription-Key': 'YOUR_SUBSCRIPTION_KEY' }, body: JSON.stringify({ request_id: 'a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8' }) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); curl -X POST "https://gateway.pixazo.ai/gpt-image-1-5-api-923/v1/gpt-image-1-5-api-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 GptImagePolling { public static void main(String[] args) throws Exception { String json = """ { "request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8" } """; HttpClient client = HttpClient.newBuilder() .connectTimeout(Duration.ofSeconds(10)) .build(); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://gateway.pixazo.ai/gpt-image-1-5-api-923/v1/gpt-image-1-5-api-request-result")) .header("Content-Type", "application/json") .header("Cache-Control", "no-cache") .header("Ocp-Apim-Subscription-Key", "YOUR_SUBSCRIPTION_KEY") .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/gpt-image-1-5-api-923/v1/gpt-image-1-5-api-request-result'; $data = json_encode([ 'request_id' => 'a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8' ]); $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Content-Type: application/json', 'Cache-Control: no-cache', 'Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY' ]); $response = curl_exec($ch); curl_close($ch); echo $response; ?> Response States
| Status | Description |
|---|---|
| IN_QUEUE | Request has been received and is waiting in the processing queue. |
| IN_PROGRESS | The image generation process is actively running. |
| COMPLETED | Generation completed successfully. Result data is available in the response. |
| FAILED | The request failed due to an error (e.g., invalid prompt, quota exceeded). Check the error field for details. |
Example Success Response
{ "status": "COMPLETED", "request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8", "images": [ { "url": "https://storage.pixazo.ai/images/a1b2c3d4.png", "width": 1024, "height": 1024, "content_type": "image/png", "size_bytes": 2048576 } ], "metadata": { "prompt": "create a realistic image taken with iphone at these coordinates 41°43′32″N 49°56′49″W 15 April 1912", "image_size": "1024x1024", "quality": "high", "output_format": "png", "processing_time_ms": 4320 } } Example In-Progress Response
{ "status": "IN_PROGRESS", "request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8", "queue_position": 2, "estimated_wait_minutes": 1.5 } 