API Nano Banana: $0,01$0,04(75% DI SCONTO)
Menu
ImageGPT AI API

Documentazione API

Trasforma le tue idee in immagini e video straordinari con i nostri potenti modelli AI

Playground API per la Generazione Diretta di Immagini

Testa ed esplora l'API di Generazione Immagini con più modelli e formati di output

Seleziona Modello

Endpoint

POSThttps://api.imagegpt.online/generate/text-image

Intestazioni

Corpo della Richiesta

Esempio di Codice

fetch('https://api.imagegpt.online/generate/text-image', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-api-key': 'YOUR_API_KEY'
  },
  body: JSON.stringify({
  "prompt": "Photorealistic portrait of the same person (keep his real face unchanged). A man with medium curly brown hair, light skin, and soft features sits relaxed, forearms on a light blue table, holding a small white puppy with a red collar. He wears a cozy color-block knitted sweater (beige, tan, light blue, black) with ribbed neck and cuffs, a silver watch, and a turquoise-beaded bracelet. Soft diffused lighting, smooth steel-blue background, slightly elevated front angle warm, intimate, digital photo",
  "width": 512,
  "height": 512,
  "model": "FLUX-SCHNELL",
  "outputType": "binary",
  "outputFormat": "png"
})
})
  .then(response => response.blob())
  .then(blob => {
    const imageUrl = URL.createObjectURL(blob);
    console.log('Image URL:', imageUrl);
    // Display in img tag: document.getElementById('myImg').src = imageUrl;
  })
  .catch(error => console.error('Error:', error));
Documentazione API

API di Generazione Immagini

API REST unificata per generare immagini con 15+ modelli AI — testo-immagine e immagine-immagine con più formati, endpoint unico con crediti.

POSThttps://api.imagegpt.online/generate/text-image

Tutte le richieste devono includere la chiave API nell'header. Mantienila segreta.

http header
x-api-key: YOUR_API_KEY

Chiave API mancante o non valida restituisce 401 Unauthorized .

Invia un corpo JSON con i seguenti campi:

ParametroTipoPredefinitoDescrizione
model*
string—ID modello per la generazione.
prompt*
string—Descrizione testuale dell'immagine da generare.
width
number512Larghezza immagine in pixel.
height
number512Altezza immagine in pixel.
outputType
string"binary"Formato di consegna: "binary", "url" o "base64".
outputFormat
string"png"Formato file: "png" o "jpg".
image
string[]—Array di URL immagine (max 3). Solo per immagine-immagine.

* Campi obbligatori.

La forma della risposta dipende dal outputType scelto:

binary

outputType: "binary"

js
const blob = await response.blob();
const url = URL.createObjectURL(blob);
url

outputType: "url"

json
{
  "success": true,
  "taskId": "imagegpt_img-...",
  "url": "https://...",
  "creditsDeducted": 3
}
base64

outputType: "base64"

json
{
  "success": true,
  "taskId": "imagegpt_img-...",
  "base64": "/9j/4QWm...",
  "creditsDeducted": 3
}

Richiesta minima testo-immagine con fetch API:

javascript
fetch('https://api.imagegpt.online/generate/text-image', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-api-key': 'YOUR_API_KEY'
  },
  body: JSON.stringify({
    model: 'FLUX-SCHNELL',
    prompt: 'A futuristic city at sunset, photorealistic',
    width: 512,
    height: 512,
    outputType: 'url',
    outputFormat: 'png'
  })
})
  .then(res => res.json())
  .then(data => console.log('Image URL:', data.url));

Per immagine-immagine, aggiungi un image array:

javascript
body: JSON.stringify({
  model: 'FLUX-KONTEXT',
  prompt: 'Same person, wearing a red jacket',
  image: ['https://example.com/input.jpg'],
  width: 512,
  height: 512,
  outputType: 'url',
  outputFormat: 'png'
})

Crediti addebitati per immagine generata:

Economico
3 crediti / immagine

Modelli rapidi e leggeri per bozze.

e.g. Flux Schnell, Z Image Turbo

Standard
10–30 crediti / immagine

Qualità bilanciata per uso quotidiano.

e.g. GPT Image 1.0, Seedream, Nova Canvas

Premium
35–100 crediti / immagine

Massima fedeltà per output di produzione.

e.g. Nano Banana Pro, Seedream 4.0, Ideogram

ImageGPT proibisce contenuti generati da AI NSFW, sessualmente espliciti, per adulti, sfruttatori, ingannevoli o dannosi. La moderazione dei contenuti viene applicata alla generazione di immagini e video supportata.