Documentation
GPT Image 1.5 AI - Query Status
Check the status and retrieve results of a GPT Image 1.5 AI generation task (V2 API).
https://gptimage15.ai/api/v2/status?task_id={task_id}Retrieve the status and results of a previously submitted GPT Image 1.5 AI task.
Headers
Query Parameters
task_idRequiredThe task ID returned from the generate API endpoint. Used to identify and retrieve the specific task.
Example: nprob71e549f645122eb8db5f75af2c11nono
Response Examples
Task Processing
When the task is still being processed, the response will have status: 0 and response: null.
Task is still processing.
Response Schema
Task Completed
When the task is completed successfully, the response will have status: 1 and the response field will contain the generated image URL(s).
Task completed successfully with generated images.
Response Schema
Task Failed
When the task fails, the response will have status: -1 and the error_message field will contain the error details.
Task failed with error message.
Response Schema
Response Fields
task_idThe unique identifier for this task.
requestImportant: This is a JSON string, not an object. You need to parse it using JSON.parse() to access the original request parameters.
Example: const params = JSON.parse(data.request)
responseImportant: This is a JSON string containing an array of image URLs, not a direct array. You need to parse it using JSON.parse() to access the URLs. Returns null when processing or failed.
Example: const urls = JSON.parse(data.response)
statusTask status indicator:
0- Processing1- Completed successfully-1- Failed
consumed_creditsNumber of credits consumed for this task (always 24 for GPT Image 1.5 AI).
created_atTimestamp when the task was created (format: YYYY-MM-DD HH:MM:SS).
error_message Error message when task fails. null when processing or completed successfully.
Usage Example
Here's a complete example showing how to properly parse the response data:
// Fetch task status
const response = await fetch(
'https://gptimage15.ai/api/v2/status?task_id=npro...nono'
);
const result = await response.json();
if (result.code === 200 && result.data) {
const taskData = result.data;
// Parse the request field (JSON string)
const requestParams = JSON.parse(taskData.request);
console.log('Prompt:', requestParams.prompt);
console.log('Aspect Ratio:', requestParams.aspect_ratio);
// Check task status
if (taskData.status === 1) {
// Task completed - parse response field (JSON string)
const imageUrls = JSON.parse(taskData.response);
console.log('Generated Images:', imageUrls);
// Download or display images
imageUrls.forEach((url, index) => {
console.log('Image ' + (index + 1) + ': ' + url);
});
} else if (taskData.status === 0) {
console.log('Task is still processing...');
} else if (taskData.status === -1) {
console.error('Task failed:', taskData.error_message);
}
}Polling Recommendation
Tasks are processed asynchronously. We recommend the following polling strategy:
- Wait 2-3 seconds before the first status check
- Poll every 1-2 seconds while status is
0 - Stop polling when status is
1(completed) or-1(failed) - Typical generation time: 5-30 seconds depending on parameters
Error Responses
Missing task_id parameter.
{
"code": 400,
"message": "task_id is required",
"data": null
}Task not found with the provided task_id.
{
"code": 404,
"message": "Task not found",
"data": null
}Server error, please try again later.
{
"code": 500,
"message": "Internal Server Error, please try again later or contact support.",
"data": null
}