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 artcyberpunkسايبربانكfantasyخياليminimalبسيطsketchرسم بالقلمcomicكوميكcartoonكرتونlineartرسم بالخطوطlowpolyLow polyisometricمتساوي القياسvaporwaveفيبورويفsteampunkستيمبانكnoirنوارpopartPop artimpressionistانطباعيsurrealسرياليneonنيونclayصلصالpapercutقصّ الورقeditتحرير
الصيغة
1:1مربّع16:9عريض9:16رأسي4:3قياسي
المقاس
1K1024×10242K2048×2048
الحقول
promptstring · 5000style25 × string · اختياريaspect1:1 | 16:9 | 9:16 | 4:3 · اختياريresolution1K | 2Kcount1-1model2 × stringisPublicbooleanremoveBgbooleanenhancebooleancleanbooleanuseSeedbooleansourceImagedata URI · 8 MBmarkedImagedata URI · 8 MBmaskedbooleanregionsstring[] · 8 × 300langen | de | es | fr | it | nl | pl | sv | tr | pt | hi | id | ko | ja | arreferenceImages(url | data URI)[] · 4 × 8 MB
الأخطاء
- 401
unauthorizedالمفتاح مفقود أو لم يعد صالحًا. - 401
browser-keyلهذا المفتاح قائمة مواقع مسموح بها، فمكانه شيفرة التضمين. أما الاستدعاء من الخادم فيحتاج مفتاحًا بلا قائمة مواقع. - 429
too-many-requests · 30/60sمحاولات كثيرة جدًا. انتظر بضع دقائق. - 200
no-creditsنفد رصيدك. اشترك أو اشترِ رصيدًا لتواصل الإنشاء. - 200
no-promptصف أولًا ما تريد إنشاءه. - 200
not-configuredإنشاء الصور غير متاح حاليًا. - 200
generation-failedفشل هذا الإنشاء. حاول مرة أخرى. - 200
image-too-largeهذه الصورة كبيرة جدًا. استخدم صورة أقل من 8 ميغابايت. - 200
not-allowedإنشاء الصور معطّل لهذا الحساب. تواصل مع الدعم. - 200
storage-failedأُنشئت الصورة لكن تعذّر حفظها. الخطأ من عندنا — أبلغ الدعم من فضلك. - 200
no-source-imageاختر أولًا الصورة التي تريد تحريرها. - 200
busyطلبات كثيرة دفعة واحدة. رصيدك بأمان — حاول بعد قليل. - 200
blockedيخالف هذا الوصف سياسة الاستخدام المقبول ولم يُرسل. ولم يُستهلك أي رصيد. - 200
email-unverifiedأكّد بريدك الإلكتروني قبل إنشاء الصور. افتح صفحة حسابك للحصول على رابط جديد.