GPT Image 2 — OpenAI Image Generation, One Endpoint
GPT Image 2 generates and edits images through one OpenAI-style API. Async tasks, credit pricing, two variants — production-ready in minutes.
- Highlights: 1K–4K resolution, mask editing, up to 4 images per request.
- Best for: Design assets, edits, and text rendering.
- Input: Text prompts, reference images, and optional masks.
- Output: Up to 4 images per request.
Key Features:
- Two Variants, One Endpoint: Use gpt-image-2 for the cost-effective basic channel (single image, flat per-resolution price) or gpt-image-2-official for the stable channel (batches up to four, quality tiers, inpainting masks, transparent backgrounds, output format control). Switch between channels by changing a single string in your request.
- Credit-Based Pricing: 1 credit equals $0.001 USD. Pricing is pay-as-you-go with no subscription or minimum commitment. Failed generations are automatically refunded.
- Async by Default: Submit a task and receive an ID instantly. Poll the task ID to get the result when it's ready. This pattern is suitable for serverless functions, queue workers, and edge runtimes.
- Image Editing Capabilities: Supports text-to-image, image-to-image with up to 16 reference URLs, and mask-based inpainting.
- Flexible Output: Generate images in various aspect ratios at 1K, 2K, or 4K resolutions. 4K resolution is available for specific widescreen aspect ratios.
- Transparent Backgrounds: The stable channel supports transparent background output in PNG format, ideal for product cutouts and UI assets.
Integration:
- Create an API Key: Sign up and generate a key from the dashboard. Free signup credits are available for initial testing.
- Submit a Generation: Send a POST request to /api/v1/images/generations with the model name and prompt.
- Poll for Results: GET /api/v1/tasks/:id to retrieve the image URLs from the CDN once the task is completed.