NSFWAI.tv API
Generate Seedance videos with the models behind NSFWAI.tv, in the official ByteDance Ark (Volcengine / BytePlus ModelArk) request format. If your code already calls Ark, change the base URL and the key and it runs as is.
Quick start
- Click Turn on API on your account page. You get a key right away and can make more there.
- Point your Ark SDK or HTTP client at
https://api.nsfwai.tv/api/v3instead of the official base URL, and use your NSFWAI.tv key. - Create a task, then poll it or let us call you back when it is done.
# pip install 'volcengine-python-sdk[ark]'
import os, time
from volcenginesdkarkruntime import Ark
client = Ark(
base_url="https://api.nsfwai.tv/api/v3", # the only two lines that change
api_key=os.environ["NSFWAI_API_KEY"],
)
task = client.content_generation.tasks.create(
model="doubao-seedance-2-0-mini-260615",
content=[{"type": "text", "text": "She turns slowly toward the camera in a candlelit room"}],
ratio="9:16",
duration=5,
resolution="480p",
generate_audio=True,
)
while True:
t = client.content_generation.tasks.get(task_id=task.id)
if t.status in ("succeeded", "failed", "cancelled", "expired"):
break
time.sleep(10)
print(t.status, t.content.video_url if t.status == "succeeded" else t.error)Keys, task ids and URLs in the examples are examples. Credits are spent from your account balance, the same credits as on the site.
Authentication
Send your key as a bearer token on every request, the same header Ark uses:
Authorization: Bearer nt_live_xxxxxxxxxxxxxxxxxxxxxxxx- Keys start with
nt_live_and are shown once, when you create them. We keep only a hash. - An account can have up to 5 keys. Delete one on the account page and it stops working at once.
- A key spends its account's credits: keep it on your server, never in an app or a web page.
Models & pricing
Send the official ByteDance model id or our short name in model; we also accept thedreamina-… and nsfw-seedance-… names. The model you sent is echoed back in the task.
Video · credits per second of video
| Model | Official id | Short | Length | 480p | 720p | 1080p | 2K | 4K |
|---|---|---|---|---|---|---|---|---|
| Seedance 2.5 | doubao-seedance-2-5-260628 | sd25 | 4–30 sor -1 (auto) | 36 | 72 | 180 | 108 | 288 |
| Seedance 2.5 Flash | doubao-seedance-2-5-flash-261115 | sd25flash | 4–30 sor -1 (auto) | 24 | 48 | — | — | — |
| Seedance 2.0 | doubao-seedance-2-0-260128 | sd20 | 4–15 sor -1 (auto) | 24 | 48 | 120 | 84 | 240 |
| Seedance 2.0 Mini | doubao-seedance-2-0-mini-260615 | sd20mini | 4–15 sor -1 (auto) | 12 | 24 | 48 | 60 | 72 |
| Seedance 2.0 Fast | doubao-seedance-2-0-fast-260128 | sd20fast | 4–15 sor -1 (auto) | 18 | 39 | 63 | 75 | 87 |
| Wan 3.0 | wan30 | wan30 | 4–15 sor -1 (auto) | 288 | 288 | 288 | 288 | 288 |
| MiniMax H3 | mmh3 | mmh3 | 4–15 sor -1 (auto) | 288 | 288 | 288 | 288 | 288 |
- A task costs rate × seconds. A 5 s Seedance 2.0 Mini video at 480p is 60 credits; sound on or off costs the same.
- Reference videos are billed like output: each clip's length, rounded up to a whole second, is added to the seconds. Reference images and audio cost nothing extra.
duration: -1(auto) is charged as the longest clip the model makes; when the video is done, the seconds it did not use are refunded.- Failed tasks are refunded in full, including ones the provider turns down for content.
- Ratios:
adaptive(default),16:9,9:16,4:3,3:4,1:1,21:9.
Reference files per task
| Model | References | Longest reference clip |
|---|---|---|
| Seedance 2.5 | 30 images, 10 videos, 10 audio (50 in all) | 30 s |
| Seedance 2.5 Flash | 10 images, 5 videos, 5 audio (20 in all) | 30 s |
| Seedance 2.0 | 9 images, 3 videos, 3 audio (12 in all) | 15 s |
| Seedance 2.0 Mini | 9 images, 3 videos, 3 audio (12 in all) | 15 s |
| Seedance 2.0 Fast | 9 images, 3 videos, 3 audio (12 in all) | 15 s |
| Wan 3.0 | 9 images, 0 videos, 0 audio (9 in all) | 15 s |
| MiniMax H3 | 9 images, 3 videos, 3 audio (12 in all) | 15 s |
Images Coming soon
The image formats are not live yet. Prices when they are, per image:
| Model | Id | 1K | 2K | Notes |
|---|---|---|---|---|
| Seedream 5.5 | doubao-seedream-5-5-261028 | 18 | 30 | +8 per reference image after the first |
| Qwen Image 2.1 | qwen-image-2.1-turbo | 16 | 16 | Reference images included |
Create a video task
Asynchronous: the response is the task id; the video is made in the background. Fields you leave out or send as null take their default.
| Field | Type | Notes |
|---|---|---|
model | string | Required. See Models. |
content | array | Required. At most one text item (the prompt, up to 5,000 characters) and any reference files. A task needs a prompt or at least one file. |
ratio | string | adaptive (default) or a fixed ratio. |
duration | integer | Seconds, default 5; -1 lets the model choose (auto). |
resolution | string | 480p, 720p (default), 1080p, 2k, 4k, as the model allows. |
generate_audio | boolean | Default true. |
seed | integer | -1 to 4294967295; -1 or unset picks one. The seed used is returned. |
return_last_frame | boolean | Also return the last frame as an image (content.last_frame_url). |
callback_url | string | A public http(s) URL we POST the task to on every status change. See Callbacks. |
execution_expires_after | integer | Seconds, 3600–259200, default 172800. A task not finished by then ends as expired and is refunded. |
omni_reference_task_type | string | Seedance 2.5 and 2.5 Flash: auto, reference, edit, extend. With only reference files we send reference. |
output_format | string | mp4 (default) or mov (Seedance 2.5 series). |
priority, safety_identifier | Accepted and echoed back. | |
watermark | boolean | Accepted; videos are never watermarked. |
content items
| type | Shape | role |
|---|---|---|
text | { "type": "text", "text": "…" } | — |
image_url | { "type": "image_url", "image_url": { "url": "…" }, "role": "…" } | first_frame, last_frame or reference_image |
video_url | { "type": "video_url", "video_url": { "url": "…" } } | reference_video |
audio_url | { "type": "audio_url", "audio_url": { "url": "…" } } | reference_audio |
A file is a public http(s) URL or a base64 data URL (data:image/png;base64,…). We download it once and check what it really is, so an image sent as video_url is refused. Limits: images 30 MB, videos 50 MB, audio 15 MB. Ark asset:// ids are not supported.
Response
{ "id": "cgt-3f0c2a9e-5b1d-4c47-9a2e-0d6f1b7c8e21" }
# header: x-nsfwai-credits: 60 (credits charged for this task)Send an Idempotency-Key header to make retries safe: the same value from the same key returns the task it created the first time, without a second charge.
Retrieve a task
Returns the task object. The x-nsfwai-credits header carries what the task cost so far (after any refund).
| status | Meaning |
|---|---|
queued | Waiting: the task, or its reference files, have not reached the model yet. |
running | The model is making the video. |
succeeded | Done: content.video_url (and content.last_frame_url if asked for). |
failed | See error.code and error.message. Refunded. |
cancelled | Cancelled while queued. Refunded. |
expired | Not finished within execution_expires_after. Refunded. |
{
"id": "cgt-3f0c2a9e-5b1d-4c47-9a2e-0d6f1b7c8e21",
"model": "doubao-seedance-2-0-mini-260615",
"status": "succeeded",
"content": {
"video_url": "https://…/works/…/3f0c2a9e-5b1d-4c47-9a2e-0d6f1b7c8e21.mp4",
"last_frame_url": "https://…/works/…/3f0c2a9e-5b1d-4c47-9a2e-0d6f1b7c8e21-last.jpg"
},
"usage": { "completion_tokens": 40594, "total_tokens": 40594 },
"created_at": 1795764356,
"updated_at": 1795764437,
"seed": 28708,
"resolution": "480p",
"ratio": "9:16",
"duration": 5,
"framespersecond": 24,
"generate_audio": true,
"draft": false,
"service_tier": "default",
"execution_expires_after": 172800,
"priority": 0,
"output_format": "mp4"
}durationis the requested length, or for-1the real length once the video is done.usageandseedare what the model reported.created_atandupdated_atare Unix seconds.
List tasks
Your account's API video tasks, newest first, from all its keys.
| Query | Notes |
|---|---|
page_num | From 1. Default 1. |
page_size | 1–500. Default 10. |
filter.status | One status, e.g. succeeded. |
filter.task_ids | Repeat it, or separate ids with commas. |
filter.model | Any name of a model. |
curl "https://api.nsfwai.tv/api/v3/contents/generations/tasks?page_num=1&page_size=10&filter.status=succeeded" \
-H "Authorization: Bearer $NSFWAI_API_KEY"
# → { "items": [ { …task… }, … ], "total": 42 }Cancel or delete a task
- Queued: cancelled (status
cancelled) and refunded. - Succeeded, failed, cancelled or expired: deleted, with its video and last frame. Retrieving it then returns 404.
- Running: cannot be cancelled or deleted:
409 InvalidAction.TaskRunning. Try again when it has finished.
curl -X DELETE https://api.nsfwai.tv/api/v3/contents/generations/tasks/cgt-3f0c2a9e-5b1d-4c47-9a2e-0d6f1b7c8e21 \
-H "Authorization: Bearer $NSFWAI_API_KEY"
# → {}Callbacks
With callback_url set, we POST the task object (the same JSON as Retrieve) to it each time the status changes: queued, running, succeeded, failed,cancelled, expired.
- Answer with any 2xx. Otherwise we retry after 10 s, 1 min and 5 min, then stop; the task itself is not affected.
- Deliveries can arrive more than once or late: use the task id and its status, and retrieve the task if in doubt.
- Only public http(s) URLs are called.
Checking the signature
Every callback carries X-NSFWAI-Signature: t=<unix seconds>,v1=<hex>, where v1 is the HMAC-SHA256 of "<t>.<raw body>" with your callback secret. The secret is shown in the API section of your account page. Compute it over the body exactly as received, before parsing it.
import hashlib, hmac, time
def verify(raw_body: bytes, header: str, secret: str, tolerance: int = 300) -> bool:
"""header = request.headers["X-NSFWAI-Signature"], raw_body = the bytes as received"""
parts = dict(p.split("=", 1) for p in header.split(",") if "=" in p)
t, sig = parts.get("t"), parts.get("v1")
if not t or not sig or abs(time.time() - int(t)) > tolerance:
return False
expected = hmac.new(secret.encode(), f"{t}.".encode() + raw_body, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, sig)Errors
Errors use the Ark shape:
HTTP/1.1 400 Bad Request
{
"error": {
"code": "InvalidParameter",
"message": "Unsupported duration for doubao-seedance-2-0-mini-260615.",
"param": "duration",
"type": "BadRequest"
}
}| HTTP | code | When |
|---|---|---|
| 400 | InvalidParameter, MissingParameter | A field is missing, unsupported or out of range; param names it. A file that cannot be downloaded or is not what it says. |
| 401 | AuthenticationError | No key, or the key is wrong or deleted. |
| 402 | InsufficientCredits | Not enough credits for the task. Nothing is charged. |
| 403 | AccessDenied | The API is not turned on for the account (turn it on on the account page), or it was turned off. |
| 404 | InvalidEndpointOrModel.NotFound | Unknown model name. |
| 404 | ResourceNotFound | No such task on this account. |
| 409 | InvalidAction.TaskRunning | Cancel or delete on a running task. |
| 429 | RateLimitExceeded | Too many requests, or too many tasks at once. See Limits. |
When the model provider turns a task down after it was accepted (for exampleOutputVideoSensitiveContentDetected.PolicyViolation), the task ends as failed with the provider's code and message in error, and its credits come back.
Limits
| What | Limit |
|---|---|
| Requests per key | 120 per minute |
| Tasks queued or running at once, per key | 10 |
| Keys per account | 5 |
| Prompt | 5,000 characters |
| Reference files | Images 30 MB, videos 50 MB, audio 15 MB; counts per model under Models |
Over a limit you get 429 RateLimitExceeded; wait and retry.
Files
- Result videos and last frames are hosted by NSFWAI.tv;
contentlinks point to our storage, not the provider's. - They are kept for at least 7 days. Download what you want to keep.
- Reference files you send are stored with the task for the same time.
Differences from Ark
- Base URL and key are ours; the request and response formats are Ark's.
- Not supported:
draftmode anddraft_taskcontent,tools,asset://file ids. They return400 InvalidParameter. watermarkis accepted but ignored: videos are never watermarked.- Task ids look like Ark's (
cgt-…) but are ours; use them only with this API. - Prices are in NSFWAI.tv credits; the
x-nsfwai-creditsheader says what a task costs.
Images · Seedream Coming soon
Seedream 5.5 in the Ark image format: POST https://api.nsfwai.tv/api/v3/images/generations, synchronous, returning the images in the response. Prices under Models.
Qwen Image Coming soon
Qwen Image 2.1 in Alibaba DashScope's formats, for the DashScope and OpenAI SDKs:
- DashScope, synchronous:
POST https://api.nsfwai.tv/api/v1/services/aigc/multimodal-generation/generation - DashScope, asynchronous:
POST …/api/v1/services/aigc/image-generation/generationwithX-DashScope-Async: enable, thenGET …/api/v1/tasks/{task_id} - OpenAI-compatible:
POST https://api.nsfwai.tv/compatible-mode/v1/images/generations
Questions, or need a format we don't have yet? Write to [email protected].










+30 free credits