OpenAI: GPT Image 2
Imageopenai/gpt-image-2GPT Image 2 是 OpenAI 的图像生成与编辑模型,提升了画质、编辑控制、面部保持和提示词遵循能力,支持更灵活的比例、分辨率和编辑工作流。
0 context window
Released: 2026-04-21
Protocols:OpenAI
Capabilities:VisionPrompt Caching
PricingRate 0.15x
| Type | HaoAI Price | Official Reference | Rate |
|---|---|---|---|
| Input | $0.75/M | $5/M | 0.15x · 85% savings |
| Output | $1.5/M | $10/M | 0.15x · 85% savings |
| Cache read | $0.188/M | $1.25/M | 0.15x · 85% savings |
Code Examples
from openai import OpenAI
client = OpenAI(
base_url="https://api.hao.ai/v1",
api_key="YOUR_HAOAI_API_KEY",
)
response = client.images.generate(
model="openai/gpt-image-2",
prompt="A beautiful sunset over mountains",
size="1024x1024",
)
print(response.data[0].url)