Model Overview
gpt-image-1 is one of OpenAI’s earlier GPT Image models and generates images from text prompts; the same family includes gpt-image-1.5 and gpt-image-1-mini.
On LaoZhang API, call them in the OpenAI Images API format: send generation requests to POST https://api.laozhang.ai/v1/images/generations, and with the official OpenAI SDK, set the base URL to https://api.laozhang.ai/v1. Usage is billed by tokens; see Pricing and groups below.
Pricing and groups
Public pricing as of September 24, 2026 (USD per 1M tokens):
All three models are available in the following groups. Set the token’s billing mode to Usage first (按量优先, recommended) or Usage-based (按量计费).
Input images in edit requests are billed as image input tokens, and OpenAI’s pricing page lists every official rate. Current prices are in the model and pricing catalog, and the call logs show what each request was actually charged.
Make requests
Quick Start
The examples on this page use older code:- Except for the error-handling example, the Python examples rely on the
openai0.x SDK (openai.api_baseandopenai.Image.create). - Both the Python and Node.js examples read the result from
url. If the response containsb64_json, save it as described under Response Format.
Basic Configuration
Generate Images
Using standard OpenAI Image API format:Usage Examples
Python Example
Node.js Example
cURL Example
Batch Generation
Example of batch image generation:Error Handling
Common Error Codes
Error Handling Example
API Parameters
Request Parameters
Parameter Details
Size Options (size)
1024x1024- Square (fastest generation by default)1536x1024- Landscape mode1024x1536- Portrait modeauto- Model automatically selects optimal 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 levels, faster generationwebp- Modern format, smaller files, supports compression levels
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
b64_json), never url.
Through LaoZhang API, each item in data[] can contain either b64_json or url, so handle both when saving. For code that saves either format, see Save and check the image in the GPT Image 2.5 guide.
Recommendations
Prompt Optimization Tips
1. Detailed Descriptions
Provide specific, detailed descriptions for better results:2. Style Specification
Explicitly specify desired artistic style:3. Composition and Perspective
Specifying composition and perspective yields more precise results:Best Practices
1. Prompt Length Control
Prompts can be up to 32000 characters, but a detailed description of 100-200 characters usually works well.2. Image Size and Quality Selection
Parameter Details explains each value and its default. Choose by use case:- Size:
1024x1024for general use;1536x1024landscape for scenery and banners;1024x1536portrait for portraits and posters. - Quality:
lowfor quick previews and batch generation,mediumfor daily use,highfor professional use and print output. - Format:
pngwhen you need a transparent background or lossless quality,jpegfor speed and smaller files,webpfor modern web apps (best compression ratio).
3. Content Moderation
Generated images are automatically moderated to ensure compliance with usage policies. Avoid requesting generation of:- Violent or disturbing images
- Adult content
- Hateful or discriminatory content
- Misleading or false information
- Copyright-infringing content
4. Cost Optimization
- Use smaller sizes for testing and preview
- Set reasonable concurrency for batch generation
- Cache generated image URLs to avoid regeneration
Difference from Sora Image
Sora Image is no longer in the public model catalog. Its legacy integration is documented in Sora Image generation (archived).FAQ
Q: Can I use generated images commercially?
A: Use of generated content is subject to OpenAI’s usage policies and the LaoZhang API Terms of Service.Q: How long are image URLs valid?
A: When the response contains aurl, the link expires, so download the image as soon as you get the response. A b64_json result can be decoded and saved directly.
Q: Are Chinese prompts supported?
A: Supported, but English prompts are recommended for best results.Q: How to improve generated image quality?
A: Use detailed, specific descriptions including style, lighting, composition details.Related Resources
- GPT Image 2.5 API: generate and edit images with the current models
- GPT Image 2 API: groups, billing, and editing
- Choose an image generation API: compare the image models on sale now
- GPT-Image-1 image editing (archived)
- Model and pricing catalog
- OpenAI image generation guide
- LaoZhang API Console
- Technical Support