비디오
모델을 선택해 작업 생성, 상태 조회, 영상 다운로드 예제를 확인하세요.
동영상 모델
기타 동영상 API
Kling 4.0 Omni 영상 생성
Use a Token168 API key with access to kling-4.0. The path selects the model. Replace example media URLs with reachable HTTPS URLs or authorized asset:// references.
요청 매개변수 ↓POST /omni-video/kling-4.0curl -X POST https://www.token168.cc/omni-video/kling-4.0 \
-H "Authorization: Bearer $TOKEN168_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [
{
"type": "prompt",
"text": "A white ceramic cup on a plain wooden table. Static camera, soft daylight."
}
],
"settings": {
"resolution": "720p",
"duration": 3,
"aspect_ratio": "16:9"
}
}'요청 매개변수
| 필드 | 지원 값과 동작 |
|---|---|
| contents[].type / text | Include one prompt item with text. Use @id to reference media or a voice by its unique ID. |
| contents[].type / url / id | Use first_frame, middle_frame, last_frame, refer_image, feature_video or base_video. Use a reachable URL and a unique id when referencing the item from the prompt. |
| contents[].voice_id | Use a supported preset voice_id and assign it a unique id. The subject library and element_id are unsupported. |
| settings.resolution | 720p or 1080p. Defaults to 1080p. 4k is not supported. |
| settings.dynamic_range | sdr. hdr is not supported. |
| settings.audio | native generates audio and is the default. original, which preserves input audio, is not supported. |
| settings.aspect_ratio | 21:9, 16:9, 9:16, 1:1 or adaptive. With a feature video and no edit video or keyframe, use a fixed ratio. 4:3 and 3:4 are not supported. |
| settings.duration | 선택 정수이며 3~30초입니다. 생략하면 프롬프트나 base 영상을 따르며 대체 값은 10초입니다. |
| options.watermark_info.enabled | Optional boolean. With true, check outputs[].watermark_url for an available watermarked copy. |
| options.callback_url / external_task_id | Not supported. Poll by the task ID returned after creation. |
| GET /tasks / POST /tasks | GET accepts task_ids with up to 20 IDs. external_task_ids and cursor listing via POST are not supported. |
| HTTP 400 / 501 | Unsupported create parameters or task query parameters return HTTP 400 with a message. Cursor-based listing returns HTTP 501. |
| Pricing | Prices depend on resolution and whether there is video input. Without video input, billable seconds equal output seconds. With video input, billable seconds equal max(total input seconds, output seconds) plus output seconds. See Pricing for rates. |
Set TASK_ID to data.id from the create response. Poll while status is submitted or processing. On succeeded, set VIDEO_URL to outputs[0].url and download it promptly. On failed, inspect the task message.
GET /tasks?task_ids=…curl --get "https://www.token168.cc/tasks" \
-H "Authorization: Bearer $TOKEN168_API_KEY" \
--data-urlencode "task_ids=$TASK_ID"VIDEO_URL = outputs[0].url
outputs[0].urlcurl --fail "$VIDEO_URL" --output video.mp4워터마크 영상 다운로드
WATERMARK_URL = outputs[0].watermark_url
outputs[0].watermark_urlcurl --fail "$WATERMARK_URL" --output video-watermark.mp4Wan 3.0
표준판과 Prime의 텍스트 영상 예제입니다.
이 예제는 5초, 480P, 16:9 무음 영상을 생성합니다. 응답의 id를 저장하세요.
POST /v1/videoscurl -X POST https://www.token168.cc/v1/videos \
-H "Authorization: Bearer $TOKEN168_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "wan3.0-video",
"prompt": "A red toy boat floats gently on a calm blue pond, soft daylight, steady camera, no text, no people.",
"duration": 5,
"size": "480P",
"metadata": {
"input": {
"prompt": "A red toy boat floats gently on a calm blue pond, soft daylight, steady camera, no text, no people.",
"media": []
},
"parameters": {
"ratio": "16:9",
"audio": false
}
}
}'요청 매개변수
| 필드 | 지원 값과 동작 |
|---|---|
| model | wan3.0-video / wan3.0-video-prime |
| prompt / metadata.input.prompt | Provide a prompt or media. When both prompt locations are set, metadata.input.prompt takes precedence. The model counts each character and truncates after 20,000. |
| metadata.input.media[] | Each item takes type and url. Omit the array for text-only requests. first_frame and last_frame allow one each; last_frame requires first_frame. Up to 10 reference_image, 5 reference_video, and 5 reference_audio entries. file and link each allow one, and cannot be combined. Frame inputs cannot be combined with references. |
| metadata.input.media[].url | Supply a reachable URL or a supported data URI. Reference video and audio each require 1–15 s per asset and at most 15 s in total per type. Reference video requires at least 16 fps. |
| size / metadata.parameters.resolution | 480P, 720P, or 1080P. Default: 1080P. Top-level size is the resolution in the examples. When both are given, metadata.parameters.resolution takes precedence. |
| duration / metadata.parameters.duration | Integer 2–30 s, or -1 for smart duration. Default: 5 s. With video input, input and output together must fit within 30 s. Nested duration takes precedence. |
| metadata.parameters.ratio | adaptive (default), 16:9, 9:16, 1:1, 4:3, or 3:4. Use these values for Token168; 21:9 is unavailable on the current compatibility path. |
| metadata.parameters.audio | Boolean. Default: true. Pass false to generate without sound. |
| metadata.parameters.seed | Integer from -1 to 2147483647. The same seed may still produce different outputs. |
| metadata.parameters.prompt_extend | Boolean. Default: true. Keep true when using file or link inputs. |
| metadata.parameters.watermark | Boolean. Default: false. Set true to add a watermark to the Wan output. |
video_task_123을 반환된 id로 바꾸세요. queued 또는 in_progress이면 계속 확인하고 completed이면 다운로드하세요. unknown이면 기존 작업을 먼저 확인하세요.
GET /v1/videos/{task_id}curl https://www.token168.cc/v1/videos/video_task_123 \
-H "Authorization: Bearer $TOKEN168_API_KEY"완료 후 video_task_123을 작업 id로 바꿔 MP4를 저장하세요.
GET /v1/videos/{task_id}/contentcurl https://www.token168.cc/v1/videos/video_task_123/content \
-H "Authorization: Bearer $TOKEN168_API_KEY" \
--output video.mp4기타 동영상 API
Seedance 텍스트 기반 동영상
텍스트 기반 생성은 content에 text 항목만 넣습니다. 생성 옵션은 최상위에 두고 이미지 별칭이나 metadata 래퍼를 추가하지 마세요.
curl https://www.token168.cc/api/v3/contents/generations/tasks \
-H "Authorization: Bearer $TOKEN168_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "dreamina-seedance-2-0-260128",
"content": [
{"type": "text", "text": "A futuristic tech city, but with a strange, surreal quality. People are more open and free, focused on developing themselves. The city blends pristine natural ecosystems with modern technology. Residential areas are highly ecological, green development is advanced, all power comes from green electricity, and controlled nuclear fusion, space elevators, and extremely deep underground spaces have already been achieved."}
],
"duration": 4,
"resolution": "480p",
"ratio": "16:9",
"generate_audio": false,
"watermark": false
}'
MediaKit 립싱크
video_url과 audio_url에 HTTPS URL 또는 asset:// ID를 입력합니다. model은 보내지 않습니다. 내부 byteplus-lip-sync 기능으로 API 키 권한, 채널 선택 및 초당 요금을 적용합니다. enable_video_loop의 기본값은 false이며 명시한 false도 유지합니다.
입력은 대기 및 처리 기간 내내 접근할 수 있어야 합니다. 만료되었거나 유효 기간이 부족한 서명 URL은 제출 전에 거부합니다. 입력당 최대 64 MiB, 1800초입니다. 동영상은 한 사람이 등장하는 비 HDR H.264 MP4이며 오디오는 MP3, AAC, WAV, M4A, FLAC을 지원합니다. 스트림 검증은 얼굴 수나 립싱크 품질을 판정하지 않습니다.
입력 시간을 측정한 뒤 한도를 예약합니다. loop=false는 더 짧은 입력, true는 오디오 길이로 예상합니다. 성공하면 result.duration과 생성 시점 가격으로 한 번만 정산하고 명확한 실패에는 예약액을 환불합니다. unknown 상태는 원래 작업을 조회하고 다시 제출하지 마세요.
반환된 Token168 task_id로 조회합니다. 상태는 running, completed, failed, unknown입니다. completed 후 result.video_url은 임시 권한이 포함된 다운로드 링크이므로 공개하지 마세요. 권한 매개변수가 없는 다운로드 주소에는 API 키가 필요합니다. 출력 링크는 24시간 후 만료되므로 즉시 다운로드하세요. 영구 보관이나 임의 외부 URL의 자동 갱신은 보장하지 않습니다.
curl -X POST https://www.token168.cc/api/v1/tools/lip-sync \
-H 'Authorization: Bearer <TOKEN168_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{"video_url":"asset://<VIDEO_ID>","audio_url":"asset://<AUDIO_ID>","enable_video_loop":false}'
curl https://www.token168.cc/api/v1/tasks/<TASK_ID> \
-H 'Authorization: Bearer <TOKEN168_API_KEY>'
curl https://www.token168.cc/v1/tasks/<TASK_ID>/artifacts/video/content \
-H 'Authorization: Bearer <TOKEN168_API_KEY>' -o lip-sync.mp4
기존 호환 경로
기존 연동은 설정된 호환 경로를 계속 사용할 수 있지만 요청 본문은 해당 모델의 프로토콜을 따라야 합니다. 새 Seedance 연동은 위의 네이티브 예시를 사용하세요. 모든 모델이 동일한 이미지 별칭을 지원하는 것은 아닙니다.
| 경로 | 상태 | 참고 |
|---|---|---|
| /v1/videos | 사용 가능 | 호환 생성 경로. 선택한 모델의 프로토콜을 따릅니다. |
| /v1/videos/{task_id} | 사용 가능 | 호환 상태 조회 경로. |
| /v1/videos/{task_id}/content | 사용 가능 | 콘텐츠 프록시 경로입니다. |
| /v1/video/generations | 사용 가능 | 기존 생성 경로입니다. |
| /v1/video/generations/{task_id} | 사용 가능 | 기존 상태 경로입니다. |