OpenAI logo
OpenAI

GPT-Image-1

OpenAI's latest 2025 image generation model with comprehensively improved understanding capabilities and image quality

Category Image Model ID gpt-image-1
ResolutionUp to 4K (4096x4096)
Model TypeImage Generation
Output FormatPNG, WEBP

ๅฎšไปทไธŽ่ง„ๆ ผ

๐Ÿ’ฐ ๅฎšไปท

ไปทๆ ผ$0.05 / image

โš™๏ธ ่ง„ๆ ผ

ResolutionUp to 4K (4096x4096)
Model TypeImage Generation
Output FormatPNG, WEBP
Generation Time~8 seconds

API ่ฐƒ็”จ็คบไพ‹

Python

from openai import OpenAI

client = OpenAI(
    base_url="https://api.xairouter.com/v1",
    api_key="your-api-key"
)

response = client.images.generate(
    model="gpt-image-1",
    prompt="A cat floating in space, cyberpunk style, 4K ultra HD",
    size="2048x2048",
    quality="hd",
    n=1,
)

image_url = response.data[0].url
print(image_url)

cURL

curl https://api.xairouter.com/v1/images/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "gpt-image-1",
    "prompt": "A cat floating in space, cyberpunk style, 4K ultra HD",
    "size": "2048x2048",
    "quality": "hd",
    "n": 1
  }'