비디오 및 자료
작업 가져오기 (Volc 호환)
cgt 작업 ID를 사용하여 Seedance 호환 작업을 가져옵니다.
개요
생성 시 반환된 cgt-... ID를 사용하십시오. 작업 상태가 queued 또는 running인 동안 몇 초마다 폴링(poll)하십시오. 작업이 succeeded, failed, cancelled 또는 expired 상태가 되면 중단하십시오.
여기서는 통합 v1 작업 enum이나 응답 구조체를 재사용하지 마십시오. /v1/tasks/{id}는 pending, processing, completed 및 failed를 사용하지만, 이 v3 엔드포인트는 위의 공식 enum을 사용합니다. v3 JSON 객체에서 duration은 존재할 경우 문자열이며, error는 선택 사항으로 사용 가능한 경우 오류 세부 정보를 포함합니다. 엄격한 Go 클라이언트는 Duration을 JSON 태그 duration,omitempty와 함께 string으로 선언해야 하며, 모든 v3 터미널 상태에서 중단해야 합니다.
Seedance 2.0 비디오 모델 및 비디오 생성도 참조하십시오.
상태 값
queued: 수락되어 실행 대기 중입니다.running: 생성이 진행 중입니다.succeeded: 결과가 준비되었으며content.video_url이 존재합니다.failed: 생성이 실패했습니다.error.code및error.message를 확인하십시오.cancelled: 작업이 완료되기 전에 취소되었습니다.expired: 작업이 완료되기 전에 만료되었습니다.
응답 필드
id:cgt-로 시작하는 호환 작업 ID입니다.model: 작업 생성 시 전송한model값입니다.status: 위의 상태 값 중 하나입니다.content.video_url: 성공 시 최종 비디오 URL입니다. 이는 30일 동안 유효한 TokenLab 결과 링크입니다. 데이터 보존을 참조하십시오.content.last_frame_url: 요청되었고 사용 가능한 경우에만 존재합니다.usage: 사용 가능한 경우completion_tokens및total_tokens가 포함되며, 웹 검색 도구가 실행된 경우tool_usage.web_search가 포함됩니다.created_at및updated_at: 초 단위의 Unix 타임스탬프입니다.error: 오류 세부 정보를 사용할 수 있는 경우{ code, message }가 포함됩니다.status만 보고 존재 여부를 추론하지 마십시오.- 작업에 설정된 요청 값은 사용 가능한 경우 에코(echo)됩니다:
seed,resolution,ratio,duration(문자열),generate_audio,service_tier,execution_expires_after,safety_identifier,tools,draft,draft_task_id,frames,framespersecond.
응답에는 progress, return_last_frame, watermark, priority 또는 camera_fixed와 같은 TokenLab 필드가 추가되지 않습니다.
알 수 없거나 만료된 작업 ID는 404를 반환하며, 다른 조직에 속한 ID는 403을 반환합니다.
예시
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
}
}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}인증
BearerAuth API 키 인증입니다. Dashboard > API > API Keys에서 API 키를 생성하거나 관리하십시오.
위치: header
경로 매개변수
생성 엔드포인트에서 반환된 호환성 작업 ID입니다. ID는 cgt-로 시작합니다.
응답
application/json
application/json
application/json
application/json
application/json
application/json