SamImageGenerator
ログイン

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クレジット1
  • samimage-maxSam Maxクレジット1 · Max

スタイル

  • realistic写実
  • animeアニメ
  • 3d3D
  • 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その画像は大きすぎます。8MB未満のものをお使いください。
  • 200not-allowedこのアカウントでは画像生成が無効です。サポートへご連絡ください。
  • 200storage-failed画像は作られましたが保存できませんでした。こちらの不具合です — サポートへお知らせください。
  • 200no-source-imageまず編集する画像を選んでください。
  • 200busy一度にリクエストが多すぎます。クレジットは無事です — 少ししてからお試しください。
  • 200blockedこのプロンプトは利用規定に反するため送信されませんでした。クレジットは使われていません。
  • 200email-unverified画像を作る前にメールアドレスを確認してください。アカウントページから新しいリンクを受け取れます。