| Header Key | Kiểu dữ liệu | Bắt buộc | Mô tả |
|---|---|---|---|
apiKey (hoặc apikey) | string | Có | Khóa API Key bí mật được cấp riêng cho đối tác |
Content-Type | string | Có | application/json |
POST) đều hoạt động theo mô hình hàng đợi bất đồng bộ:[Client] ──(1) Gửi Request POST /video (hoặc /image, /audio) kèm webHookUrl──► [Partner API]
[Client] ◄─(2) Trả về ngay publicId & status: 1 (PENDING)────────────────────── [Partner API]
│
(3) Đẩy vào Queue xử lý
│
[Client] ◄════(4) Bắn Webhook POST kết quả khi AI render xong═════════════════════════╝
hoặc
[Client] ──(5) Chủ động Polling GET /<service>/:publicId─────────────────────► [Partner API]status):0 / 1 (PENDING): Đang xếp hàng đợi xử lý.1 / 2 (PROGRESSING / PROCESSING): Đang được AI worker xử lý render.2 / 3 (SUCCESS): Hoàn thành thành công, đã có URL file media.3 / 4 (FAIL): Thất bại (hệ thống tự động hoàn lại số dư tạm giữ/escrow).| Tính năng / Thông số | Dreamina-Seedance-2.5 (Mới nhất) | Dreamina-Seedance-2.0 / Fast (Tiêu chuẩn) |
|---|---|---|
| Partner Model ID | ep-20260809114245-bzj48 (hoặc ep-20260824222535-8ddl9) | dreamina-seedance-2-0-fast-260128 |
| Loại Input hỗ trợ | Text, Image, Video, Audio | Text, Image, Video, Audio |
Số lượng Ảnh tham chiếu (files) | Tối đa 30 ảnh (≤ 30MB/ảnh) | Tối đa 9 ảnh (≤ 30MB/ảnh) |
Số lượng Video tham chiếu (files) | Tối đa 10 video (2s – 30s/clip, ≤ 200MB) | Tối đa 3 video (2s – 15s/clip, ≤ 200MB) |
Số lượng Audio tham chiếu (files) | Tối đa 10 audio (2s – 30s/clip, ≤ 15MB) | Tối đa 3 audio (2s – 15s/clip, ≤ 15MB) |
Chế độ tạo video (mode) | • 1: Reference generation• 2: First & Last frame | • 1: Reference generation• 2: First & Last frame |
Độ dài xuất (seconds) | 4 đến 30 giây | 4 đến 15 giây |
Chế độ Smart Length (duration: 2) | ✅ Hỗ trợ (AI tự đo độ dài tối ưu) | ❌ Không hỗ trợ |
Độ phân giải (resolution) | 1 (480p), 2 (720p), 3 (1080p), 4 (4k) | 1 (480p), 2 (720p) |
Tỉ lệ khung hình (ratio) | 1 (21:9), 2 (16:9), 3 (4:3), 4 (1:1), 5 (3:4), 6 (9:16), 7 (adaptive) | 1 (21:9), 2 (16:9), 3 (4:3), 4 (1:1), 5 (3:4), 6 (9:16), 7 (adaptive) |
Định dạng xuất (outputFormat) | "mp4", "mov" | "mp4" |
Tự sinh âm thanh AI (outputSound) | ✅ Có hỗ trợ (true/false) | ✅ Có hỗ trợ (true/false) |
mode:1 (Reference Generation - Tạo video từ ảnh, video, audio tham chiếu).2 (First & Last Frame - Chuyển cảnh giữa 2 khung hình, yêu cầu truyền ảnh có role first_frame và last_frame).3 (Video Editing - Chỉnh sửa, thêm/xoá/thay thế chi tiết trong clip có sẵn theo mốc thời gian).4 (Video Extension - Kéo dài, tiếp nối câu chuyện từ clip có sẵn).resolution: 1 (480p), 2 (720p), 3 (1080p), 4 (4k).ratio: 1 (21:9), 2 (16:9), 3 (4:3), 4 (1:1), 5 (3:4), 6 (9:16), 7 (adaptive - bắt buộc khi sửa/kéo dài video).duration: 1 (Seconds - chỉ định số giây cụ thể qua seconds), 2 (SmartLength - tự động độ dài tối ưu, bắt buộc khi sửa video).POST /video)POST /video là cổng khởi tạo duy nhất phục vụ cho tất cả các loại hình sinh video của hệ thống:prompt và không cần truyền mảng files (hoặc để files: []):{
"partnerModelId": "ep-20260809114245-bzj48",
"name": "Text-to-Video: Drone Over Canyon",
"prompt": "Cinematic aerial drone shot soaring through a red rock canyon at golden hour, breathtaking landscape, photorealistic 4k, smooth cinematic camera motion",
"mode": 1,
"resolution": 3,
"ratio": 2,
"duration": 1,
"seconds": 5,
"outputFormat": "mp4",
"outputSound": true,
"watermark": false,
"webHookUrl": "https://your-webhook-domain.com/webhook/video"
}assetId của bức ảnh vào files với role: "reference_image". AI sẽ tạo chuyển động tự nhiên cho nhân vật và bối cảnh dựa theo câu lệnh prompt:{
"partnerModelId": "ep-20260809114245-bzj48",
"name": "Image-to-Video: Animate Portrait",
"prompt": "The woman gently turns her head toward the camera, smiles softly as the sea breeze blows her hair, cinematic depth of field, warm sunset lighting",
"mode": 1,
"resolution": 3,
"ratio": 2,
"duration": 1,
"seconds": 5,
"outputFormat": "mp4",
"outputSound": true,
"webHookUrl": "https://your-webhook-domain.com/webhook/video",
"files": [
{
"assetId": "4a71b290-7c23-42be-a37c-f179b00982df",
"role": "reference_image"
}
]
}mode: 2)files với role: "first_frame" và role: "last_frame":{
"partnerModelId": "ep-20260809114245-bzj48",
"name": "First & Last Frame: Day to Night",
"prompt": "Smooth time-lapse transition from the daytime city view in @image1 to the glittering night skyline in @image2, vehicles moving with light trails",
"mode": 2,
"resolution": 3,
"ratio": 2,
"duration": 1,
"seconds": 5,
"outputFormat": "mp4",
"outputSound": true,
"webHookUrl": "https://your-webhook-domain.com/webhook/video",
"files": [
{
"assetId": "4a71b290-7c23-42be-a37c-f179b00982df",
"role": "first_frame"
},
{
"assetId": "8b192834-31da-45e2-9b2f-110293847561",
"role": "last_frame"
}
]
}partnerModelId: "dreamina-seedance-2-0-fast-260128" cho các tác vụ cần thời gian phản hồi nhanh và tối ưu chi phí (hỗ trợ độ dài từ 4s đến 15s):{
"partnerModelId": "dreamina-seedance-2-0-fast-260128",
"name": "Fast Coffee Steam Scene",
"prompt": "Close-up of hot steaming coffee being poured into a white ceramic cup on a wooden table, cozy morning atmosphere",
"mode": 1,
"resolution": 2,
"ratio": 2,
"duration": 1,
"seconds": 4,
"outputFormat": "mp4",
"webHookUrl": "https://your-webhook-domain.com/webhook/video"
}{
"partnerModelId": "ep-20260809114245-bzj48",
"name": "Multi-Video Kungfu Scene",
"prompt": "Apply sword combat motion from @video1, orbit camera trajectory from @video2, character face from @image1",
"mode": 1,
"resolution": 3,
"ratio": 2,
"duration": 1,
"seconds": 5,
"outputFormat": "mp4",
"webHookUrl": "https://your-webhook-domain.com/webhook/video",
"files": [
{
"assetId": "e3057cae-9907-4e92-ba2c-2936c0500a4d",
"role": "reference_video"
},
{
"assetId": "8b192834-31da-45e2-9b2f-110293847561",
"role": "reference_video"
},
{
"assetId": "4a71b290-7c23-42be-a37c-f179b00982df",
"role": "reference_image"
}
]
}⚠️ Lưu ý quan trọng về tệp tham chiếu ( files):API yêu cầu truyền assetId(không nhận trực tiếpurlngoài để đảm bảo an toàn bảo mật và tránh timeout).Cách lấy assetId:Với tệp tự tải lên: Gọi POST /upload→ tải tệp lên presigned URL → gọiPOST /upload/:uploadId/completeđể nhậnassetId.Với clip/ảnh do Coco sinh: Lấy trực tiếp trường storagePublicIdtừGET /video/:publicIdhoặcGET /image/:publicId.Quy ước role:Ảnh: "reference_image"(hoặc"first_frame","last_frame"trong Mode 2).Video: "reference_video"(hoặc để trống, hệ thống tự động gán theo định dạng video).Audio: "reference_audio".
POST /video), thêm tham số:| Tham số | Kiểu dữ liệu | Bắt buộc | Khoảng giá trị / Mô tả |
|---|---|---|---|
draft | boolean | Không | true để tạo bản nháp. Chỉ dùng với model Dreamina Seedance 2.5 và resolution = 480p (1) |
POST /video/:publicId/finalize) (publicId của bản nháp), body tuỳ chọn:| Tham số | Kiểu dữ liệu | Bắt buộc | Khoảng giá trị / Mô tả |
|---|---|---|---|
webHookUrl | string | Không | Bỏ trống thì dùng webHookUrl của bản nháp |
publicId riêng, kèm "draftOf": "<publicId bản nháp>".ep-20260809114245-bzj48 hoặc ep-20260824222535-8ddl9), cho phép bạn chỉnh sửa nội dung trong clip đã có hoặc kéo dài nối tiếp câu chuyện với sự nhất quán tuyệt đối về nhân vật, bối cảnh và chuyển động.| Thông số / Cấu hình | Sửa Video (Video Editing) | Kéo Dài Video (Video Extension) |
|---|---|---|
mode | 3 (hoặc 1 kèm prompt triggers) | 4 (hoặc 1 kèm prompt triggers) |
Tỉ lệ khung hình (ratio) | Bắt buộc 7 (adaptive) (khoá theo video gốc) | Bắt buộc 7 (adaptive) (khoá theo video gốc) |
Thời lượng (duration) | Bắt buộc 2 (SmartLength)(Hệ thống tự khóa độ dài xuất xấp xỉ đúng độ dài clip gốc, seconds = -1) | • 1 (Seconds): Tự chọn độ dài qua seconds• 2 (SmartLength): AI tự tính độ dài nối tiếp tối ưu |
| Độ dài video nguồn | Từ 4 đến 30 giây (khuyến nghị 4s – 20s để ổn định nhất) | T ừ 2 đến 30 giây |
Số lượng video nguồn (files) | Đúng 1 video cần chỉnh sửa | Tối thiểu 1 video cần kéo dài |
Định dạng xuất (outputFormat) | Khuyến nghị "mov" (hoặc "mp4") | Khuyến nghị "mov" (hoặc "mp4") |
Ảnh/Audio bổ trợ (files) | Có thể kèm 1 – 5 ảnh (role: "reference_image") hoặc audio để thay thế nhân vật/giọng nói | Có thể kèm ảnh/audio để bổ sung nhân vật/bối cảnh mới |
💡 Cách tái sử dụng clip do Coco sinh ra:
Sau khi tạo một video thành công quaPOST /video, response củaGET /video/:publicIdtrả về trườngstoragePublicId. Bạn chỉ cần dùng giá trị này làmassetIdtrong mảngfilescủa request tiếp theo mà không cần tải lại file.
🎬 Quy chế hoạt động & Tính phí của Video Extension ( mode: 4):Ý nghĩa của seconds:secondslà độ dài của phần video nối tiếp thêm (độ dài mới sinh ra), KHÔNG phải tổng thời lượng video. (Ví dụ: clip gốc 10s, bạn truyềnseconds: 4nghĩa là AI sẽ sinh thêm 4 giây nối tiếp).Video kết quả trả về: AI chỉ render và trả về đúng phân đoạn nối tiếp (4s), KHÔNG gộp sẵn clip gốc vào. Phía client/đối tác sẽ tự ghép (stitch) clip gốc và clip nối dài nếu cần xuất video liền mạch. Cơ chế tính phí (Tại sao kéo dài 4s giá 180 CC trong khi tạo mới 4s chỉ 85 CC?): Mô hình AI Seedance 2.5 tính phí dựa trên Tổng thời lượng tính toán = [Độ dài clip nguồn] + [Độ dài đoạn kéo dài]. Với clip gốc 10s và kéo dài thêm 4s, hệ thống phải load và xử lý toàn bộ 14s ngữ cảnh (10s + 4s = 14s) để đảm bảo sự liền mạch tuyệt đối về chuyển động và ánh sáng, do đó chi phí (180 CC) cao hơn so với việc tạo mới một clip 4s độc lập từ đầu (85 CC).
@video1, @video2, @image1, @audio1 tương ứng với thứ tự các tệp truyền trong mảng files.0s-3s, [2s-5s], at 4-second mark, từ giây 2 đến 4... để chỉ định chính xác phân đoạn cần can thiệp.remove, delete, erase"In @video1, remove the red car parked on the roadside from 2s to 5s, restoring the empty street."add, insert"Add gentle golden sunlight and falling autumn leaves to @video1 from 0s to 6s."modify, replace, change to, switch"Editing task: Replace the man walking in @video1 with the anime character from @image1, matching all footsteps and movements."extend backward, continue, continue from, extend the story"Extend @video1 backward: the character in @video1 reaches the edge of the cliff, looks down at the glowing ocean, and smiles."extend forward"Extend @video1 forward: show what happened 5 seconds before the car explosion."{
"partnerModelId": "ep-20260809114245-bzj48",
"name": "Edit - Remove Object at 2s",
"prompt": "Video editing: In @video1, remove the trash bin at the 2-second mark and replace it with a clean flower pot, leaving the rest of the clip completely unchanged.",
"mode": 3,
"resolution": 3,
"ratio": 7,
"duration": 2,
"outputFormat": "mov",
"outputSound": true,
"webHookUrl": "https://your-webhook-domain.com/webhook/video",
"files": [
{
"assetId": "e3057cae-9907-4e92-ba2c-2936c0500a4d",
"role": "reference_video"
}
]
}@video1 + @image1){
"partnerModelId": "ep-20260809114245-bzj48",
"name": "Edit - Replace Subject with Image",
"prompt": "Editing task: Replace the protagonist in @video1 with the female character from @image1. Maintain exact lighting, camera movement, and walking sequence.",
"mode": 3,
"resolution": 3,
"ratio": 7,
"duration": 2,
"outputFormat": "mov",
"outputSound": true,
"webHookUrl": "https://your-webhook-domain.com/webhook/video",
"files": [
{
"assetId": "e3057cae-9907-4e92-ba2c-2936c0500a4d",
"role": "reference_video"
},
{
"assetId": "4a71b290-7c23-42be-a37c-f179b00982df",
"role": "reference_image"
}
]
}{
"partnerModelId": "ep-20260809114245-bzj48",
"name": "Extend - Continue Story",
"prompt": "Extend @video1 backward: The astronaut continues walking on the red sand of Mars, turns back toward the base station, and waves at the rover.",
"mode": 4,
"resolution": 3,
"ratio": 7,
"duration": 1,
"seconds": 6,
"outputFormat": "mov",
"outputSound": true,
"webHookUrl": "https://your-webhook-domain.com/webhook/video",
"files": [
{
"assetId": "e3057cae-9907-4e92-ba2c-2936c0500a4d",
"role": "reference_video"
}
]
}| Thông số / Cấu hình | BytePlus (Seedream 5.0 Lite/Pro) | OpenAI (GPT Image) |
|---|---|---|
| Partner Model ID | ep-20260824222944-wmrzt (Lite)ep-20260824223025-2c9qd (Pro) | gpt-image-2 |
Độ phân giải (resolution) | "1K", "1.5K", "2K", "3K", "4K" | "1024x1024", "1024x1536", "1536x1024", "2560x1440", "3840x2160" |
Tỉ lệ khung hình (ratio) | "1:1", "4:3", "3:4", "16:9", "9:16", "21:9" | (Tự động theo kích thước resolution) |
Chất lượng (quality) | N/A | "low", "medium", "high" |
Độ trong suốt nền (background) | N/A | "auto", "transparent", "opaque" |
Kiểm duyệt an toàn (moderation) | N/A | "auto", "low" |
Định dạng file xuất (outputFormat) | "png", "jpeg" | "png", "jpeg", "webp" (Lưu ý: Transparent background yêu cầu PNG/WebP) |
Số lượng tạo cùng lúc (numOfGenerate) | 1 đến 14 ảnh | 1 đến 14 ảnh |
Ảnh tham chiếu (files) | Tối đa 14 ảnh (≤ 30MB/ảnh) | Tối đa 14 ảnh |
POST /image){
"partnerModelId": "ep-20260824223025-2c9qd",
"name": "Cyberpunk Street",
"prompt": "Futuristic cyberpunk street at night, neon lights, rainy reflection, ultra-detailed, 8k",
"resolution": "2K",
"ratio": "16:9",
"outputFormat": "png",
"numOfGenerate": 2,
"webHookUrl": "https://your-webhook-domain.com/webhook/image"
}{
"partnerModelId": "gpt-image-2",
"name": "Logo Icon",
"prompt": "A modern minimalist 3D coffee cup logo icon, vibrant colors",
"resolution": "1024x1024",
"quality": "high",
"background": "transparent",
"outputFormat": "png",
"numOfGenerate": 1,
"webHookUrl": "https://your-webhook-domain.com/webhook/image"
}| Tham số | Kiểu dữ liệu | Bắt buộc | Khoảng giá trị / Mô tả |
|---|---|---|---|
partnerModelId | string | Có | ID model Audio (lấy từ GET /model/audio) |
prompt | string | Có | Nội dung văn bản cần chuyển thành giọng nói (tối đa 3000 ký tự) |
format | string | Có | Định dạng âm thanh: "mp3", "wav", "pcm", "ogg" |
sampleRate | number | Có | Tần số mẫu: 16000, 24000, 44100, 48000 (Hz) |
tone | number | Không | Cao độ giọng nói (pitch rate): từ -12 đến 12 (mặc định 0) |
speechRate | number | Không | Tốc độ nói: từ -50 đến 100 (mặc định 0) |
volume | number | Không | Âm lượng (loudness): từ -50 đến 100 (mặc định 0) |
numOfGenerate | number | Có | Số lượng audio tạo cùng lúc (từ 1 đến 8) |
files | array | Không | Mảng file audio mẫu để Clone giọng (tối đa 3 clips, ≤ 10MB/clip) |
imageFile | object | Không | Ảnh tham chiếu cảm xúc nhân vật (≤ 10MB) |
webHookUrl | string | Có | URL nhận kết quả Webhook |
⚠️ Lưu ý: files(Audio Reference) vàimageFile(Image Reference) là loại trừ lẫn nhau (chỉ chọn truyền 1 trong 2).
POST /audio){
"partnerModelId": "seed-audio-1.0",
"name": "Podcast Intro Voice",
"prompt": "Welcome to our AI technology podcast. Today we will explore the future of Generative AI!",
"format": "mp3",
"sampleRate": 44100,
"tone": 0,
"speechRate": 10,
"volume": 0,
"numOfGenerate": 1,
"webHookUrl": "https://your-webhook-domain.com/webhook/audio"
}videoPublicId: một video bạn đã tạo bằng POST /video và đã hoàn thành.videoUrl: đường dẫn https tới file MP4/MOV, tối đa 10 GB. Hệ thống tự tải file về trước khi xử lý.outputFormat)outputFormat | File nhận được | toolVersion | Nhận bitrate | Giới hạn video đầu vào |
|---|---|---|---|---|
auto (mặc định) | .mp4 | standard / professional | Có | — |
h264_8 | .mp4 – H.264 8-bit | professional | Có | — |
h265_8 | .mp4 – H.265 8-bit | professional | Có | — |
h265_10 | .mp4 – H.265 10-bit | professional | Có | — |
prores_10 | .mov – ProRes 422 HQ 10-bit | professional | Không | — |
ffv1_16 | .mov – FFV1 16-bit (lossless) | professional | Không | Tối đa 40 giây |
exr_16 | .zip – chuỗi ảnh EXR 16-bit, không có âm thanh | professional | Không | Tối đa 40 giây |
⚠️ ProRes, FFV1, EXR và H.265 10/12-bit thường không phát được trên trình duyệt: hãy tải file về và mở bằng phần mềm dựng phim. File có thể rất lớn (FFV1 ~77 MB mỗi giây ở 1080p, EXR ~1,6 GB cho 6 giây ở 1080p). ⚠️ Professional 16-bit ( ffv1_16,exr_16) có thể mất hơn 20 phút kể cả với video vài giây. Nên nhận kết quả qua Webhook.
GET /video-upscale/capabilities.POST /video-upscale)| Tham số | Kiểu dữ liệu | Bắt buộc | Khoảng giá trị / Mô tả |
|---|---|---|---|
videoPublicId | string | Có* | publicId của video (POST /video) đã hoàn thành và còn trong thời hạn lưu |
videoUrl | string | Có* | URL https tới file MP4/MOV, tối đa 10 GB, truy cập công khai (URL có chữ ký cũng được). Không chấp nhận địa chỉ nội bộ / IP riêng |
resolution | string | Có** | Độ phân giải đầu ra: "240p", "360p", "480p", "540p", "720p", "1080p", "2K", "4K", "8K" |
resolutionLimit | integer | Có** | Thay cho resolution: khoá cạnh ngắn của video ở N pixel (128 – 2160) |
fps | integer | Có | Số khung hình/giây đầu ra: 15 – 120 |
toolVersion | string | Không | "standard" (mặc định) hoặc "professional" (chất lượng cao hơn, giá cao hơn; bắt buộc với định dạng hậu kỳ) |
outputFormat | string | Không | Xem bảng A. Mặc định "auto" |
scene | string | Không | Chỉ áp dụng cho Standard: "common", "aigc", "short_series", "ugc", "old_film" |
enhanceStyle | string | Không | "hd" (mặc định) hoặc "natural" |
bitrateLevel | string | Không | "low", "medium" (mặc định), "high". Không dùng chung với bitrate |
bitrate | integer | Không | Bitrate cụ thể (kbps): 10 – 150000. Không dùng chung với bitrateLevel |
name | string | Không | Tên tác vụ (tối đa 256 ký tự). Bỏ trống → "Upscale · <publicId>" |
webHookUrl | string | Có | URL nhận kết quả khi tác vụ kết thúc |
videoPublicId hoặc videoUrl.resolution hoặc resolutionLimit.POST /video-upscale){
"videoPublicId": "09109249-8fa5-4857-a488-9946f124957e",
"resolution": "1080p",
"fps": 30,
"webHookUrl": "https://your-domain.com/webhooks/coco"
}POST /video-upscale){
"videoUrl": "https://cdn.your-domain.com/videos/clip.mp4",
"name": "Clip quảng cáo – ProRes",
"resolution": "4K",
"fps": 30,
"toolVersion": "professional",
"outputFormat": "prores_10",
"webHookUrl": "https://your-domain.com/webhooks/coco"
}{
"publicId": "c79370e7-d263-4bb9-adc6-7136f00e333d",
"name": "Clip quảng cáo – ProRes",
"status": 0,
"statusText": "pending",
"phase": "downloading",
"errorMessage": "",
"createdDate": "2026-10-05T08:06:07.000Z",
"output": { "master": null, "verifyStatus": null, "billing": null },
"balance": { "estimateCost": 0, "confirmCost": null }
}GET /video-upscale/:publicId)status | statusText | Ý nghĩa |
|---|---|---|
0 | pending | Đang chờ (đang tải file nguồn hoặc chờ xử lý) |
1 | processing | Đang upscale |
2 | success | Hoàn thành |
3 | failure | Thất bại, xem errorMessage |
phase chi tiết hơn: "downloading" (đang tải file từ videoUrl), "queued", "processing", "completed", "failed".{
"publicId": "204afc22-41dd-4c6a-92e0-9981c4234d1e",
"status": 2,
"statusText": "success",
"phase": "completed",
"output": {
"master": {
"url": "https://s3.ap-southeast-1.amazonaws.com/files/204afc22-41dd-4c6a-92e0-9981c4234d1e.mov",
"fileName": "204afc22-41dd-4c6a-92e0-9981c4234d1e.mov",
"mimeType": "video/quicktime",
"contentType": "video",
"container": "mov",
"codec": "ffv1",
"bitDepth": 16,
"width": 1920,
"height": 1080,
"sizeBytes": 309941372,
"durationSeconds": 4,
"hasAudio": false
},
"verifyStatus": "matched",
"billing": "charged"
},
"balance": { "estimateCost": 23, "confirmCost": 22 }
}| Trường | Mô tả |
|---|---|
output.master.url | Link tải file kết quả, lưu 30 ngày kể từ khi hoàn thành |
output.master.contentType | "video", hoặc "image_sequence" (EXR, file .zip) |
output.verifyStatus | "matched": đúng định dạng yêu cầu. "mismatched" / "unverifiable": khác hoặc không kiểm chứng được, khi đó không tính phí |
output.billing | "charged" (đã trừ tiền), "waived" (miễn phí), "refunded" (đã hoàn tiền) |
balance.estimateCost | Số tiền tạm giữ (escrow) khi bắt đầu xử lý |
balance.confirmCost | Số tiền thực tế bị trừ. null khi tác vụ chưa kết thúc |
🛡️ Danh sách Host / Bucket lưu trữ kết quả trên Production (dành cho hệ thống cấu hình Whitelist): BytePlus TOS (Lưu trữ tệp Video Upscale): *.tos-s3-ap-southeast-1.bytepluses.com(ví dụhttps://coco-prod.tos-s3-ap-southeast-1.bytepluses.comhoặchttps://tos-s3-ap-southeast-1.bytepluses.com).AWS S3 (Lưu trữ Video/Image thông thường): ap-southeast-1-coco.s3.ap-southeast-1.amazonaws.com(hoặc*.s3.ap-southeast-1.amazonaws.com).
⚠️ Chi phí tính theo độ phân giải đầu ra, fps,toolVersion(Professional đắt hơn Standard) và thời lượng video;outputFormatkhông làm thay đổi giá. Tác vụ thất bại được hoàn tiền toàn bộ.
GET /model/*)partnerModelId và name chính xác đang hoạt động trên hệ thống:| Phương thức | Endpoint | Mô tả |
|---|---|---|
GET | /model/video | Lấy danh sách các Model Video |
GET | /model/image | Lấy danh sách các Model Image |
GET | /model/audio | Lấy danh sách các Model Audio |
{
"code": 200,
"data": [
{
"partnerModelId": "ep-20260824222944-wmrzt",
"name": "Seedream-5-0-lite"
},
{
"partnerModelId": "ep-20260824223025-2c9qd",
"name": "Seedream-5-0-pro"
},
{
"partnerModelId": "gpt-image-2",
"name": "GPT Image"
}
]
}GET /balance)GET/balance (hỗ trợ alias /company/balance)apiKey: YOUR_API_KEY_HERE{
"balance": 1500.5,
"credits": 1500.5,
"availableBalance": 1500.5,
"escrow": 20.0,
"currency": "CCC",
"lastModified": "2026-10-21T03:00:00.000Z"
}balance: Số dư khả dụng hiện tại của tài khoản (Credits).credits: Tương đương balance (số credits có thể dùng để tạo Video/Image/Audio/Upscale).availableBalance: Số dư thực tế có thể sử dụng (đã trừ phần tạm giữ/escrow và tính theo quota thành viên nếu có).escrow: Số dư đang được tạm giữ cho các tác vụ đang xử lý/render.currency: Mã đơn vị tiền tệ ("CCC" hoặc "CC").lastModified: Thời gian cập nhật số dư gần nhất.webHookUrl bạn đã cung cấp:POST /video):{
"id": "e3057cae-9907-4e92-ba2c-2936c0500a4d",
"status": "success",
"name": "Cinematic Beach Cat",
"videoUrl": "https://s3.ap-southeast-1.amazonaws.com/files/video.mp4",
"lastFrameUrl": "https://s3.ap-southeast-1.amazonaws.com/files/last-frame.jpeg",
"thumbnailUrl": "https://s3.ap-southeast-1.amazonaws.com/files/thumb.jpg",
"duration": 5,
"resolution": "720p",
"ratio": "16:9"
}POST /video-upscale):source = 4 là sự kiện của Video Upscale. Sau khi nhận, gọi GET /video-upscale/:publicId để lấy link file và chi phí.{
"aiVideoUpscaleId": "204afc22-41dd-4c6a-92e0-9981c4234d1e",
"source": 4,
"status": 2,
"createdDate": "2026-10-05T09:41:48.000Z"
}status = 3):{
"aiVideoUpscaleId": "739ae40d-1dda-408c-b211-de052055438c",
"source": 4,
"status": 3,
"createdDate": "2026-10-05T09:41:49.000Z",
"errorMessage": "Output format exr_16 accepts videos up to 40 seconds (this one is 41.00s)"
}⚠️ Endpoint nhận webhook cần trả HTTP 2xx. Lỗi tạm thời (5xx/timeout) được gửi lại; lỗi 4xx thì hệ thống ngừng gửi.
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"status": "success",
"name": "Cyberpunk Street",
"images": [
{
"url": "https://s3.ap-southeast-1.amazonaws.com/files/image-1.png",
"thumbnailUrl": "https://s3.ap-southeast-1.amazonaws.com/files/thumb-1.jpg"
}
]
}{
"id": "7b8f9e60-f654-4a21-88bb-4c270d97bb01",
"status": "success",
"name": "Podcast Intro Voice",
"audioUrl": "https://s3.ap-southeast-1.amazonaws.com/files/podcast.mp3",
"duration": 6.2,
"format": "mp3"
}GET /video/:publicId (trả về thêm draft, finalized, draftOf)GET /video-upscale/:publicId (tra cứu trạng thái và link file upscale)GET /image/:publicIdGET /audio/:publicIdGET /video?page=1&size=20GET /video-upscale?page=1&size=20 (hỗ trợ thêm query search để tìm theo tên)GET /advance-creation?page=1&size=20GET /image?page=1&size=20GET /audio?page=1&size=20POST /video/:publicId/finalizePOST /video/estimatePOST /video-upscale/estimate/estimate):POST /video/estimate:{
"estimatedCost": 25,
"availableBalance": 1450.5,
"sufficient": true
}estimatedCost: Số credit (CC) dự kiến cần tạm giữ/chi trả cho tác vụ video.availableBalance: Số dư khả dụng hiện tại của công ty.sufficient: true nếu số dư khả dụng đủ để thực hiện tác vụ, false nếu không đủ.POST /video-upscale/estimate:{
"estimatedCost": 62,
"availableBalance": 1450.5,
"sufficient": true,
"durationSeconds": 90,
"approximate": false
}durationSeconds: Độ dài video (giây) được đo bằng ffprobe (nếu dùng videoPublicId) hoặc do client truyền vào (nếu dùng videoUrl).approximate: false nếu hệ thống đo chính xác từ video trên Coco, true nếu ước tính dựa trên durationSeconds do client truyền khi dùng videoUrl.| HTTP Code | Error Message | Ý nghĩa & Cách xử lý |
|---|---|---|
400 | ApiKey Invalid | Header apiKey bị thiếu hoặc không chính xác |
400 | Model is required / Not found partnerModelId | Model không tồn tại. Gọi GET /model/* để lấy đúng ID |
400 | Insufficient account balance | Số dư tài khoản không đủ để tạm giữ cọc (escrow) |
400 | Transparent background requires PNG or WebP output format | Chọn background: "transparent" nhưng lại đặt outputFormat: "jpeg" |
400 | Reference audio and reference image cannot be used together | Audio API không cho phép truyền cả ảnh và clip audio cùng lúc |
400 | This model only allows seconds from 4 to 30 | Tham số seconds vượt quá phạm vi của Video model |
429 | Too Many Requests | Vượt quá giới hạn tần suất gửi request (Rate Limit) |
| HTTP Code | Error Message | Ý nghĩa & Cách xử lý |
|---|---|---|
400 | Draft mode is only supported by Dreamina Seedance 2.5. | Gửi draft: true nhưng chọn model khác |
400 | Draft mode requires resolution 480p. | Gửi draft: true nhưng resolution khác 480p (1) |
400 | This video was not created in Draft mode. | Gọi finalize một video không phải bản nháp |
400 | Draft video is not ready yet. | Bản nháp chưa xử lý xong |
400 | Draft video failed, cannot finalize. | Bản nháp đã thất bại, không thể finalize |
400 | This draft has already been finalized. | Bản nháp đã được dùng để finalize trước đó |
400 | This draft has expired (older than 7 days) and can no longer be finalized. | Bản nháp đã quá hạn 7 ngày |
400 | This draft was created with a model version that has since changed … | Model AI đã nâng cấp, cần tạo bản nháp mới |
| HTTP Code | Error Message | Ý nghĩa & Cách xử lý |
|---|---|---|
400 | Provide exactly one of videoUrl or videoPublicId | Thiếu nguồn video, hoặc gửi đồng thời cả hai |
400 | videoUrl must be an https URL | videoUrl phải có giao thức https |
400 | videoUrl must point to a public internet address. | URL trỏ tới địa chỉ nội bộ / IP riêng |
400 | The source URL returned HTTP 404. | File nguồn không tồn tại |
400 | The source file exceeds the 10 GB limit. | File nguồn lớn hơn 10 GB |
400 | Video not found. | videoPublicId không tồn tại hoặc không thuộc tài khoản |
400 | The video is not ready (or has expired). | Video nguồn chưa hoàn thành hoặc đã hết hạn lưu |
400 | Output format … requires the Professional tool version | Định dạng hậu kỳ cần toolVersion: "professional" |
400 | Output format … does not accept bitrate or bitrateLevel | ProRes / FFV1 / EXR không nhận cấu hình bitrate |
400 | Too many source downloads in progress for this company. Try again later. | Đang có quá nhiều tác vụ tải file cùng lúc từ tài khoản |
errorMessage qua Webhook / Tra cứu, tự hoàn lại tiền):errorMessage | Ý nghĩa / Xử lý |
|---|---|
Download failed: the source returned HTTP <code>. | Server chứa file nguồn từ chối khi hệ thống tải về |
Download failed: the source took too long to download. | Tải file nguồn vượt quá 3 giờ |
The source is not an MP4/MOV video file. | URL không trả về file video định dạng MP4/MOV hợp lệ |
Output format … accepts videos up to 40 seconds (this one is …s) | Định dạng 16-bit (FFV1, EXR) gửi video dài hơn 40 giây |
Insufficient account balance. | Số dư không đủ cho chi phí thực tế |