GPT Image-2 API overview
GPT Image-2 is an image generation model for creating visuals from text prompts or transforming images with reference inputs. On UniAll AI, the public model ID is `gpt-image-2-origin`.
It supports common production workflows such as marketing creatives, product posters, concept art, social media visuals, reference-guided image generation, and automated image pipelines.
Key capabilities
- **Text to image**: generate images from a prompt.
- **Image to image**: use one or more reference images with a prompt.
- **Reference images**: upload PNG, JPEG, or WebP references.
- **Aspect ratios**: `1:1`, `16:9`, `9:16`, `4:3`, `3:4`, `3:2`, `2:3`, `4:5`.
- **Resolution tiers**: `1K`, `2K`, and `4K`.
- **Async API**: requests are submitted asynchronously for generation jobs.
GPT Image-2 API pricing
GPT Image-2 is billed per generated image. Pricing depends on the selected resolution tier:
| Resolution | Price per image | |---|---:| | 1K | $0.01836 | | 2K | $0.05576 | | 4K | $0.11424 |
The default listed price is **$0.01836 per image** for 1K output. If you request multiple images, the total cost scales with `num_images` and the selected `resolution`.
UniAll AI supports refund on failure and retry on failure for this model, with up to 2 failure retries.
Who should use GPT Image-2?
GPT Image-2 is suitable for:
- Developers building AI image generation into apps or workflows.
- Marketing teams producing campaign and social media assets.
- E-commerce teams creating product-style visuals and posters.
- Design teams exploring visual directions from prompts or references.
- Automation teams that need API-based text-to-image or image-to-image generation.
API usage
Endpoint:
```http POST /v1/images/generations ```
Example request body:
```json { "model": "gpt-image-2-origin", "generation_mode": "image_to_image", "image_url": ["https://example.com/reference-1.png"], "prompt": "A premium product poster with clean lighting and sharp details.", "aspect_ratio": "1:1", "resolution": "1K", "num_images": 1 } ```
For text-to-image generation, use `generation_mode: "text_to_image"` and provide a `prompt`. For image-to-image generation, provide both `prompt` and `image_url`.
Pricing guidance
Choose `1K` for drafts, thumbnails, and high-volume testing. Use `2K` when you need sharper production assets. Select `4K` for high-detail outputs, print-oriented concepts, or premium visual work where resolution matters more than cost.
Because billing is per output image, you can control spend by lowering `num_images`, testing prompts at `1K`, and only moving final prompts to higher resolution tiers.
常见问题
How much does the GPT Image-2 API cost?
On UniAll AI, GPT Image-2 pricing starts at $0.01836 per 1K image. The 2K tier is $0.05576 per image, and the 4K tier is $0.11424 per image.
What is the model ID for GPT Image-2?
The public model ID is `gpt-image-2-origin`. Use this value in the `model` field when calling the API.
Does GPT Image-2 support both text-to-image and image-to-image?
Yes. GPT Image-2 supports text-to-image generation with a prompt and image-to-image generation with a prompt plus reference image URLs.