bytedance/seedream-4-5
Seedream 4.x and 5.0 Lite — BytePlus's workhorse image models.
Text-to-image and image-to-image, with size as a parameter and an optional batch mode that returns several related images from one request.
Faster than 5.0 Pro and available on both the synchronous and the polling route.
| Slug | bytedance/seedream-4-5 |
| Kind | image |
| Vendor | bytedance |
| Endpoint | POST /v1/byteplus/images/async |
View pricing and billing conditions
Example request
curl https://api.sociaro.com/v1/byteplus/images/async \
-H "Authorization: Bearer $SOCIARO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "bytedance/seedream-4-5",
"prompt": "a paper boat on a rain-soaked street"
}'# Requires Python 3 and requests (pip install requests).
import os
import requests
payload = {'model': 'bytedance/seedream-4-5',
'prompt': 'a paper boat on a rain-soaked street'}
response = requests.post(
'https://api.sociaro.com/v1/byteplus/images/async',
headers={
'Authorization': 'Bearer ' + os.environ['SOCIARO_API_KEY'],
'Content-Type': 'application/json',
},
json=payload,
timeout=120,
)
response.raise_for_status()
print(response.text)// Run as an .mjs file with Node.js 22 or later.
const payload = {
"model": "bytedance/seedream-4-5",
"prompt": "a paper boat on a rain-soaked street"
};
const response = await fetch("https://api.sociaro.com/v1/byteplus/images/async", {
method: "POST",
headers: {
"Authorization": "Bearer " + process.env.SOCIARO_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify(payload),
});
if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
console.log(await response.text());Parameters
Seedream 4.x / 5.0 Lite — text-to-image and image-to-image
| Field | Type | Required | Default | Values | What it does |
|---|---|---|---|---|---|
prompt | string | yes | — | text | What to generate. |
image | string[] | no | — | public https urls | Present -> image-to-image. |
size | string | no | 2048x2048 | presets per model, or WxH | 4.0 takes 1K/2K/4K; 4.5 takes 2K/4K; 5.0 Lite takes 2K/3K/4K. In pixels, both the area and the aspect ratio must be in range — the generator says which one you missed. |
output_format | string | no | jpeg | jpeg · png | |
response_format | string | no | url | url | The async route is url-only. |
watermark | boolean | no | the vendor's (on) | true · false | BytePlus defaults this ON, and this route forwards your body as sent — send false for an image without the mark. |
seed | integer | no | random | — | Accepted and forwarded. NOT in the vendor's published field list, so treat reproducibility as unverified. |
sequential_image_generation | string | no | disabled | disabled · auto | auto returns a BATCH of related images instead of one. Billed per image actually generated. Seedream 5.0 Pro does not support this. |
sequential_image_generation_options | object | no | — | — | Settings for the batch above, per the vendor's reference. |
Worked example
curl https://api.sociaro.com/v1/byteplus/images/generations \
-H "Authorization: Bearer $SOCIARO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "bytedance/seedream-4-5",
"prompt": "a red paper boat on wet asphalt at night",
"size": "2K"
}'# Requires Python 3 and requests (pip install requests).
import os
import requests
payload = {'model': 'bytedance/seedream-4-5',
'prompt': 'a red paper boat on wet asphalt at night',
'size': '2K'}
response = requests.post(
'https://api.sociaro.com/v1/byteplus/images/generations',
headers={
'Authorization': 'Bearer ' + os.environ['SOCIARO_API_KEY'],
'Content-Type': 'application/json',
},
json=payload,
timeout=120,
)
response.raise_for_status()
print(response.text)// Run as an .mjs file with Node.js 22 or later.
const payload = {
"model": "bytedance/seedream-4-5",
"prompt": "a red paper boat on wet asphalt at night",
"size": "2K"
};
const response = await fetch("https://api.sociaro.com/v1/byteplus/images/generations", {
method: "POST",
headers: {
"Authorization": "Bearer " + process.env.SOCIARO_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify(payload),
});
if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
console.log(await response.text());How a job runs
These routes are a pass-through: you send BytePlus's own body and get their own response back, with our additions beside it. Generation takes longer than a request should wait, so it goes in three moves — submit, poll, collect.
# 1. submit — the id comes back as `id`. There is NO `job_id` on THIS response
curl -sS https://api.sociaro.com/v1/byteplus/contents/generations/tasks \
-H "Authorization: Bearer $SOCIARO_API_KEY" -H "Content-Type: application/json" \
-d '{ "model": "…", "content": [ … ] }'
# -> { "id": "cgt-…" }
# 2. poll every 5-10 s
curl -sS https://api.sociaro.com/v1/byteplus/contents/generations/tasks/cgt-… \
-H "Authorization: Bearer $SOCIARO_API_KEY"
# -> { "status": "running", … }
# -> { "status": "succeeded", "content": { "video_url": "<the vendor's own link>" },
# "media_url": "https://api.sociaro.com/v1/media/<media_id>" }
# 3. collect — the opaque id IS the credential, no header needed
curl -sSL "https://api.sociaro.com/v1/media/<media_id>" -o out.mp4
# Requires Python 3 and requests (pip install requests).
from pathlib import Path
import os
import time
import requests
# 1. submit — the id comes back as `id`. There is NO `job_id` on THIS response
# Save the complete request body in request.json.
response = requests.post(
'https://api.sociaro.com/v1/byteplus/contents/generations/tasks',
headers={
'Authorization': 'Bearer ' + os.environ['SOCIARO_API_KEY'],
'Content-Type': 'application/json',
},
data=Path('request.json').read_bytes(),
timeout=120,
)
response.raise_for_status()
submitted = response.json()
job_id = submitted['id']
print(submitted)
# 2. poll every 5-10 s
while True:
response = requests.get(
'https://api.sociaro.com/v1/byteplus/contents/generations/tasks/' + job_id,
headers={
'Authorization': 'Bearer ' + os.environ['SOCIARO_API_KEY'],
},
timeout=120,
)
response.raise_for_status()
result = response.json()
status = result['status']
if status == 'succeeded':
break
if status not in ('queued', 'running'):
raise RuntimeError(result)
time.sleep(5)
print(result)
# 3. collect — the opaque id IS the credential, no header needed
response = requests.get(
result['media_url'],
timeout=120,
)
response.raise_for_status()
Path('out.mp4').write_bytes(response.content)// Run as an .mjs file with Node.js 22 or later.
import { readFile, writeFile } from "node:fs/promises";
let jobId;
let result;
// 1. submit — the id comes back as `id`. There is NO `job_id` on THIS response
{
// Save the complete request body in request.json.
const response = await fetch("https://api.sociaro.com/v1/byteplus/contents/generations/tasks", {
method: "POST",
headers: {
"Authorization": "Bearer " + process.env.SOCIARO_API_KEY,
"Content-Type": "application/json",
},
body: await readFile("request.json"),
});
if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
const submitted = await response.json();
jobId = submitted.id;
console.log(submitted);
}
// 2. poll every 5-10 s
{
while (true) {
const response = await fetch("https://api.sociaro.com/v1/byteplus/contents/generations/tasks/" + jobId, {
headers: {
"Authorization": "Bearer " + process.env.SOCIARO_API_KEY,
},
});
if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
result = await response.json();
const status = result.status;
if (status === "succeeded") break;
if (!["queued", "running"].includes(status)) throw new Error(JSON.stringify(result));
await new Promise(resolve => setTimeout(resolve, 5000));
}
console.log(result);
}
// 3. collect — the opaque id IS the credential, no header needed
{
const response = await fetch(result.media_url);
if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
await writeFile("out.mp4", new Uint8Array(await response.arrayBuffer()));
}Images use POST /v1/byteplus/images/async and its poll in the same shape, and the faster models
also answer synchronously at POST /v1/byteplus/images/generations — one request, the picture in
the response. A model whose render outlasts the gateway's ~2-minute ceiling is refused there by
name, telling you to use the async route.
Reading the poll
Two differences will bite a client written against the poll-style routes. The SUBMIT returns
id, not job_id — code reading job_id there gets nothing and cannot poll at all. And status
is the VENDOR'S vocabulary: running, succeeded, failed — not processing, completed,
failed. A check for completed on this route never becomes true, which reads as a job that never
finishes rather than as an error.
The POLL response does carry job_id beside the vendor's id, as a convenience, and it returns
the vendor's whole body — around twenty fields — rather than the five-field shape the other routes
use. Gate on status rather than on the poll's HTTP code.
Prefer media_url over the vendor's raw link. Both are returned: content.video_url (or
data[].url for images) is theirs, kept for compatibility and due to be removed once nobody reads
it; media_url is ours. Ours points at our host, hides the vendor's storage, and expires. A second
asset arrives on the same terms — return_last_frame gives content.last_frame_url with
last_frame_media_url beside it.
Collecting the result
media_url is a capability: the opaque id is the credential, so no Authorization header is
needed and anyone holding the link can fetch it. It expires within the hour — download rather
than store the link.
Rules the gateway adds
Your key must be granted this model — 403 otherwise — and either spelling satisfies the grant:
our catalogue id or the vendor's own native one.
Because this is a pass-through, unknown fields go to the generator rather than being refused here,
and it is the generator that decides. The exception is resolution, which we check ourselves: an
unsupported tier is silently ignored upstream, so you would ask for the higher one, be handed a
lower one, and be charged. A tier we cannot price is refused at submit, before any money is spent,
with a message naming the ones this model has.
Ranges and enums are the generator's own, so an out-of-range value comes back as its rejection, in its wording and with its numbers.
Pricing
| Billable unit and options | Rate (USD) |
|---|---|
| per image | $0.04 |
View this model in the pricing catalogue. Your billing logs show the actual charge for each request.