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_aapki_kunji_yahan" \
-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_aapki_kunji_yahan"ऊपर वाली कुंजी से असली एंडपॉइंट पर चलता है और एक क्रेडिट ख़र्च करता है — ठीक वही कॉल जो आपका कोड करेगा।
जवाब
// 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ऐनिमे3d3डी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 MB से छोटी इस्तेमाल कीजिए। - 200
not-allowedइस खाते के लिए तस्वीर बनाना बंद है। सहायता से संपर्क कीजिए। - 200
storage-failedतस्वीर बन गई पर सहेजी नहीं जा सकी। ग़लती हमारी है — कृपया सहायता को बताइए। - 200
no-source-imageपहले वह तस्वीर चुनिए जिसे बदलना है। - 200
busyएक साथ बहुत सारे अनुरोध। आपके क्रेडिट सुरक्षित हैं — थोड़ी देर में फिर कोशिश कीजिए। - 200
blockedयह विवरण हमारी स्वीकार्य उपयोग नीति तोड़ता है और भेजा नहीं गया। कोई क्रेडिट ख़र्च नहीं हुआ। - 200
email-unverifiedबनाने से पहले अपना ईमेल पता पुष्ट कीजिए। नया लिंक पाने के लिए खाता पृष्ठ खोलिए।