API
キー1つで、あなたのコードから画像を作れます。
APIキーを作るにはログインしてください。
ログイン画像を1枚作る
プロンプトを送って、画像を受け取ります。
# 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つ使います — あなたのコードが行うのと同じ呼び出しです。
レスポンス
// 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クレジット1samimage-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画像を作る前にメールアドレスを確認してください。アカウントページから新しいリンクを受け取れます。