SamImageGenerator
تسجيل الدخول

API

أنشئ صورًا من شيفرتك بمفتاح واحد.

سجّل الدخول لإنشاء مفتاح API خاص بك.

تسجيل الدخول

إنشاء صورة

أرسل وصفًا واحصل على صورة.

# 1) Send the prompt. The endpoint does not wait for the image:
#    it queues the job and answers 202 with an id.
curl https://samimagegenerator.com/api/v1/generate \
  -H "Authorization: Bearer sig_مفتاحك_هنا" \
  -H "Content-Type: application/json" \
  -d '{"prompt":"a red fox in the snow","style":"realistic","aspect":"1:1","resolution":"1K","count":1,"model":"samimage-mini"}'

# 2) Ask for the result every couple of seconds until status is no longer "pending".
#    Generation takes 20-60s. Polling is safe to repeat: it never spends a credit.
curl "https://samimagegenerator.com/api/v1/generate?id=<ID>" \
  -H "Authorization: Bearer sig_مفتاحك_هنا"

يعمل على عنوان حقيقي بالمفتاح أعلاه ويستهلك رصيدًا واحدًا — الاستدعاء نفسه الذي ستجريه شيفرتك.

الاستجابة

// 1) POST — the job is accepted, nothing is generated yet (202)
{ "ok": true, "id": "…", "status": "pending" }

// 2) GET ?id=… — while the worker is on it (200)
{ "ok": true, "status": "pending" }

// 2) GET ?id=… — finished (200)
{
  "ok": true,
  "status": "done",
  "generations": [
    { "id": "…", "model": "samimage-mini", "url": "https://samimagegenerator.com/api/generations/…/file" }
  ],
  "refunded": 0,
  // credits: null on an unlimited plan — there is no number to count down.
  "credits": 96
}

// الأخطاء
// The job failed: HTTP is still 200 — the poll itself worked, the generation did not.
{ "ok": false, "status": "error", "error": "no-credits" }

// generation-failed / storage-failed: the credit was spent and refunded,
// so the fresh balance comes back with the error.
{ "ok": false, "status": "error", "error": "generation-failed", "credits": 96 }

// Unknown or expired id (404). Jobs are kept for one day.
{ "ok": false, "error": "not-found" }

النموذج

  • samimage-miniSam Mini1 رصيد
  • samimage-maxSam Max1 رصيد · Max

النمط

  • realisticواقعي
  • animeأنمي
  • 3dثلاثي الأبعاد
  • watercolorألوان مائية
  • oilألوان زيتية
  • pixelPixel art
  • cyberpunkسايبربانك
  • fantasyخيالي
  • minimalبسيط
  • sketchرسم بالقلم
  • comicكوميك
  • cartoonكرتون
  • lineartرسم بالخطوط
  • lowpolyLow poly
  • isometricمتساوي القياس
  • vaporwaveفيبورويف
  • steampunkستيمبانك
  • noirنوار
  • popartPop art
  • impressionistانطباعي
  • surrealسريالي
  • neonنيون
  • clayصلصال
  • papercutقصّ الورق
  • editتحرير

الصيغة

  • 1:1مربّع
  • 16:9عريض
  • 9:16رأسي
  • 4:3قياسي

المقاس

  • 1K1024×1024
  • 2K2048×2048

الحقول

  • promptstring · 5000
  • style25 × string · اختياري
  • aspect1:1 | 16:9 | 9:16 | 4:3 · اختياري
  • resolution1K | 2K
  • count1-1
  • model2 × string
  • isPublicboolean
  • removeBgboolean
  • enhanceboolean
  • cleanboolean
  • useSeedboolean
  • sourceImagedata URI · 8 MB
  • markedImagedata URI · 8 MB
  • maskedboolean
  • regionsstring[] · 8 × 300
  • langen | de | es | fr | it | nl | pl | sv | tr | pt | hi | id | ko | ja | ar
  • referenceImages(url | data URI)[] · 4 × 8 MB

الأخطاء

  • 401unauthorizedالمفتاح مفقود أو لم يعد صالحًا.
  • 401browser-keyلهذا المفتاح قائمة مواقع مسموح بها، فمكانه شيفرة التضمين. أما الاستدعاء من الخادم فيحتاج مفتاحًا بلا قائمة مواقع.
  • 429too-many-requests · 30/60sمحاولات كثيرة جدًا. انتظر بضع دقائق.
  • 200no-creditsنفد رصيدك. اشترك أو اشترِ رصيدًا لتواصل الإنشاء.
  • 200no-promptصف أولًا ما تريد إنشاءه.
  • 200not-configuredإنشاء الصور غير متاح حاليًا.
  • 200generation-failedفشل هذا الإنشاء. حاول مرة أخرى.
  • 200image-too-largeهذه الصورة كبيرة جدًا. استخدم صورة أقل من 8 ميغابايت.
  • 200not-allowedإنشاء الصور معطّل لهذا الحساب. تواصل مع الدعم.
  • 200storage-failedأُنشئت الصورة لكن تعذّر حفظها. الخطأ من عندنا — أبلغ الدعم من فضلك.
  • 200no-source-imageاختر أولًا الصورة التي تريد تحريرها.
  • 200busyطلبات كثيرة دفعة واحدة. رصيدك بأمان — حاول بعد قليل.
  • 200blockedيخالف هذا الوصف سياسة الاستخدام المقبول ولم يُرسل. ولم يُستهلك أي رصيد.
  • 200email-unverifiedأكّد بريدك الإلكتروني قبل إنشاء الصور. افتح صفحة حسابك للحصول على رابط جديد.