GPT Image 2 API
imageState-of-the-art image generation model for fast, high-quality image generation and editing
Integrate GPT Image 2 image generation into your product with a single API call. No GPUs to manage, no infrastructure to maintain.

Start generating in minutes
A single API call is all you need to generate images with GPT Image 2.
import GetimgAI from "getimg-ai";
const client = new GetimgAI();
const result = await client.images.generate({
model: "gpt-image-2",
prompt: "3D balerina made out of tiny dust-like voxels, looking to the left, smoothly desintegrating into background, medium portrait shot, purple monochrome",
aspect_ratio: "1:1",
resolution: "1K",
output_format: "jpeg"
});
console.log(result.data[0].url);How GPT Image 2 API works
Send a prompt, receive a generated image — all in a single request.
Send a request
Make a POST request with your prompt and desired output format. Use any HTTP client.
Get your image
The response includes your generated image URL and a usage object showing the exact cost.
What you can build with GPT Image 2
Add AI image generation to any product or workflow.
Design tools
Embed AI image generation in design, writing, or chat applications. Let users create visuals from text without leaving your product.
Marketing automation
Generate ad creatives, social media graphics, and campaign visuals at scale. Produce hundreds of variations without a design team.
E-commerce
Create product images, lifestyle shots, and listing visuals automatically. Turn product descriptions into professional imagery.
Rapid prototyping
Turn rough ideas into tangible visuals instantly. Generate mockups, concept art, and visual references in seconds instead of hours.
GPT Image 2 pricing
Pay per image. No subscriptions, no idle costs.
GPT Image 2
$0.06 – $0.12 /image
/v2/images/generationsState-of-the-art image generation model for fast, high-quality image generation and editing
| Resolution | Price | Images for $10 |
|---|---|---|
| 1K | $0.06 /image | 166 |
| 2K | $0.12 /image | 83 |
GPT Image 2 API — frequently asked questions
How do I use the GPT Image 2 API?
Make a POST request to the /v2/images/generations endpoint with your API key and a JSON body containing the model ID (gpt-image-2) and a prompt. The response includes the generated image URL.
Check the API documentation for the full parameter reference.
What resolutions does GPT Image 2 support?
GPT Image 2 supports the following resolutions: 1K, 2K across 9 aspect ratios (1:1, 2:3, 3:2, 4:3, 3:4, 4:5, 16:9, 9:16, 21:9).
How much does GPT Image 2 cost?
GPT Image 2 uses pay-per-image pricing with no subscriptions or minimum commitments. Rates vary by resolution. See the pricing table above for exact rates per image.
Does GPT Image 2 support reference images?
Yes. GPT Image 2 accepts up to 10 reference images. Reference images let you guide the generation towards a specific style, composition, or subject.
Start building with GPT Image 2
Get your API key and start generating images in minutes.
Looking for other models? View all available models