Overview
GPT-Image-1 supports generating high-quality images from text prompts, fully compatible with OpenAI’s official Image Generation API format.Key Features
- 🎨 High-Quality Image Generation: Creates detailed images that match your prompts
- 🚀 Fast Response: Optimized generation speed for quick results
- 💰 Flexible Billing: Supports token-based ($2.50/M input, $8.00/M output) or per-image billing ($0.005-$0.052/image)
- 🔧 Full Compatibility: 100% compatible with OpenAI Image API format
- 🆕 Multiple Models: Available in both gpt-image-1 and gpt-image-1-mini versions
Quick Start
Basic Configuration
Generate Images
Call using standard OpenAI Image API format:API Parameters
Request Parameters
Parameter Details
Size Options (size)
1024x1024- Square (fastest generation by default)1536x1024- Landscape/horizontal mode1024x1536- Portrait/vertical modeauto- Model automatically selects best size based on prompt (default)
Quality Options (quality)
low- Low quality, fastest generationmedium- Medium qualityhigh- High quality, most detailedauto- Model automatically selects based on prompt (default)
Output Format (output_format)
png- Lossless compression, default formatjpeg- Lossy compression, supports compression level, faster generationwebp- Modern format, smaller files, supports compression level
jpeg or webp, control compression level with output_compression parameter (0-100%). For example, output_compression=50 compresses the image by 50%.
Background Options (background)
transparent- Transparent background (for PNG/WebP)opaque- Opaque backgroundauto- Model automatically selects (default)
Response Format
Models & Pricing
Available Models
APIYI supports two GPT-Image series models:gpt-image-1
Standard version with full image generation capabilities
gpt-image-1-mini
Lightweight version with faster generation and lower cost
Pricing Options
GPT-Image-1 supports two billing methods, automatically selecting the most cost-effective option:1. Token-Based Billing (Pay-as-you-go)
Ideal for scenarios requiring precise cost control:Token-based billing charges based on prompt length (input) and generated image data volume (output), providing controllable costs.
2. Per-Image Billing (Pay-per-use)
Ideal for batch generation or fixed cost requirements: Low Quality
Medium Quality
High Quality
Model Comparison
Usage Examples
Python Example
Node.js Example
cURL Example
Prompt Optimization Tips
1. Detailed Descriptions
Provide specific, detailed descriptions for better results:2. Style Specification
Explicitly specify the desired artistic style:3. Composition and Perspective
Specifying composition and perspective yields more precise results:Batch Generation
Example of generating multiple images in batch:Error Handling
Common Error Codes
Error Handling Example
Best Practices
1. Prompt Length Control
While max 1000 characters is supported, typically 100-200 characters of detailed description yields excellent results.2. Image Size and Quality Selection
Size Recommendations:1024x1024: General scenarios, fastest generation1536x1024: Landscape composition, suitable for scenery, banners1024x1536: Portrait composition, suitable for portraits, postersauto: Let model automatically choose based on content
low: Quick preview, batch generationmedium: Daily usehigh: Professional use, print outputauto: Model automatic optimization
png: Need transparent background or lossless qualityjpeg: Prioritize speed and smaller fileswebp: Modern web applications, best compression ratio
3. Content Moderation
Generated images are automatically moderated to ensure compliance with usage policies. Avoid requesting generation of:- Violent or disturbing imagery
- Adult content
- Hateful or discriminatory content
- Misleading or false information
- Copyright-infringing content
4. Cost Optimization
- Use smaller sizes for testing and previewing
- Set reasonable concurrency limits for batch generation
- Cache generated image URLs to avoid duplicate generation
Comparison with Sora Image
FAQ
Q: Can generated images be used commercially?
A: Yes, you own full rights to images generated via the API and can use them for commercial purposes.Q: How long are image URLs valid?
A: Generated image URLs are typically valid for 24 hours. We recommend downloading and saving them promptly.Q: Are Chinese prompts supported?
A: Yes, but English prompts are recommended for best results.Q: How to improve generated image quality?
A: Use detailed, specific descriptions including style, lighting, composition, and other details.Related Resources
- OpenAI Official API Documentation:
platform.openai.com/docs/api-reference/images/create - OpenAI Official Image Generation Guide:
platform.openai.com/docs/guides/images - APIYI Console
- Technical Support:
support@apiyi.com
GPT-Image-1 offers flexible billing options: token-based (input $2.50/M, output $8.00/M) or per-image ($0.005-$0.052/image). The system automatically selects the more cost-effective method. Also available in gpt-image-1-mini for rapid prototyping and batch generation scenarios.