API Nano Banana: $0.01$0.04(خصم 75%)
القائمة
ImageGPT AI API

وثائق واجهة برمجة التطبيقات

حوّل أفكارك إلى صور ومقاطع فيديو مذهلة باستخدام نماذجنا القوية للذكاء الاصطناعي

ملعب API لتوليد الصور المباشر

اختبر واستكشف واجهة برمجة تطبيقات توليد الصور باستخدام نماذج وصيغ إخراج متعددة

اختر نموذجًا

نقطة النهاية

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

الرؤوس

جسم الطلب

عينة الكود

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

API توليد الصور

API REST موحد لتوليد الصور باستخدام 15+ نموذج ذكاء اصطناعي — نص لصورة وصورة لصورة، بأشكال متعددة، تسعير بالرصيد.

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

يجب أن تتضمن جميع الطلبات مفتاح API في الرأس. حافظ على سريته.

http header
x-api-key: YOUR_API_KEY

مفتاح API مفقود أو غير صالح يعيد 401 Unauthorized .

أرسل JSON بالحقول التالية:

المعلمةالنوعالافتراضيالوصف
model*
string—معرف النموذج للتوليد.
prompt*
string—وصف نصي للصورة المراد توليدها.
width
number512عرض الصورة (بكسل).
height
number512ارتفاع الصورة (بكسل).
outputType
string"binary"تنسيق التسليم: "binary" أو "url" أو "base64".
outputFormat
string"png"تنسيق الملف: "png" أو "jpg".
image
string[]—مصفوفة URLs صور (أقصى 3). فقط لصورة-لصورة.

* حقول مطلوبة.

شكل الاستجابة يعتمد على outputType المختار:

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
}

طلب نص-لصورة باستخدام 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));

لصورة-لصورة، أضف image مصفوفة:

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'
})

الرصيد يُحسب لكل صورة مولدة:

اقتصادي
3 رصيد / صورة

نماذج سريعة وخفيفة للمسودات.

e.g. Flux Schnell, Z Image Turbo

قياسي
10–30 رصيد / صورة

جودة متوازنة للاستخدام اليومي.

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

متميز
35–100 رصيد / صورة

أعلى دقة للإنتاج.

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

يحظر ImageGPT المحتوى الذي تم إنشاؤه بواسطة الذكاء الاصطناعي غير اللائق (NSFW)، أو الجنسي الصريح، أو المخصص للبالغين، أو الاستغلالي، أو المخادع، أو الضار. يتم تطبيق إدارة المحتوى على توليد الصور والفيديو المدعوم.