Docs/Quickstart

Quickstart

Ship your first successful Seedance job in three requests. This page assumes you have a NextAPI account. If not, create one.

1. Create an API key
Scoped, rotatable, environment-aware.
2. Submit a generation
One POST, one job_id.
3. Receive a webhook
Signed, replay-protected.

Authentication

All requests must include a bearer token. Keys are scoped to environment (live or test) and rate-limited independently.

Authorization: Bearer nxa_live_sk_9fa0b1c8...4e2a
X-NextAPI-Environment: live
POST/v1/video/generations

Create a job

Submits a Seedance generation. Returns a job_id and reserves credits against your balance. Credits are reconciled to the final amount on job.succeeded or fully refunded on job.failed.

1curl https://api.nextapi.top/v1/video/generations \
2 -H "Authorization: Bearer $NEXTAPI_KEY" \
3 -H "Idempotency-Key: 9c4fa1b2" \
4 -H "Content-Type: application/json" \
5 -d {
6 "model": "seedance-2.0-pro",
7 "prompt": "Drone orbiting a lighthouse at dusk",
8 "duration_seconds": 6,
9 "resolution": "1080p"
10 }
1{
2 "id": "job_7Hc9Xk2Lm3NpQ4rS",
3 "status": "queued",
4 "estimated_credits": 1.0
5}

Webhook events

Every job transition emits exactly one webhook. Events are ordered and at-least-once. Use the event.id for deduplication.

EventStatusEmitted when
job.queuedQueuedUpstream has acknowledged the job.
job.runningRunningSeedance began processing.
job.succeededSucceededOutput URL is ready. Credits finalized.
job.failedFailedJob terminated. Credits refunded in full.

Signature verification

Every webhook includes an X-NextAPI-Signature header. Verify the HMAC-SHA256 before trusting the payload.

1import crypto from "node:crypto"
2
3export function verify(rawBody, header, secret) {
4 const [tPart, vPart] = header.split(",")
5 const t = tPart.split("=")[1]
6 const v = vPart.split("=")[1]
7
8 const expected = crypto
9 .createHmac("sha256", secret)
10 .update(`${t}.${rawBody}`)
11 .digest("hex")
12
13 const fresh = Math.abs(Date.now() / 1000 - Number(t)) < 300
14 return fresh && crypto.timingSafeEqual(
15 Buffer.from(expected),
16 Buffer.from(v),
17 )
18}

Idempotency

Include an Idempotency-Key header on POST requests to safely retry without creating duplicate jobs. Keys are scoped per API key and expire after 24 hours.

GET/v1/videos/:id

Retrieve a Video

Fetch the current state of a generation job by its ID. Returns the video URL once generation completes, or the current status and progress otherwise.

GET/v1/videos

List Videos

Returns a paginated list of generation jobs for the authenticated organization. Use ?limit= and ?offset= for pagination.

Webhook Retries

Webhooks are retried with exponential backoff up to 5 times. If your endpoint returns a non-2xx status, we retry at 1m, 5m, 30m, 2h, and 12h intervals. Each delivery includes the same X-Webhook-Signature header.

Rate Limits

API requests are rate-limited per key. Limits are returned in response headers: X-RateLimit-Remaining and X-RateLimit-Reset. Default: 600 requests/minute for business keys, 300/min for admin keys. Enterprise customers can negotiate higher limits.

Error Codes

All errors follow a consistent JSON format with error.code and error.message. Common codes: invalid_request, unauthorized, rate_limit_exceeded, insufficient_credits, internal_error.

Changelog

v1.0April 2026

Initial release — Seedance 2.0 Pro support, webhook events, idempotency keys, spend controls, and configurable moderation profiles.