Transformez vos idées en images et vidéos époustouflantes grâce à nos puissants modèles IA
Testez et explorez l'API de génération d'images avec plusieurs modèles et formats de sortie
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));Une API REST unifiée pour générer des images avec 15+ modèles d'IA — texte vers image et image vers image avec multiples formats de sortie, via un seul endpoint avec tarification par crédits.
https://api.imagegpt.online/generate/text-imageToutes les requêtes doivent inclure votre clé API dans l'en-tête. Gardez-la secrète et ne l'exposez jamais côté client en production.
x-api-key: YOUR_API_KEYUne clé API manquante ou invalide renvoie une réponse 401 Unauthorized .
Envoyez un corps JSON avec les champs suivants :
| Paramètre | Type | Défaut | Description |
|---|---|---|---|
model* | string | — | ID du modèle pour la génération. |
prompt* | string | — | Description textuelle de l'image à générer. |
width | number | 512 | Largeur de l'image en pixels. |
height | number | 512 | Hauteur de l'image en pixels. |
outputType | string | "binary" | Format de livraison : "binary", "url" ou "base64". |
outputFormat | string | "png" | Format de fichier image : "png" ou "jpg". |
image | string[] | — | Tableau d'URLs d'images (max 3). Requis uniquement pour image vers image. |
* Champs obligatoires.
La forme de la réponse dépend du outputType choisi :
outputType: "binary"
const blob = await response.blob();
const url = URL.createObjectURL(blob);outputType: "url"
{
"success": true,
"taskId": "imagegpt_img-...",
"url": "https://...",
"creditsDeducted": 3
}outputType: "base64"
{
"success": true,
"taskId": "imagegpt_img-...",
"base64": "/9j/4QWm...",
"creditsDeducted": 3
}Une requête minimale texte vers image avec fetch API :
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));Pour image vers image, ajoutez un image tableau :
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'
})Les crédits sont facturés par image générée. Le badge indique le coût :
Modèles rapides et légers pour les brouillons.
e.g. Flux Schnell, Z Image Turbo
Qualité équilibrée pour l'usage quotidien.
e.g. GPT Image 1.0, Seedream, Nova Canvas
Fidélité maximale pour la production.
e.g. Nano Banana Pro, Seedream 4.0, Ideogram
ImageGPT interdit le contenu IA généré à caractère NSFW, sexuellement explicite, pour adultes, exploiteur, trompeur ou nuisible. La modération de contenu est appliquée à la génération d'images et de vidéos prise en charge.