Skip to main content
The GPT-Image-1 models are earlier GPT Image versions. Use GPT Image 2.5 for new integrations and migrate existing ones early.
  • gpt-image-1, gpt-image-1.5, and gpt-image-1-mini are still in LaoZhang API’s public pricing as of September 24, 2026, so you can keep calling them for now.
  • OpenAI plans to remove gpt-image-1 from its API on October 23, 2026.
  • OpenAI plans to remove gpt-image-1.5 and gpt-image-1-mini on December 1, 2026 (see OpenAI deprecations).
  • LaoZhang API stops serving each model at the same time.

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 openai 0.x SDK (openai.api_base and openai.Image.create).
  • Both the Python and Node.js examples read the result from url. If the response contains b64_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 mode
  • 1024x1536 - Portrait mode
  • auto - Model automatically selects optimal 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 levels, faster generation
  • webp - Modern format, smaller files, supports compression levels
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

For GPT Image models, OpenAI’s official API returns only base64-encoded images (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: 1024x1024 for general use; 1536x1024 landscape for scenery and banners; 1024x1536 portrait for portraits and posters.
  • Quality: low for quick previews and batch generation, medium for daily use, high for professional use and print output.
  • Format: png when you need a transparent background or lossless quality, jpeg for speed and smaller files, webp for 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 a url, 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.