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 Mini크레딧 1개samimage-maxSam Max크레딧 1개 · Max
스타일
realistic사실적anime애니메이션3d3Dwatercolor수채화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그 이미지는 너무 큽니다. 8MB 미만으로 올려 주세요. - 200
not-allowed이 계정은 이미지 생성이 꺼져 있습니다. 지원팀에 문의해 주세요. - 200
storage-failed이미지는 만들어졌지만 저장하지 못했습니다. 저희 잘못입니다 — 지원팀에 알려 주세요. - 200
no-source-image먼저 편집할 이미지를 골라 주세요. - 200
busy한꺼번에 요청이 너무 많습니다. 크레딧은 안전합니다 — 잠시 뒤 다시 시도해 주세요. - 200
blocked이 프롬프트는 이용 규정을 어겨 전송되지 않았습니다. 크레딧은 쓰이지 않았습니다. - 200
email-unverified이미지를 만들기 전에 이메일 주소를 확인해 주세요. 계정 페이지에서 새 링크를 받을 수 있습니다.