비디오 및 자료
작업 가져오기 (Volc 호환)
cgt 작업 ID를 사용하여 Seedance 호환 작업을 가져옵니다.
개요
create 시 반환된 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: 호환성을 위해 에코(echo)된 모델 식별자입니다.status: 위의 상태 값 중 하나입니다.content.video_url: 성공 시 최종 비디오 URL입니다.content.last_frame_url: 요청되었고 사용 가능한 경우에만 존재합니다.usage: 사용 가능한 경우 토큰 사용량입니다.created_at및updated_at: 작업 타임스탬프입니다.error: 오류 상세 정보가 있을 때 반환하는 선택 필드입니다.error.code와error.message를 확인하고status만으로 필드 존재 여부를 판단하지 마세요.
응답에는 progress, return_last_frame, watermark, priority, camera_fixed와 같은 TokenLab 필드가 포함되지 않습니다.
예시
curl https://api.tokenlab.sh/api/v3/contents/generations/tasks/cgt-20260102030405-a1b2c \
-H "Authorization: Bearer $TOKENLAB_API_KEY"{
"id": "cgt-20260102030405-a1b2c",
"model": "doubao-seedance-2.0",
"status": "succeeded",
"content": {
"video_url": "https://example.com/result.mp4"
},
"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