Recipe 06 · HTTP errors · fail · overdue
Errors, failures, and jobs that won't finish
There are three different ways a Seedance job can go wrong, and they need different handling: the request is rejected up front, the job runs and ends in fail, or the job simply takes longer than you were prepared to wait. Mixing them up is how clients end up double-charging themselves.
1. Rejected at the door: HTTP errors
These come back immediately from createTask or recordInfo. With a rejected createTask no job exists, so there is nothing to poll.
| HTTP | Body | When |
|---|---|---|
| 400 | Invalid request parameters | The body is not { model, inputs } shaped (e.g. `input` instead of `inputs`, or callBackUrl is not a URL). |
| 400 | Invalid inputs for model + errors[] | A field inside inputs is missing or out of range, e.g. duration outside 4–30. Each issue has a path. Nothing is charged. |
| 400 | Unknown model | The model string is not a Kinovi model id. |
| 400 | Missing taskId parameter | recordInfo was called without ?taskId=. |
| 401 | Missing Authorization header / Invalid API Key / inactive or expired key | Auth failed before anything else ran. |
| 402 | Insufficient credits + required, available | The balance is below the amount reserved for this model and settings. Nothing is charged. |
| 403 | Access denied | On recordInfo: the task belongs to another account. On createTask: the model is not available to this account. |
| 404 | Task not found | recordInfo got a taskId that does not exist. |
| 429 | Concurrency limit reached + limit, current | Too many of your tasks are waiting or generating at once. |
| 500 | Unexpected error | Server-side failure. The docs say to retry with backoff. |
What to do with each
- 400 — fix the request. Read
errors[].pathwhen present; it points at the field. Don't retry unchanged. - 401 — check the header is exactly
Authorization: Bearer <key>and the key is active. Don't retry in a loop. - 402 — the body tells you
requiredandavailable. Top up or shorten the job; nothing was charged. - 403 — on recordInfo you are using a different key than the one that created the task; on createTask the model is not available to the account.
- 404 — the taskId doesn't exist. Check for truncation or a mixed-up environment.
- 429 — you are at your concurrency cap. The body includes
limitandcurrent. Wait for one of your own jobs to reach a terminal status, then submit. A slot frees as soon as a task finishes; there is no separate hourly limit. - 500 — the docs say to retry with backoff. On createTask, check whether a task was created before you retry if your code can't tell.
2. Ran and failed: status fail
A job that ends in fail carries an error object with code and message, and its credits are refunded in full.
{
"taskId": "task_…",
"status": "fail",
"output": null,
"error": {
"code": "asset_review_failed",
"message": "Reference image 1 failed review. Please replace it."
},
"createTime": 1790090613532,
"completeTime": 1790090702114
}| error.code | Cause | Next step |
|---|---|---|
| asset_review_failed | A reference could not be fetched, broke an input limit, or was rejected by media review. The message names which one. | Re-host or replace that file. Images: aspect 0.4–2.5, width 300–6000 px. Videos: 2–30 s at 24–60 FPS. |
| InvalidParameter | For example, videoUrls add up to more than 30 seconds. | Trim or drop a clip, then resubmit. |
| 1001 · download | A videoUrls entry could not be downloaded. | Check the URL is public and not expired. |
| 1001 · review | The input or the generated result failed moderation, or was flagged for a policy or copyright reason. | Change the prompt or references. Retrying unchanged is unlikely to help. |
| 1001 · capacity | “Service temporarily unavailable.” | Retry after a short delay. This is the one fail worth retrying unchanged. |
Kinovi's Seedance 2.5 page also notes that when the first route rejects a task for review reasons, it resubmits on a second route automatically, with no new request and no second charge. A fail you receive has already been through that.
3. Still running: waiting or generating for a long time
This is the case people most want a number for, and the honest answer is that the API does not define a server-side timeout or a “stuck” status. A job is in progress until it is success or fail. What the provider does publish is a patience floor: poll for at least 20 minutes for Seedance 2.5 and 15 minutes for extend and edit before treating a task as stuck.
Everything beyond that is your policy. Decide it once, put it in configuration, and make it about your users' experience rather than a guess about the backend:
// Your policy, written down. Nothing here is an official value.
const POLICY = {
// The provider's docs say to poll at least 20 min (2.5) / 15 min (extend, edit)
// before calling a task stuck. Pick something at or above that floor.
clientTimeoutMs: Number(process.env.SEEDANCE_CLIENT_TIMEOUT_MS ?? 30 * 60_000),
};
function classify(task, now = Date.now()) {
if (task.status === "success" || task.status === "fail") return "done";
const age = now - task.createTime; // server clock, not yours
return age > POLICY.clientTimeoutMs ? "overdue" : "running";
}
// "overdue" means: stop blocking the user, keep the taskId,
// re-check it on a slow schedule, and alert a human — do not resubmit blindly.- Measure age from
createTime, the server's clock, not from when your code started. - When you pass your own timeout, stop blocking the user and say so plainly (“still rendering — we'll notify you”).
- Keep checking the same taskId on a slow schedule. A late success is still a success.
- Do not resubmit automatically. The original job is still reserved and may still finish; a duplicate is a second charge and a second slot against your concurrency cap.
- If a job stays unresolved well past your timeout, contact the provider with the taskId and both timestamps.
Rumors that a future Seedance 3.0 will “never time out” or finish in a fixed number of seconds are not used here. Seedance 3.0 is not released; there is nothing first-party to quote.