Image GenerationGPT Image
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 |
|---|---|
| auto | 14 |
| low | 2 |
| medium | 5 |
| high | 14 |
For example, generating 3 images at "medium" quality costs 3 × 5 = 15 credits.
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
POST
/v2/images/generateTry it