SamImageGenerator
Sign In

API

Generate images from your own code with one key.

Sign in to create your API key.

Sign In

Generate an image

Send a prompt, get back an image.

# 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_your_key_here" \
  -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_your_key_here"

Runs against the real endpoint with the key above and spends one credit — the same call your code will make.

Response

// 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
}

// Errors
// 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" }

Model

  • samimage-miniSam Mini1 credit
  • samimage-maxSam Max1 credit · Max

Style

  • realisticRealistic
  • animeAnime
  • 3d3D
  • watercolorWatercolor
  • oilOil painting
  • pixelPixel art
  • cyberpunkCyberpunk
  • fantasyFantasy
  • minimalMinimal
  • sketchPencil sketch
  • comicComic
  • cartoonCartoon
  • lineartLine art
  • lowpolyLow poly
  • isometricIsometric
  • vaporwaveVaporwave
  • steampunkSteampunk
  • noirNoir
  • popartPop art
  • impressionistImpressionist
  • surrealSurreal
  • neonNeon
  • clayClay
  • papercutPaper cut
  • editEdit

Format

  • 1:1Square
  • 16:9Wide
  • 9:16Tall
  • 4:3Standard

Size

  • 1K1024×1024
  • 2K2048×2048

Fields

  • promptstring · 5000
  • style25 × string · optional
  • aspect1:1 | 16:9 | 9:16 | 4:3 · optional
  • 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

Errors

  • 401unauthorizedThe key is missing or no longer valid.
  • 401browser-keyThis key has an allowed-site list, so it belongs in an embed. Server calls need a key with no sites listed.
  • 429too-many-requests · 30/60sToo many tries. Please wait a few minutes.
  • 200no-creditsYou are out of credits. Subscribe or buy credits to keep generating.
  • 200no-promptDescribe what you want to generate first.
  • 200not-configuredImage generation is not available right now.
  • 200generation-failedThat generation failed. Please try again.
  • 200image-too-largeThat image is too large. Use one under 8 MB.
  • 200not-allowedImage generation is disabled for this account. Contact support.
  • 200storage-failedThe image was created but could not be saved. This is on us — please tell support.
  • 200no-source-imageChoose an image to edit first.
  • 200busyToo many requests at once. Your credits are safe — try again in a moment.
  • 200blockedThis prompt breaks our Acceptable Use policy and was not sent. No credit was used.
  • 200email-unverifiedConfirm your email address before you generate. Open your account page to get a new link.