GPT Image 2 Text-to-Image
Generate an image from a prompt.
01Overview
GPT Image 2 adds sharper text rendering and layout control compared with the first generation, and follows long instructions closely.
POST
/api/v1/images/generationsBase URL https://capi.minapp.xinAPI version v1Authentication Bearer YOUR_API_TOKEN
02Parameters
| Name | Type | Description |
|---|---|---|
| model* | string | Model ID, e.g. gpt-image-2-text-to-image. |
| prompt* | string | Image description. |
| size | string | One of "1024x1024", "1536x1024", "1024x1536". |
| quality | string | One of "low", "medium", "high". |
| n | integer | Number of images to return. Default 1. |
03Request body
JSON
{
"model": "gpt-image-2-text-to-image",
"prompt": "a minimal poster for a night train, deep blue background",
"size": "1024x1024",
"quality": "high"
}Example
GPT Image 2 Text-to-Image
cURL
curl -X POST https://capi.minapp.xin/api/v1/images/generations \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2-text-to-image",
"prompt": "a minimal poster for a night train"
}'HTTP 200· OK
{
"data": [
{ "url": "https://file.capi.minapp.xin/images/out-1.png" }
],
"cost": { "amount": 0.03, "currency": "USD" }
}