01
1つのエンドポイントで3つのSeedreamモデル
POST /api/v1/seedream/generations を呼び出し、model フィールドで seedream-5-5(テキスト生成・画像編集)、seedream-5-5-layers(レイヤー分解)、seedream-5-pro を切り替えられます。
開発者向け API · V1
1つのRESTエンドポイントからSeedream 5.5、Seedream 5.5 Layers、Seedream 5 Proを呼び出し、高精細な画像生成・編集・レイヤー分解を自動化できます。Webスタジオと同じクレジット残高と生成履歴を共有します。
01
POST /api/v1/seedream/generations を呼び出し、model フィールドで seedream-5-5(テキスト生成・画像編集)、seedream-5-5-layers(レイヤー分解)、seedream-5-pro を切り替えられます。
02
すべてのSeedream APIリクエストは既存のFIFOクレジット残高から消費され、マイページの履歴とクレジット明細に自動反映されます。
03
公開HTTPSの webhook_url と任意の webhook_secret を指定してHMAC-SHA256署名付きコールバックを受け取るか、GET /api/v1/seedream/generations/{id} をいつでもポーリングできます。
04
Webスタジオと完全に同じクレジット料金で、API専用の同時実行数やRPM上限はありません。失敗・タイムアウト・未使用レイヤー枠のクレジットは自動返金されます。
認証とベースURL
「マイページ → APIキー」で sk- キーを作成・管理できます。すべてのリクエストはHTTPSを使用し、有料アカウント(有効なサブスクリプションまたはクレジットパック購入済み)が必要です。
ベースURL
https://seedream5-5.net/api/v1認証ヘッダー (Authorization)
べき等性ヘッダー(任意)
POST /api/v1/seedream/generations に Idempotency-Key を付与すると、ネットワーク再試行時に二重課金せず元のタスクを返します。
APIによる生成実行には有料アカウント(有効なサブスクリプションまたはクレジットパック購入)が必要です。無料アカウントでもキー作成と残高確認は可能ですが、ジョブ送信前にアップグレードが必要です。
クイックスタート
下からモデルモードと言語を選択してください。画像編集やレイヤー分解では、別途アップロードせずに公開HTTPS画像URLを直接渡せます。
curl -X POST "https://seedream5-5.net/api/v1/seedream/generations" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: req_20261127_001" \
-d '{
"model": "seedream-5-5",
"prompt": "Minimalist matte-black ceramic pour-over coffee dripper centered on a clean studio backdrop, crisp editorial lighting.",
"aspect_ratio": "1:1",
"resolution": "1.5K",
"output_format": "png",
"background": "transparent",
"webhook_url": "https://your-app.example.com/webhooks/seedream",
"webhook_secret": "whsec_replace_with_at_least_16_chars"
}'# 1. Poll generation status (returns image_url, images[], and layers[])
curl -X GET "https://seedream5-5.net/api/v1/seedream/generations/TASK_ID" \
-H "Authorization: Bearer YOUR_API_KEY"
# 2. Check remaining credit balance & Seedream pricing
curl -X GET "https://seedream5-5.net/api/v1/credits" \
-H "Authorization: Bearer YOUR_API_KEY"エンドポイント
すべてのエンドポイントは /api/v1 配下にあり、application/json を送受信します。
| メソッド | パス | 説明 |
|---|---|---|
| POST | /api/v1/seedream/generations | Seedream生成タスク(seedream-5-5、seedream-5-5-layers、seedream-5-pro)を作成します。Idempotency-Key と webhook_url に対応。 |
| GET | /api/v1/seedream/generations/{id} | タスクのステータス、永続化された image_url、images[]、layers[] メタデータ、確定クレジット消費量、エラー詳細を取得します。 |
| GET | /api/v1/seedream/generations | アカウントのSeedream生成履歴を一覧取得します(WebとAPI共有)。?page=1&limit=20(最大50)、?model=、?status=success|failed|pending|processing に対応。 |
| GET | /api/v1/credits | 現在の残りクレジット残高、有料アカウント状態、3つのSeedreamモデルの料金体系を取得します。 |
リクエスト仕様
このエンドポイントではSeedreamシリーズモデルのみ利用可能です。公開HTTP(S)画像URLは安全性検証のうえ直接処理されます。
| パラメータ | 型 | 必須 | 説明 |
|---|---|---|---|
| model | string | 必須 | "seedream-5-5"、"seedream-5-5-layers"、または "seedream-5-pro" を指定。Seedream以外のモデルは 400 invalid_model を返します。 |
| prompt | string | 条件付き | seedream-5-5(5〜5,000文字)と seedream-5-pro(3〜5,000文字)は必須。seedream-5-5-layers は任意(0〜2,000文字)。 |
| resolution | string | 任意 | seedream-5-5: "1K", "1.5K"(既定), "2K"。seedream-5-5-layers: "1K", "1.5K"(既定), "2K", "auto"。seedream-5-pro: "1K"(既定), "2K"。エイリアス: size。 |
| output_format | string | 任意 | 出力画像形式: "png"(既定)または "jpeg"。 |
| webhook_url | string (HTTPS) | 任意 | タスクが success、failed、または canceled に到達した際にPOSTコールバックを受け取る公開HTTPS URL。 |
| webhook_secret | string | 任意 | X-Seedream-Signature ヘッダーのHMAC-SHA256署名に使用する16〜256文字のシークレット。webhook_url の指定が必要です。 |
| パラメータ | 型 | 必須 | 説明 |
|---|---|---|---|
| aspect_ratio | string | 任意 | "1:1"、"4:3"、"3:4"、"16:9"、"9:16"、"2:3"、"3:2"、"21:9"。seedream-5-5 の画像編集では "auto" も指定可能(既定 "auto")。seedream-5-pro の既定は "1:1"。 |
| image_urls | string[] | 任意 | 画像編集を有効にする公開画像URL(JPG、PNG、WebP、最大10枚)。省略するとテキスト生成になります。エイリアス: images, image_input。 |
| background | string | 任意 | seedream-5-5 専用: "auto"(既定)、"transparent"(output_format: "png" 必須)、または "opaque"。 |
| パラメータ | 型 | 必須 | 説明 |
|---|---|---|---|
| image_url | string (URL) | 必須 | レイヤー分解する単一の公開HTTP(S)画像URL(PNGまたはJPEGを推奨)。エイリアス: image, image_urls[0]。 |
| max_images | integer | 任意 | 出力する最大レイヤー数(2〜100、既定: 2)。完了時に未使用レイヤー分のクレジットは自動返金されます。 |
| text_recognition | boolean | 任意 | true の場合、画像内のテキスト要素を検出して独立した透過レイヤーに分離します。既定: false。 |
レスポンス形式
タスクは pending → processing → success(または failed / canceled)と遷移します。完了時は image_url と images[] に永続化された公開画像URLが返り、seedream-5-5-layers では layers[] に構造化メタデータが含まれます。
{
"id": "8f3b2c1a-4d5e-4f6a-9b7c-1234567890ab",
"object": "seedream.generation",
"model": "seedream-5-5",
"mode": "text-to-image",
"status": "pending",
"prompt": "Minimalist matte-black ceramic pour-over coffee dripper centered on a clean studio backdrop...",
"aspect_ratio": "1:1",
"resolution": "1.5K",
"output_format": "png",
"background": "transparent",
"max_images": null,
"text_recognition": null,
"cost_credits": 6,
"credits_refunded": false,
"image_url": null,
"images": [],
"layers": null,
"error": null,
"webhook_url": "https://your-app.example.com/webhooks/seedream",
"created_at": "2026-11-27T00:00:00.000Z",
"updated_at": "2026-11-27T00:00:01.000Z"
}{
"id": "4c9a1e2b-7f3d-4a5b-8c1e-abcdef123456",
"object": "seedream.generation",
"model": "seedream-5-5-layers",
"mode": "layer-decomposition",
"status": "success",
"prompt": "Separate headline typography, foreground subject, and studio backdrop.",
"aspect_ratio": "auto",
"resolution": "1.5K",
"output_format": "png",
"background": null,
"max_images": 6,
"text_recognition": true,
"cost_credits": 19,
"credits_refunded": false,
"image_url": "https://cdn.example.com/seedream/layers/task/0.png",
"images": [
"https://cdn.example.com/seedream/layers/task/0.png",
"https://cdn.example.com/seedream/layers/task/1.png",
"https://cdn.example.com/seedream/layers/task/2.png"
],
"layers": [
{
"index": 0,
"url": "https://cdn.example.com/seedream/layers/task/0.png",
"z_index": 0,
"name": "background",
"description": "Studio backdrop",
"size": "1536x1536",
"bounding_box": {
"absolute": [0, 0, 1536, 1536],
"normalized": [0, 0, 1, 1]
}
}
],
"error": null,
"webhook_url": "https://your-app.example.com/webhooks/seedream",
"created_at": "2026-11-27T00:00:00.000Z",
"updated_at": "2026-11-27T00:00:24.000Z"
}WEBHOOK
作成時に webhook_url を指定すると定期ポーリングが不要になります。タスクが終了状態(success、failed、canceled)になると即座にHTTPS POSTを送信します。
{
"event": "generation.completed",
"timestamp": 1764201618,
"data": {
"id": "8f3b2c1a-4d5e-4f6a-9b7c-1234567890ab",
"object": "seedream.generation",
"model": "seedream-5-5",
"mode": "text-to-image",
"status": "success",
"aspect_ratio": "1:1",
"resolution": "1.5K",
"output_format": "png",
"background": "transparent",
"cost_credits": 6,
"credits_refunded": false,
"image_url": "https://cdn.example.com/seedream/image/task-0.png",
"images": ["https://cdn.example.com/seedream/image/task-0.png"],
"layers": null,
"error": null,
"created_at": "2026-11-27T00:00:00.000Z",
"updated_at": "2026-11-27T00:00:18.000Z"
}
}import crypto from "node:crypto";
export function verifySeedreamSignature({ rawBody, timestamp, signature, secret }) {
const expected =
"sha256=" +
crypto
.createHmac("sha256", secret)
.update(`${timestamp}.${rawBody}`)
.digest("hex");
const a = Buffer.from(signature || "", "utf8");
const b = Buffer.from(expected, "utf8");
return a.length === b.length && crypto.timingSafeEqual(a, b);
}料金と課金
すべてのSeedream APIリクエストはWebスタジオと完全に同じ計算式でアカウント残高から引き落とされます。
| モデル | 解像度 | 基本クレジット | 参照画像・レイヤー計算式 |
|---|---|---|---|
| seedream-5-5 | 1K / 1.5K | 6クレジット | テキスト生成: 6クレジット。画像編集: 6 + floor(参照画像数 × 1.5) クレジット(1〜10枚)。 |
| seedream-5-5 | 2K | 12クレジット | テキスト生成: 12クレジット。画像編集: 12 + floor(参照画像数 × 1.5) クレジット(1〜10枚)。 |
| seedream-5-5-layers | 1K / 1.5K (2K / auto) | 6(または12)/ レイヤー | 送信時に max_images × 単価 + 1 を仮確保。完了後に実出力レイヤー数 × 単価 + 1 で精算し差額を自動返金。 |
| seedream-5-pro | 1K / 2K | 7 / 14クレジット | 1枚目の参照画像は無料。2〜10枚目は1枚ごとに +1クレジット。 |
エラーハンドリング
エラーレスポンスは一貫したJSON形式 {"error": {"code": "...", "message": "..."}} で返却されます。
| HTTP | エラーコード | 意味と対処法 |
|---|---|---|
| 400 | invalid_model / invalid_parameters / invalid_webhook_url | modelがSeedreamシリーズであること、プロンプト長と解像度、透過背景時のPNG指定、および公開URLであることを確認してください。 |
| 401 | unauthorized | Bearer APIキーが未指定、不正、または無効化されています。 |
| 402 | insufficient_credits | 要求されたモデル・解像度・入力枚数に対してクレジット残高が不足しています。料金ページから追加してください。 |
| 403 | paid_account_required | API利用には有効なサブスクリプションまたはクレジットパック購入が必要です。 |
| 404 | not_found | 指定されたSeedreamタスクIDが存在しないか、非Seedreamタスクまたは他アカウントのタスクです。 |
| 409 | idempotency_conflict | 同一の Idempotency-Key が異なるモデルまたは生成モードで再利用されました。 |
| 502 | upstream_error | 生成タスクの送信に失敗しました。仮確保されたクレジットは自動的に返金されています。 |
よくある質問
本APIはSeedreamファミリーのモデルのみを公開しています:seedream-5-5(テキスト生成・画像編集)、seedream-5-5-layers(レイヤー分解)、seedream-5-pro(テキスト生成・画像編集)。
はい。APIリクエストはSeedream 5.5 Webスタジオと完全に同じFIFOクレジット台帳から消費され、生成されたタスクはすべてマイページの履歴に表示されます。
有効な有料権限(サブスクリプションまたはクレジットパック購入済み)を持つすべてのアカウントが利用できます。「マイページ → APIキー」から sk- キーを発行してください。
作成時に max_images 分と入力1クレジットを仮確保します。完了後、実際に返されたレイヤー数 + 1クレジットのみが課金され、未使用枠のクレジットは自動返金されます。
作成時に webhook_url と16〜256文字の webhook_secret を指定します。受信時に "{X-Seedream-Timestamp}.{rawBody}" に対してHMAC-SHA256を計算し、X-Seedream-Signature と定数時間比較してください。
POST /api/v1/seedream/generations に一意の Idempotency-Key ヘッダーを付けてください。同じキーで再試行すると、新しいタスク作成や二重課金を行わずHTTP 200で元のタスクを返します。
数秒でAPIキーを作成し、Seedream 5.5の画像生成・編集・透過アセット・レイヤー分解をあなたのアプリに組み込みましょう。