GPT Image 2
GPT Image 2: qualità fotorealistica, rendering del testo preciso e modifica a livello di pixel
Caratteristiche
- Generazione di immagini da testo
- Modifica immagine a immagine (fino a 4 immagini di riferimento)
- Qualità fotorealistica e tipografia precisa
- Output a immagine singola (n=1)
Prezzi
| Resolution | Credits |
|---|---|
| 1k | 3 (~$0.03) |
| 2k | 4 (~$0.04) |
| 4k | 5 (~$0.06) |
Endpoint
POST
/api/v1/images/generateParametri
| Parametro | Tipo | Obbligatorio | Descrizione |
|---|---|---|---|
| model | string | Obbligatorio | Must be "gpt-image-2" |
| type | string | Facoltativo | "text-to-image" or "image-to-image" (default: text-to-image) |
| prompt | string | Obbligatorio | Text description (3–20000 chars) |
| image_urls | string[] | Facoltativo | Required for image-to-image. Up to 4 reference image URLs |
| input_image | string | Facoltativo | Deprecated. Alias for image_urls[0] |
| image_size | string | Facoltativo | Optional aspect ratio: "1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3", "5:4", "4:5", "2:1", "1:2", "21:9", or "9:21". Required for 4k; auto/default is not allowed with 4k. |
| resolution | string | Facoltativo | Optional output resolution: "1k", "2k", or "4k" (default: "1k") |
| num_images | number | Facoltativo | Must be 1 (gpt-image-2 always returns a single image) |
Esempio di Richiesta (Testo a Immagine)
{
"model": "gpt-image-2",
"resolution": "2k",
"prompt": "A hand-drawn illustrated greeting card with the text \"Hello, world!\" in serif letters"
}Esempio di Richiesta (Immagine a Immagine)
{
"model": "gpt-image-2",
"type": "image-to-image",
"resolution": "2k",
"prompt": "Place the subject on a beach at golden hour, keep facial features identical",
"image_urls": ["https://tempfile.aiquickdraw.com/workers/nano/image_1772780968156_ygk0zm.png"]
}Esempio di Risposta
{
"success": true,
"data": {
"task_id": "task_gpt2_123",
"credits_used": 4,
"remaining_credits": 496,
"model": "gpt-image-2"
}
}Esempi di Codice (Testo a Immagine)
curl -X POST https://gateway.bananapro.site/api/v1/images/generate \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2",
"resolution": "2k",
"prompt": "A hand-drawn illustrated greeting card with the text \"Hello, world!\" in serif letters"
}'Esempi di Codice (Immagine a Immagine)
curl -X POST https://gateway.bananapro.site/api/v1/images/generate \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2",
"type": "image-to-image",
"resolution": "2k",
"prompt": "Place the subject on a beach at golden hour, keep facial features identical",
"image_urls": ["https://tempfile.aiquickdraw.com/workers/nano/image_1772780968156_ygk0zm.png"]
}'