SamImageGenerator
साइन इन

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