What is GPT Image-2 API?
GPT Image-2 API gives developers and teams access to AI image generation through the public model id `gpt-image-2-origin` on UniAll AI. It supports both text-to-image and image-to-image workflows, including reference-image generation for product visuals, posters, social media graphics, brand concepts, and creative automation.
The model is suitable for teams that need programmable image generation rather than one-off manual prompting. Common users include ecommerce operators, marketing teams, SaaS builders, design automation tools, agencies, and developers building AI image workflows.
Core capabilities
GPT Image-2 supports:
- **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 inputs, with support for up to 6 reference images in the API schema.
- **Aspect ratio control**: `1:1`, `16:9`, `9:16`, `4:3`, `3:4`, `3:2`, `2:3`, and `4:5`.
- **Resolution tiers**: `1K`, `2K`, and `4K`.
- **Batch-style output count**: request 1, 2, or 4 images per call, with the interface allowing up to 8 where supported by configuration.
- **Async generation**: requests are processed asynchronously, which is useful for production apps and workflow queues.
API usage
Use the UniAll AI image generation endpoint with model id `gpt-image-2-origin`.
```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, omit `image_url` and set:
```json { "model": "gpt-image-2-origin", "generation_mode": "text_to_image", "prompt": "A modern ecommerce hero image for a minimalist skincare brand.", "aspect_ratio": "4:5", "resolution": "1K", "num_images": 1 } ```
Required fields by mode
| Mode | Required fields | |---|---| | `text_to_image` | `prompt` | | `image_to_image` | `prompt`, `image_url` |
The request interface also requires a size-related configuration through the supported output settings. In this model configuration, practical sizing is controlled through `aspect_ratio` and `resolution`.
Pricing angle
GPT Image-2 on UniAll AI is billed per generated image. Current listed user pricing starts at **$0.01836 per image for 1K** output.
Resolution-based pricing:
| Resolution | Price per image | |---|---:| | 1K | $0.01836 | | 2K | $0.05576 | | 4K | $0.11424 |
Because higher resolutions cost more, teams often prototype prompts at 1K, then generate final production assets at 2K or 4K after the creative direction is approved.
Best-fit use cases
GPT Image-2 is useful when you need repeatable image generation inside a product or business workflow:
- Ecommerce main images and product posters
- Product photography concepts
- Brand visual exploration
- Social media campaign assets
- Multi-reference image generation
- Character or style consistency experiments
- Automated creative pipelines for agencies and SaaS apps
Reliability and production notes
The model supports async requests, retry-on-failure behavior, and refund-on-failure handling according to the UniAll AI model configuration. For production use, implement task polling or callback handling, store prompt and parameter versions, and retry only idempotent jobs to avoid duplicate creative outputs.
常见问题
What is the public model id for GPT Image-2 API?
The public model id is `gpt-image-2-origin`. Use this value in the `model` field when calling the UniAll AI image generation endpoint.
Does GPT Image-2 support both text-to-image and image-to-image?
Yes. GPT Image-2 supports `text_to_image` with a prompt and `image_to_image` with both a prompt and reference image URLs. The configuration supports PNG, JPEG, and WebP reference images.
How is GPT Image-2 priced?
GPT Image-2 is billed per generated image. Listed user pricing starts at $0.01836 per image for 1K, with higher prices for 2K and 4K output.