Skip to content

Errors, retries and recovery ​

Seedance API(v3)

Use https://api.tokenlio.ai with your platform Bearer Key and an exact model ID from the current catalog. Official references provide more field details; use the addresses, authentication and examples on this page for your calls.

Separate HTTP request errors from generation failure: a successful GET can return HTTP200 with task status=failed/expired. For material/verification responses, inspect ResponseMetadata.Error and Result.Error even on HTTP200.

Retain the actual HTTP status, complete body, code/message/type/param, numeric codes and valid extensions. The summary below provides common handling, not a complete fixed error enumeration. See the official catalog for additional generic errors.

HTTPNext steps
400Inspect required fields and specific parameters; corrected submissions are deliberate new intents
401 / 403Check the Key and current access; do not rotate Keys automatically
404Verify the ID, original Key and visibility; do not infer a refund or absence of submission
409Follow the actual conflict message without changing targets to force a retry
413Reduce the oversized request before submitting again
422An internal timeout can mean already submitted; recover the original intent
429 / 5xxBack off using Retry-After; preserve uncertain mutation/create intents

Recovery order ​

  1. Keep the original platform Key, body, task/operation identity and stable key.
  2. If a task id is known, query that task instead of POSTing again.
  3. For materials, query X-Tokenlio-Operation-Id; RequestId cannot replace it.
  4. If the result is unknown, recover with the same body/key, not a new key used as a probe.
  5. Follow TaskSubmissionPending / TaskSettlementPending / TaskInUse messages; wait and query the original task on TaskOperationPending.

Unknown mutations and operation receipts ​

A mutation may return X-Tokenlio-Operation-Id; save that platform operation UUID. It is neither an asset ID nor ResponseMetadata.RequestId. RequestId is diagnostic and cannot replace the platform operation ID, even if it looks like a UUID.

bash
curl -sS --fail-with-body 'https://api.tokenlio.ai/api/v3/assets/operations/OPERATION_ID' \
  -H "Authorization: Bearer $TOKENLIO_API_KEY"

This GET has no body or query parameters and uses the original platform Key. It reads the original operation without resubmitting a mutation. Only state=succeeded is complete. sending/unknown/observed are not success; observed means a result has been observed, while rejected is a definitive rejection. Do not substitute the previous operation ID when the current response has no operation header.

Timeouts,429/5xx and internal timeouts encoded as HTTP422 may already have submitted. Keep the original body, stable key and operation ID for recovery. Without an operation ID, use the original Action/body/stable key to recover the same intent rather than creating another mutation. Check the actual HTTP status, ResponseMetadata.Error and Result.Error, not200 alone.

HTTP request errors ​

json
{
  "error": {
    "code": "MissingParameter",
    "message": "The request is missing the required parameter: model.",
    "type": "BadRequest",
    "param": "model"
  }
}
HTTPCodeMeaning
400MissingParameter / InvalidParameterMissing or invalid request fields.
401AuthenticationErrorMissing or invalid API Key.
403AccessDeniedAccess denied.
404NotFoundTask absent or inaccessible.
429See error.code/messageRequest, concurrency or usage limit reached.
500InternalServiceErrorUnexpected service error.
503NoAvailableServiceTemporarily unavailable.

HTTP errors include code, readable message and type; param identifies a field when known. Task-level errors use their own code/message inside the task object.

Next steps ​

Official references ​

Access leading AI models through one unified API