Overview
These endpoints are for teams that already use the Volc-style Seedance task shape. They preserve the task-oriented request and response structure while using TokenLab authentication, billing, model availability, and task polling. See also Seedance 2.0 Video Models and Video Generation.Authentication And Endpoints
- Use
Authorization: Bearer <TOKENLAB_API_KEY>. - Volc AK/SK signing is not accepted in this version. Requests with only AK/SK signing return a Volc-style authentication error.
- Use the official task path:
POST /api/v3/contents/generations/tasks. - Existing TokenLab Action aliases are retained only for backward compatibility. They are not part of the official wire-compatible task contract.
Content Rules
type: "text"is the prompt text.type: "image_url"withoutrole, or withrole: "first_frame", is treated as the first frame.role: "last_frame"must be paired with a first frame.role: "reference_image",reference_video, andreference_audioare used as references.image_url.urlaccepts a public image URL or a material URI such asasset://asset-YYYYMMDDHHMMSS-xxxxx. Theroledetermines whether that material is a first frame, last frame, or reference image.- Do not mix first/last frame inputs with reference media in one request.
- The REST body accepts only official top-level fields. TokenLab-specific fields such as top-level
material_asset_id,material_asset_ids, andpriorityare rejected. Put a TokenLab material URI inside the officialimage_url.urlobject instead.
Parameter Notes
ratioaccepts16:9,4:3,1:1,3:4,9:16,21:9, oradaptive.durationis the video length in seconds, including model-supported automatic duration values.resolutionaccepts480p,720p, or1080p.generate_audiodefaults tofalse; set it totruewhen synchronized audio is required.watermark,return_last_frame,seed,execution_expires_after, andsafety_identifierare accepted when valid for the selected model.callback_urlmay point to a public HTTP(S) endpoint. TokenLab validates and stores it without forwarding it to the provider handling the task.
Callback Delivery
Whencallback_url is present, TokenLab sends an HTTP POST whenever task status changes. Callback statuses are queued, running, succeeded, failed, and expired. The JSON body is exactly the task object returned by the get-task endpoint, regardless of which provider handled the task.
A 2xx response acknowledges delivery. For succeeded and failed, a delivery that does not succeed within five seconds is retried up to three times, matching the official behavior. The callback has only the standard JSON content header and no TokenLab-specific delivery headers. Redirects are not followed, and private or reserved network targets are rejected.
Callbacks are notifications. Keep polling available as a recovery path if your callback endpoint is unavailable for an extended period.
Image Preparation
Whencontent[] contains image URLs, TokenLab prepares them as reusable materials when required by the selected Seedance model. If preparation is not complete within 60 seconds, the create request returns a retryable material-preparing error instead of submitting an incomplete video task.
For existing materials, use the public asset-YYYYMMDDHHMMSS-xxxxx ID rather than an original asset ID returned by another system. TokenLab verifies material ownership before generation.
Create Response
Idempotent Retries And Lost Responses
For production creates, send a uniqueIdempotency-Key header and persist it with the exact JSON request body. If the connection closes before you receive the create response, retry the same REST request with the same TokenLab API credential, key, and unchanged body:
- If the original task was created, TokenLab returns the same
cgt-...ID and addsIdempotency-Replayed: true. - If the original request is still being registered, TokenLab returns
409 IdempotencyRequestInProgresswithRetry-After; retry the same key and body after that delay. - Reusing the key with a different body returns
409 IdempotencyConflictand never creates a second task.
X-Request-ID or from identical request bodies without a key.
Example
REST Create
content[] item and declare its role:
Next Step
Use the returnedcgt-... ID with Get Task (Volc Compatible) until the task reaches a terminal status.