GPT Image 2 complete guide: text-to-image, editing, style control
How to get reliable, high-quality output from GPT Image 2 and the Images API: prompt structure, style control, image editing, and cost.
How to
Write a structured prompt
Use the "subject + style + lens/aperture + background + aspect" five-part form: "An orange tabby cat on a windowsill, photorealistic, shallow depth of field, soft-lit background, 3:2."
Call the Images API for your first generation
POST /v1/images/generations with model="gpt-image-2", prompt=..., size="1024x1024", quality="medium", n=1. The response carries b64_json.
Pick a style: natural (realistic) vs vivid (dramatic)
Vivid leans dramatic with saturated colours; natural is restrained and realistic. Run the same prompt with both values and pick.
Use the edits endpoint for inpainting
POST /v1/images/edits with the original image plus a same-sized PNG mask (transparent area = repaint) and a prompt; the model only repaints the masked region.
Pre-launch Usage Policy self-check
Pull the latest prices from openai.com/api/pricing. Don't generate real people, unauthorised brands, or disallowed content. Preserve provenance metadata on commercial assets.
GPT Image 2 complete guide: text-to-image, editing, style control
GPT Image is OpenAI's text-to-image model family. GPT Image 2 is available through both ChatGPT and the Images API and supports generation, edits, and variations.
1. Overview
GPT Image 2 is OpenAI's flagship text-to-image model — a major quality jump over its predecessors. Prompting, style control, and editing each have their own gotchas. This handbook covers the prompt framework, style keywords, inpainting, and pricing.
2. Key points
- GPT Image 2 prompt formula: subject + style + lens/aperture + background + aspect — be specific
- Two styles: natural (photorealistic) and vivid (more dramatic and artistic)
- Image edits take a mask for inpainting; variations generate alternate takes of an input image
- Images API supports size (1024x1024, 1024x1536, 1536x1024, or 'auto'), quality (low/medium/high), and n (count)
- Pricing is per output token (~$40 per 1M); higher quality and larger sizes cost more — check the Usage Policy before commercial use
3. How it works
The sections below unpack each point. Skim alongside the OpenAI documentation for full context.
4. Practical steps
- Define 'done' up front — what does success look like?
- Pick the right model using the comparison above.
- Run the minimal example end to end; record parameters and the model version.
- Integrate into your existing code.
- Monitor logs and failure modes; review weekly.
5. Common errors and fixes
- 401: invalid or expired API key — rotate it.
- 429: rate limit hit — enable exponential backoff retries.
- 400: bad request — verify the model name and messages shape.
- Poor quality output: try a different model, add few-shot examples, trim the prompt.
6. Next steps
Once you are comfortable here, continue with:
- ChatGPT Complete Guide (2026): From Beginner to Expert
- Prompt Engineering Core Patterns: 8 Templates That 2x GPT Output
- OpenAI API Beginner: Your First GPT-5.6 Call
Key points
- GPT Image 2 prompt formula: subject + style + lens/aperture + background + aspect — be specific
- Two styles: natural (photorealistic) and vivid (more dramatic and artistic)
- Image edits take a mask for inpainting; variations generate alternate takes of an input image
- Images API supports size (1024x1024, 1024x1536, 1536x1024, or 'auto'), quality (low/medium/high), and n (count)
- Pricing is per output token (~$40 per 1M); higher quality and larger sizes cost more — check the Usage Policy before commercial use
❓ Frequently asked questions
Official references
Subscribe to GPTMap Weekly
One email every Monday: curated OpenAI updates, deep dives, and best practices. No ads, unsubscribe anytime.