Ubah ide Anda menjadi gambar dan video yang menakjubkan dengan model AI kami yang powerful
Uji dan jelajahi API Pembuatan Gambar dengan berbagai model dan format output
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));API REST terpadu untuk menghasilkan gambar dengan 15+ model AI — teks-ke-gambar dan gambar-ke-gambar, berbagai format, sistem kredit.
https://api.imagegpt.online/generate/text-imageSemua permintaan harus menyertakan kunci API di header. Jaga kerahasiaannya.
x-api-key: YOUR_API_KEYKunci API hilang atau tidak valid mengembalikan 401 Unauthorized .
Kirim JSON dengan field berikut:
| Parameter | Tipe | Default | Deskripsi |
|---|---|---|---|
model* | string | — | ID model untuk pembuatan. |
prompt* | string | — | Deskripsi teks gambar yang ingin dibuat. |
width | number | 512 | Lebar gambar output (piksel). |
height | number | 512 | Tinggi gambar output (piksel). |
outputType | string | "binary" | Format output: "binary", "url" atau "base64". |
outputFormat | string | "png" | Format file: "png" atau "jpg". |
image | string[] | — | Array URL gambar input (maks 3). Hanya untuk gambar-ke-gambar. |
* Field wajib.
Bentuk respons tergantung pada outputType yang dipilih:
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
}Permintaan minimal teks-ke-gambar dengan 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));Untuk gambar-ke-gambar, tambahkan image array:
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'
})Kredit dihitung per gambar yang dihasilkan:
Model cepat dan ringan untuk draf.
e.g. Flux Schnell, Z Image Turbo
Kualitas seimbang untuk penggunaan harian.
e.g. GPT Image 1.0, Seedream, Nova Canvas
Fidelitas tertinggi untuk output produksi.
e.g. Nano Banana Pro, Seedream 4.0, Ideogram
ImageGPT melarang konten AI yang bersifat NSFW, eksplisit secara seksual, dewasa, eksploitatif, menipu, atau berbahaya. Moderasi konten diterapkan pada pembuatan gambar dan video yang didukung.