TokenLab

Video & Materials

Get Task (Volc Compatible)

Get a Seedance compatibility task by its cgt task ID.

GET
/api/v3/contents/generations/tasks/{id}

Overview

Use the cgt-... ID returned by create. Poll every few seconds while the task is queued or running. Stop when the task is succeeded, failed, cancelled, or expired.

Do not reuse the unified v1 task enum or response struct here. /v1/tasks/{id} uses pending, processing, completed, and failed; this v3 endpoint uses the official enum above. In the v3 JSON object, duration is a string when present and error is optional and contains error details when available. A strict Go client should declare Duration as string with the JSON tag duration,omitempty, and stop on every v3 terminal status.

See also Seedance 2.0 Video Models and Video Generation.

Status Values

  • queued: accepted and waiting to run.
  • running: generation is in progress.
  • succeeded: result is ready and content.video_url is present.
  • failed: generation failed; inspect error.code and error.message.
  • cancelled: the task was cancelled before completion.
  • expired: the task expired before completion.

Response Fields

  • id: compatibility task ID, starting with cgt-.
  • model: the model value you sent when creating the task.
  • status: one of the status values above.
  • content.video_url: final video URL on success. It is a TokenLab result link that stays valid for 30 days; see Data retention.
  • content.last_frame_url: present only when requested and available.
  • usage: completion_tokens and total_tokens when available, plus tool_usage.web_search when the web search tool ran.
  • created_at and updated_at: Unix timestamps in seconds.
  • error: { code, message } when error details are available. Do not infer its presence solely from status.
  • Request values set for the task are echoed when available: seed, resolution, ratio, duration (string), generate_audio, service_tier, execution_expires_after, safety_identifier, tools, draft, draft_task_id, frames, and framespersecond.

The response never adds TokenLab fields such as progress, return_last_frame, watermark, priority, or camera_fixed.

An unknown or expired task ID returns 404; an ID that belongs to another organization returns 403.

Example

curl https://api.tokenlab.sh/api/v3/contents/generations/tasks/cgt-20260102030405-a1b2c \
  -H "Authorization: Bearer $TOKENLAB_API_KEY"
{
  "id": "cgt-20260102030405-a1b2c",
  "model": "seedance-2.0",
  "status": "succeeded",
  "content": {
    "video_url": "https://api.tokenlab.sh/v1/media-results/3f2b8c1e-6d4a-4e9b-8a7c-2d5e1f0b9c4a.mp4?token=…"
  },
  "usage": {
    "completion_tokens": 123456
  }
}
Go
type SeedanceTask struct {
    ID       string `json:"id"`
    Status   string `json:"status"`
    Duration string `json:"duration,omitempty"`
}

func isTerminal(status string) bool {
    switch status {
    case "succeeded", "failed", "cancelled", "expired":
        return true
    default:
        return false
    }
}
curl -X GET "https://example.com/api/v3/contents/generations/tasks/string"
{  "id": "string",  "model": "string",  "status": "queued",  "content": {    "video_url": "http://example.com",    "last_frame_url": "http://example.com"  },  "seed": 0,  "resolution": "string",  "ratio": "string",  "duration": "string",  "frames": 0,  "framespersecond": 0,  "generate_audio": true,  "tools": {    "type": "web_search"  },  "safety_identifier": "string",  "draft": true,  "draft_task_id": "string",  "service_tier": "string",  "execution_expires_after": 0,  "usage": {    "completion_tokens": 0,    "total_tokens": 0,    "tool_usage": {      "web_search": 0    }  },  "error": {    "code": "string",    "message": "string"  },  "created_at": 0,  "updated_at": 0}

Authorization

BearerAuth
AuthorizationBearer <token>

API Key authentication. Create or manage API keys in Dashboard > API > API Keys.

In: header

Path Parameters

id*string

Compatibility task ID returned by the create endpoint. IDs start with cgt-.

Response

application/json

application/json

application/json

application/json

application/json

application/json