GPT Image 1.5 AI - Generate

Generate high-quality images using GPT Image 1.5 AI model (V2 API).

Authentication Required

This API requires authentication with a Bearer token. Get your API key from Dashboard > API Keys .

POST
https://gptimage15.ai/api/v2/generate

Generate an image using GPT Image 1.5 AI model with advanced parameters.

Headers

Content-Type
application/json
Authorization
Bearer ${your-api-key-here}
Get your API Key in API Keys

Request Body

JSON
1
{
2
"prompt": "A futuristic city at sunset, highly detailed, 8k resolution",
3
"aspect_ratio": "16:9",
4
"size": "2K",
5
"format": "png",
6
"images": [
7
"https://example.com/reference-image.jpg"
8
]
9
}

Request Parameters

promptRequired
string

Text description of the image you want to generate. Be descriptive for better results.

aspect_ratioOptional
string

Aspect ratio of the output image. Default: 1:1

Supported values: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9

sizeOptional
string

Resolution quality of the output image. Default: 1K

Supported values: 1K, 2K, 4K

formatOptional
string

Output image format. Default: png

imagesOptional
string[]

Array of image URLs to use as reference or for image-to-image generation. When provided, the model will use these images as input for transformation.

Example: ["https://example.com/image1.jpg", "https://example.com/image2.jpg"]

Response

Successful response with the task ID. The task is processed asynchronously.

Response Schema

JSON
1
{
2
"code": 200,
3
"message": "success",
4
"data": {
5
"task_id": "nprob71e549f645122eb8db5f75af2c11nono"
6
}
7
}

Credit Consumption

Each generation request consumes 24 credits from your account balance.

Next Steps

After receiving the task_id from the response, you need to poll the status endpoint to check the generation progress and retrieve the result.

View Status API Documentation →

Error Responses

400 Bad Request

Missing required parameters or invalid values.

{
  "code": 400,
  "message": "Bad Request: 'prompt' is required.",
  "data": null
}
401 Unauthorized

Missing or invalid API key.

{
  "code": 401,
  "message": "Unauthorized: Missing or invalid API key.",
  "data": null
}
402 Insufficient Credits

Not enough credits in your account.

{
  "code": 402,
  "message": "Insufficient credits. Please recharge your account.",
  "data": null
}
500 Internal Server Error

Server error, please try again later.

{
  "code": 500,
  "message": "Internal Server Error, please try again later or contact support.",
  "data": null
}