GPT Image 1.5
OpenAI's GPT Image 1.5 model for high-quality text-to-image generation and image editing.
POST /v2/images/generate — model: "gpt-image-1.5"
OpenAI's GPT Image 1.5 generates high-quality images from text prompts and supports image editing via input images. It offers tiered quality settings that trade off between cost and fidelity.
See Image Generation overview for common request fields, response format, and error codes.
Model-specific parameters
| Parameter | Type | Description |
|---|---|---|
gptImageParams.quality | string | Image quality tier. Values: "auto" (default), "low", "medium", "high" |
gptImageParams.aspect_ratio | string | Aspect ratio. Values: "1:1" (default), "3:2", "2:3" |
gptImageParams.output_format | string | Output format. Values: "webp" (default), "png", "jpeg" |
gptImageParams.background | string | Background mode. Values: "auto" (default), "transparent", "opaque" |
gptImageParams.input_images | string[] | Array of image URLs for editing / style reference (nullable) |
gptImageParams.input_fidelity | string | Fidelity to input image features. Values: "low" (default), "high" |
gptImageParams.number_of_images | integer | Number of images to generate (1–10, default 1) |
Credit cost
Credits are determined by the quality parameter and multiplied by number_of_images.
| Quality | Credits per image |
|---|---|
| low | 4 |
| medium | 9 |
| auto | 24 |
| high | 24 |
For example, generating 3 images at "medium" quality costs 3 × 9 = 27 credits.
Example result
Once the job is COMPLETED, the result object on GET /v2/jobs/:id looks like:
{
"images": [
"https://cdn2.apiframe.ai/images/a1b2c3d4-e5f6-7890-abcd-ef1234567890-1.png"
]
}images contains one URL per generated image when gptImageParams.number_of_images is greater than 1.
See Result format for field details.
Code examples
curl -X POST https://api.apiframe.ai/v2/images/generate \
-H "X-API-Key: afk_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A whimsical watercolor painting of a fox reading a book in a sunlit forest clearing",
"model": "gpt-image-1.5",
"gptImageParams": {
"quality": "high",
"aspect_ratio": "3:2",
"output_format": "png"
}
}'import requests
response = requests.post(
"https://api.apiframe.ai/v2/images/generate",
headers={
"X-API-Key": "afk_your_api_key_here",
"Content-Type": "application/json",
},
json={
"prompt": "A whimsical watercolor painting of a fox reading a book in a sunlit forest clearing",
"model": "gpt-image-1.5",
"gptImageParams": {
"quality": "high",
"aspect_ratio": "3:2",
"output_format": "png",
},
},
)
print(response.json())const response = await fetch("https://api.apiframe.ai/v2/images/generate", {
method: "POST",
headers: {
"X-API-Key": "afk_your_api_key_here",
"Content-Type": "application/json",
},
body: JSON.stringify({
prompt: "A whimsical watercolor painting of a fox reading a book in a sunlit forest clearing",
model: "gpt-image-1.5",
gptImageParams: { quality: "high", aspect_ratio: "3:2", output_format: "png" },
}),
});
console.log(await response.json());Try it
/v2/images/generateTry it