Sign in to sync history and unlock more features
Developer Resources

GPT Image 1.5 API Documentation

Integrate OpenAI's GPT Image 1.5 model into your applications. Support for text-to-image and image-to-image generation with simple REST API.

1

Authentication

The GPT Image 1.5 API uses Bearer Token authentication. Pass your API Key in the request header.

Authentication
Authorization: Bearer sk-your-api-key-here

Keep your API key secure. Do not share it in client-side code.

Pricing

TypeCostDescription
Text to Image10 CreditsGenerate images from text prompts.
Image to Image10 CreditsEdit existing images with text prompts.
2

Create Task

POSThttps://gptimage15.ai/api/generate
Async Generation

Pricing

Each generation request costs 10 Credits, regardless of whether it's text-to-image or image-to-image.

Initiate a generation task. The API returns a task_id immediately, which you use to poll for results.

Body Parameters

ParameterTypeRequiredDescription
promptstringRequiredThe text description for image generation. Max 2000 characters.
sizestringOptionalImage size: 1024*1024, 1024*1536, or 1536*1024. Default: 1024*1024
qualitystringOptionalImage quality: low, medium, or high. Default: medium
imagesarrayOptionalFor Image-to-Image mode. Array of image URLs to edit.
input_fidelitystringOptionalFidelity to input image: low or high. Default: high. Only for image-to-image.
callback_urlstringOptionalWebhook URL for task completion notification.

Request Examples

Text-to-Image (cURL)
curl -X POST https://gptimage15.ai/api/generate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A serene mountain landscape...",
    "size": "1536*1024",
    "quality": "high"
  }'
Image-to-Image (Edit Mode)
{
  "prompt": "Add a rainbow in the sky",
  "images": [
    "https://example.com/landscape.jpg"
  ],
  "input_fidelity": "high",
  "quality": "medium"
}
Success Response
{
  "code": 200,
  "data": {
    "task_id": "n36abc123def456gptimg",
    "status": "IN_PROGRESS"
  }
}
Error Response
{
  "code": 400,
  "message": "Bad Request: 'prompt' is required.",
  "data": null
}
3

Check Status

GEThttps://gptimage15.ai/api/status

Poll this endpoint to check the progress of your task. We recommend polling every 5-10 seconds.

Query Parameters

ParameterTypeDescription
task_idstringThe task ID received from the generate endpoint. Required

Status Values

PENDINGTask is queued
IN_PROGRESSProcessing
SUCCESSCompleted
FAILEDError occurred
cURL
curl -X GET "https://gptimage15.ai/api/status?task_id=n36abc123def456gptimg" \
  -H "Authorization: Bearer YOUR_API_KEY"
Response (In Progress)
{
  "code": 200,
  "data": {
    "task_id": "n36abc123def456gptimg",
    "status": "IN_PROGRESS",
    "consumed_credits": 10,
    "created_at": "2024-12-19T10:00:00Z"
  }
}
Response (Completed)
{
  "code": 200,
  "data": {
    "task_id": "n36abc123def456gptimg",
    "status": "SUCCESS",
    "response": [
      "https://cdn.example.com/image.png"
    ]
  }
}
Response (Failed)
{
  "code": 200,
  "message": "success",
  "data": {
    "task_id": "n36abc123def456gptimg",
    "status": "FAILED",
    "consumed_credits": 0,
    "error_message": "Content policy violation detected",
    "created_at": "2024-12-19T10:00:00Z",
    "request": { ... },
    "response": null
  }
}

Error Codes

CodeDescription
200Success
400Bad Request - Invalid parameters (missing prompt, invalid size/quality, etc.)
401Unauthorized - Missing or invalid API key
404Not Found - Task ID does not exist
500Internal Server Error - Please retry or contact support

Need Help?

Check out our support channel or email us.

Contact Support