01
One Endpoint, Three Seedream Models
Call POST /api/v1/seedream/generations and switch cleanly between seedream-5-5 (text-to-image and multi-reference editing), seedream-5-5-layers (layer decomposition), and seedream-5-pro.
DEVELOPER API · V1
Generate, edit, and decompose high-resolution images programmatically across Seedream 5.5, Seedream 5.5 Layers, and Seedream 5 Pro through one REST endpoint. Share the exact same credit ledger and generation history as the web studio.
01
Call POST /api/v1/seedream/generations and switch cleanly between seedream-5-5 (text-to-image and multi-reference editing), seedream-5-5-layers (layer decomposition), and seedream-5-pro.
02
Every Seedream API call deducts from your existing FIFO credit balance and appears automatically in your Personal Center History and Credit Ledger.
03
Pass a public HTTPS webhook_url and optional webhook_secret for HMAC-SHA256 verified callbacks, or poll GET /api/v1/seedream/generations/{id} anytime.
04
Identical credit rates to the web studio with no separate API concurrency or RPM cap. Failed tasks, timeouts, and unused layer slots refund credits automatically.
AUTHENTICATION & BASE URL
Create and manage sk- keys in Personal Center → API Keys. All requests use HTTPS and require a paid account (an active subscription or purchased credit pack).
Base URL
https://seedream5-5.net/api/v1Authorization Header
Idempotency Header (Optional)
Send Idempotency-Key on POST /api/v1/seedream/generations so safe network retries return the original task without charging credits twice.
API generation requires a paid account with an active subscription or credit pack purchase. Free accounts can inspect balances and create keys, but must upgrade before submitting jobs.
QUICK START
Choose a Seedream model mode and language below. Pass public HTTPS image URLs directly for image-to-image editing or layer decomposition—no separate upload step required.
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"ENDPOINTS
All endpoints live under /api/v1 and accept/return application/json.
| Method | Path | Description |
|---|---|---|
| POST | /api/v1/seedream/generations | Create a Seedream generation task (seedream-5-5, seedream-5-5-layers, or seedream-5-pro). Supports Idempotency-Key and webhook_url. |
| GET | /api/v1/seedream/generations/{id} | Retrieve task status, persistent image_url, images[], layers[] metadata, settled credit cost, and error details. |
| GET | /api/v1/seedream/generations | List your Seedream generations (web and API shared). Supports ?page=1&limit=20 (max 50), ?model=, and ?status=success|failed|pending|processing. |
| GET | /api/v1/credits | Query your current remaining credit balance, paid entitlement status, and the exact credit pricing for all three Seedream models. |
REQUEST SCHEMA
Only Seedream family models are accepted by this endpoint. Publicly accessible HTTP(S) image URLs are validated for safety and passed directly without a separate upload step.
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | One of "seedream-5-5", "seedream-5-5-layers", or "seedream-5-pro". Non-Seedream models return 400 invalid_model. |
| prompt | string | Conditional | Required for seedream-5-5 (5–5,000 chars) and seedream-5-pro (3–5,000 chars); optional for seedream-5-5-layers (0–2,000 chars). |
| resolution | string | No | seedream-5-5: "1K", "1.5K" (default), "2K". seedream-5-5-layers: "1K", "1.5K" (default), "2K", "auto". seedream-5-pro: "1K" (default), "2K". Alias: size. |
| output_format | string | No | Output image format: "png" (default) or "jpeg". |
| webhook_url | string (HTTPS) | No | Public HTTPS endpoint to receive a POST callback when the task reaches success, failed, or canceled. |
| webhook_secret | string | No | Optional 16–256 character secret used to sign webhook payloads via HMAC-SHA256 in the X-Seedream-Signature header. Requires webhook_url. |
| Parameter | Type | Required | Description |
|---|---|---|---|
| aspect_ratio | string | No | "1:1", "4:3", "3:4", "16:9", "9:16", "2:3", "3:2", or "21:9". seedream-5-5 image-to-image also supports "auto" (default "auto"); seedream-5-pro defaults to "1:1". |
| image_urls | string[] | No | Up to 10 public image URLs (JPG, PNG, or WebP) to activate image-to-image editing. Omit for text-to-image. Aliases: images, image_input. |
| background | string | No | seedream-5-5 only: "auto" (default), "transparent" (requires output_format: "png"), or "opaque". |
| Parameter | Type | Required | Description |
|---|---|---|---|
| image_url | string (URL) | Yes | Single public HTTP(S) image URL to decompose into editable layers (PNG or JPEG recommended). Aliases: image, image_urls[0]. |
| max_images | integer | No | Maximum number of decomposed layer images from 2 to 100 (default: 2). Unused layer credits are refunded automatically upon completion. |
| text_recognition | boolean | No | When true, detects and separates text elements into dedicated transparent layers. Default: false. |
RESPONSE OBJECT
Tasks transition from pending → processing → success (or failed / canceled). Completed responses return persistent public image URLs in image_url and images[], plus structured layers[] metadata for seedream-5-5-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"
}WEBHOOKS
Provide webhook_url when creating a generation to avoid constant polling. We send an HTTPS POST request as soon as the task reaches a terminal state (success, failed, or canceled).
{
"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);
}PRICING & BILLING
Every Seedream API call uses the exact same credit formula as the web studio and draws from your shared account balance.
| Model | Resolution | Base Credits | Reference & Layer Formula |
|---|---|---|---|
| seedream-5-5 | 1K / 1.5K | 6 credits | Text-to-Image: 6 credits. Image-to-Image: 6 + floor(images × 1.5) credits (1–10 images). |
| seedream-5-5 | 2K | 12 credits | Text-to-Image: 12 credits. Image-to-Image: 12 + floor(images × 1.5) credits (1–10 images). |
| seedream-5-5-layers | 1K / 1.5K (2K / auto) | 6 (or 12) / layer | Reserves max_images × layer rate + 1 upfront; settles actual_layers × layer rate + 1 and auto-refunds unused slots. |
| seedream-5-pro | 1K / 2K | 7 / 14 credits | First reference image is free; each additional reference image (2–10) costs +1 credit. |
ERROR HANDLING
Error responses return a consistent JSON shape: {"error": {"code": "...", "message": "..."}}.
| HTTP | Error Code | Meaning & Resolution |
|---|---|---|
| 400 | invalid_model / invalid_parameters / invalid_webhook_url | Verify that model is a Seedream model, prompt length and resolution are valid, transparent background uses PNG, and all media/webhook URLs target public hosts. |
| 401 | unauthorized | Missing, malformed, or revoked Bearer API key. |
| 402 | insufficient_credits | Account credit balance is lower than required for the requested model, resolution, and input count. Top up via Pricing. |
| 403 | paid_account_required | API access requires an active subscription or credit pack purchase. |
| 404 | not_found | The requested Seedream generation ID does not exist, is not a Seedream task, or belongs to another account. |
| 409 | idempotency_conflict | The same Idempotency-Key was reused with a different model or generation mode. |
| 502 | upstream_error | Generation submission failed. Reserved credits have been refunded automatically. |
FAQ
The API strictly exposes the Seedream model family: seedream-5-5 (text-to-image and image-to-image), seedream-5-5-layers (layer decomposition), and seedream-5-pro (text-to-image and image-to-image).
Yes. API requests consume credits from the exact same FIFO credit ledger as the Seedream 5.5 web studio, and every API-created task appears in your Personal Center History where you can inspect or download it.
Any account with a valid paid entitlement (an active subscription or a credit pack purchase) can call the Seedream API. Create your sk- API key from Personal Center → API Keys.
Credits are reserved upfront for max_images layers plus 1 input credit. When decomposition completes, you are billed only for the actual number of returned layers plus 1 credit, and the remaining reserved credits are refunded automatically.
Pass a 16–256 character webhook_secret alongside webhook_url when creating a generation. On delivery, compute HMAC-SHA256 over "{X-Seedream-Timestamp}.{rawBody}" with your secret and compare it in constant time against X-Seedream-Signature.
Include a unique Idempotency-Key HTTP header on POST /api/v1/seedream/generations. Retrying with the same key returns HTTP 200 with the original task instead of creating a duplicate job or charging credits again.
Create an API key in seconds and ship Seedream 5.5 image generation, editing, transparent assets, and layer decomposition directly in your app.