GPT Image 2· Immagine in immagine
https://api.foxwire.ai/v1/media/generationsPricing Model
1K 4,25 ₽ · 2K 8,5 ₽ · 4K 17 ₽ per image. Billed only on success.
Execution Flow
Asynchronous submission model. Submitting requests queues background workers.
#Invia un'attività
La generazione di contenuti multimediali è asincrona: ottieni subito un id attività, senza attendere.
curl https://api.foxwire.ai/v1/media/generations \
-H "Authorization: Bearer $CORRY_KEY" \
-H "Content-Type: application/json" \
-d '{ "model": "gpt-image-2-edit", "prompt": "turn this product photo into a premium poster", "input_urls": ["https://example.com/photo.png"] }'
# → { "id": "cmus7q0x9000108l3f5g2abcd", "status": "queued" }#Parametri della richiesta
| Parametro | Tipo | Obbligatorio | Predefinito | Descrizione |
|---|---|---|---|---|
prompt | string | Sì | — | Text prompt describing the image to generate (max 20000 chars). |
input_urls | string[] | Sì | — | Array of source image URLs to edit (max 16). |
aspect_ratio | string | No | auto | Aspect ratio of the output image. Note: 5:4 and 4:5 only support 1K. Opzioni: auto, 1:1, 3:2, 2:3, 4:3, 3:4, 16:9, 9:16, 2:1, 1:2, 3:1, 1:3, 21:9, 9:21, 5:4, 4:5 |
resolution | string | No | 1K | Output image resolution; higher resolution costs proportionally more (2K ≈ 2×, 4K ≈ 4× of 1K) — see the pricing page. Note: 1:1 cannot be upscaled to 4K; 'auto' aspect ratio only yields 1K. Opzioni: 1K, 2K, 4K |
callback_url | string | No | — | Optional public http(s) URL. We POST the task result here the moment generation finishes (success or failure). |
#Poll for the result
Generation runs asynchronously — the submit call returns immediately with a task id. Poll this endpoint with that id every few seconds until status becomes succeeded (result ready) or a terminal error (failed / timeout).
https://api.foxwire.ai/v1/media/generations/{id}# take the id from the submit response, then poll every ~3s
curl https://api.foxwire.ai/v1/media/generations/cmus7q0x9000108l3f5g2abcd \
-H "Authorization: Bearer $CORRY_KEY"
# repeat until "status" is "succeeded" (or "failed" / "timeout")#Esempio di risposta
All'invio
{
"id": "cmus7q0x9000108l3f5g2abcd",
"status": "queued",
"type": "image",
"model": "gpt-image-2-edit"
}In caso di successo (dopo il polling)
{
"id": "cmus7q0x9000108l3f5g2abcd",
"status": "succeeded",
"type": "image",
"model": "gpt-image-2-edit",
"result": { "urls": ["https://cdn.sozdai.ai/image/1782537315223-b49c0c1b771f.png"] },
"cost": "0.0500",
"currency": "USD"
}Campi della risposta
| Campo | Tipo | Descrizione |
|---|---|---|
status | string | Stato dell'attività: queued / submitted / succeeded / failed / timeout. |
type | string | Tipo di media: image / video / music. |
model | string | Il modello che hai richiesto. |
result | object | Presente in caso di successo. result.urls è un array di URL di file permanenti. |
error | string | Messaggio di errore, presente quando l'attività non è riuscita. |
cost | string | Importo addebitato per questa attività — una stringa in USD (es. "0.1200"). Vedi il campo currency. |
currency | string | Currency of cost — always "USD". |




