GPT Image 2
| Provider | OpenAI |
| Model name | gpt-image-2 |
| Endpoint | /v1/chat/completions |
| Result | Markdown image content in choices[0].message.content |
| Pricing | See HiAPI Pricing |
GPT Image 2 fits chat-compatible image workflows, especially when prompts include detailed layout, scene, and copy requirements.
Key Parameters
Section titled “Key Parameters”| Parameter | Type | Notes |
|---|---|---|
model | string | Use gpt-image-2 |
messages | array | Standard Chat Completions messages |
extra_body.google.image_config.aspect_ratio | string | Common values include auto, 1:1, 16:9, 9:16, 4:3, 3:4 |
extra_body.google.image_config.image_size | string | Resolution: 1K (default), 2K, 4K. Higher resolution costs more — see Pricing |
stream | boolean | Set to false |
Limitation: When
image_sizeis"4K", the aspect ratio cannot be"1:1"(square). For 4K output, either lowerimage_sizeto"2K", or pick a non-square aspect ratio (16:9,9:16,4:3, or3:4).
Example
Section titled “Example”curl -X POST https://api.hiapi.ai/v1/chat/completions \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-image-2", "stream": false, "messages": [{"role": "user", "content": "Create a launch poster for an AI note-taking app with clean typography, dark UI mockup, and subtle neon accent"}], "extra_body": { "google": { "image_config": {"aspect_ratio": "16:9", "image_size": "1K"} } } }'Next Steps
Section titled “Next Steps”- Read the Image Generation guide
- Compare with GPT Image 1.5
- Review API Reference