Skip to main content
GPT-Image-1 is OpenAI’s image generation model, providing high-quality image generation capabilities. Use it through APIYI with the standard OpenAI Image API format. For faster speed and stronger text rendering, check out GPT-Image-1.5.

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 mode
  • 1024x1536 - Portrait/vertical mode
  • auto - Model automatically selects best size based on prompt (default)

Quality Options (quality)

  • low - Low quality, fastest generation
  • medium - Medium quality
  • high - High quality, most detailed
  • auto - Model automatically selects based on prompt (default)
Performance Tip: Square images + standard quality generate fastest. For latency-sensitive applications, use jpeg format instead of png.

Output Format (output_format)

  • png - Lossless compression, default format
  • jpeg - Lossy compression, supports compression level, faster generation
  • webp - Modern format, smaller files, supports compression level
When using 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 background
  • auto - 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
The system automatically selects the more cost-effective billing method. You don’t need to choose manually. Final charges are based on actual usage.

Model Comparison

For budget-conscious scenarios or rapid iteration needs, we recommend gpt-image-1-mini. For production environments requiring the best quality, we recommend gpt-image-1.

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 generation
  • 1536x1024: Landscape composition, suitable for scenery, banners
  • 1024x1536: Portrait composition, suitable for portraits, posters
  • auto: Let model automatically choose based on content
Quality Recommendations:
  • low: Quick preview, batch generation
  • medium: Daily use
  • high: Professional use, print output
  • auto: Model automatic optimization
Format Selection:
  • png: Need transparent background or lossless quality
  • jpeg: Prioritize speed and smaller files
  • webp: 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.
  • 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.