Chuyển đến nội dung chính

Documentation Index

Fetch the complete documentation index at: https://docs.tokenlab.sh/llms.txt

Use this file to discover all available pages before exploring further.

Tổng quan

TokenLab cung cấp khả năng tạo video thông qua một API hợp nhất. Quá trình này bất đồng bộ: bạn gửi yêu cầu, nhận task_idpoll_url, rồi kiểm tra trạng thái định kỳ cho tới khi có kết quả cuối cùng.

Tính khả dụng và polling

Danh sách model video công khai có thể thay đổi theo thời gian. Để xem tình trạng mới nhất, hãy dùng Models API hoặc truy cập trang Models. Nếu phản hồi tạo trả về poll_url, hãy gọi đúng URL đó. Khi nó trỏ tới /v1/tasks/{id}, hãy xem đó là endpoint trạng thái cố định chuẩn.

Hành vi mô hình và phương tiện

Hành vi âm thanh phụ thuộc vào từng model. Trong TokenLab, họ Veo 3 mặc định bật âm thanh khi bỏ qua output_audio. Một số model công khai chỉ hỗ trợ im lặng hoặc không cung cấp công tắc âm thanh ổn định. Trong môi trường vận hành, nên ưu tiên URL https công khai thay vì base64 inline cho ảnh, video và âm thanh. Các model tương thích vẫn hỗ trợ URL data:, nhưng URL công khai sẽ dễ retry, kiểm tra và debug hơn.

Quy trình bất đồng bộ

Các thao tác công khai hiện tại

Hợp đồng video công khai hiện tại của TokenLab tập trung vào các thao tác sau:
  • text-to-video
  • image-to-video
  • reference-to-video
  • start-end-to-video
  • video-to-video
  • motion-control
Hợp đồng yêu cầu cũng chấp nhận audio-to-videovideo-extension cho một số luồng đặc thù theo model, nhưng trong bản tài liệu hiện tại chưa có model công khai phổ biến nào quảng bá rõ ràng hai khả năng này.

Ma trận khả năng

Chú thích: ✅ Có ít nhất một model công khai đang bật trong nhóm nhà cung cấp đó hỗ trợ khả năng này | ❌ Hiện chưa có model công khai đang bật nào đại diện cho khả năng đó
NhómT2VI2VTham chiếuĐầu-CuốiV2VChuyển động
OpenAI
Kuaishou
Google
ByteDance
MiniMax
Alibaba
Shengshu
xAI
Khác

Giải thích khả năng

  • T2V (Text-to-Video): Tạo video từ prompt văn bản
  • I2V (Image-to-Video): Tạo video từ một ảnh đầu vào. Để tương thích rộng nhất, nên dùng image_url
  • Tham chiếu: Điều kiện hóa quá trình sinh bằng một hoặc nhiều ảnh tham chiếu qua reference_images
  • Đầu-Cuối: Điều khiển khung đầu và khung cuối bằng start_imageend_image
  • V2V (Video-to-Video): Dùng một video có sẵn làm đầu vào chính
  • Chuyển động: Kết hợp ảnh chủ thể với video tham chiếu chuyển động

Danh sách model công khai hiện tại

OpenAI

Mô hìnhThao tác công khai
sora-2Văn bản sang video, image-to-video
sora-2-proVăn bản sang video, image-to-video
sora-2-pro-storyboardTừ ảnh sang video

Kuaishou

Mô hìnhThao tác công khai
kling-3.0-motion-controlĐiều khiển chuyển động
kling-3.0-videoVăn bản sang video, image-to-video, start-end-to-video, tham chiếu phần tử
kling-v2.1-masterVăn bản sang video, image-to-video
kling-v2.1-proimage-to-video, start-end-to-video
kling-v2.1-standardimage-to-video
kling-v2.5-turbo-proVăn bản sang video, image-to-video, start-end-to-video
kling-v2.5-turbo-stdVăn bản sang video, image-to-video
kling-v2.6-proVăn bản sang video, image-to-video, start-end-to-video
kling-v2.6-stdVăn bản sang video, image-to-video
kling-v3.0-proVăn bản sang video, image-to-video, start-end-to-video
kling-v3.0-stdVăn bản sang video, image-to-video, start-end-to-video
kling-video-o1-proVăn bản sang video, image-to-video, reference-to-video, start-end-to-video, video-to-video
kling-video-o1-stdVăn bản sang video, image-to-video, reference-to-video, start-end-to-video, video-to-video

Google

Mô hìnhThao tác công khai
veo3Văn bản sang video, image-to-video
veo3-fastVăn bản sang video, image-to-video
veo3-proVăn bản sang video, image-to-video
veo3.1Văn bản sang video, image-to-video, reference-to-video, start-end-to-video
veo3.1-fastVăn bản sang video, image-to-video, reference-to-video, start-end-to-video
veo3.1-proVăn bản sang video, image-to-video, start-end-to-video

ByteDance

Mô hìnhThao tác công khai
seedance-1.5-proVăn bản sang video, image-to-video

MiniMax

Mô hìnhThao tác công khai
hailuo-2.3-fastTừ ảnh sang video
hailuo-2.3-proVăn bản sang video, image-to-video
hailuo-2.3-standardVăn bản sang video, image-to-video

Alibaba

Mô hìnhThao tác công khai
wan-2.2-plusVăn bản sang video, image-to-video
wan-2.5Văn bản sang video, image-to-video
wan-2.6Văn bản sang video, image-to-video, reference-to-video

Shengshu

Mô hìnhThao tác công khai
viduq2Văn bản sang video, reference-to-video
viduq2-proẢnh thành video, tham chiếu thành video, đầu-cuối thành video
viduq2-pro-fastẢnh thành video, đầu-cuối thành video
viduq2-turboChuyển ảnh thành video, từ đầu đến cuối thành video
viduq3-proVăn bản sang video, image-to-video, start-end-to-video
viduq3-turboVăn bản sang video, image-to-video, start-end-to-video

xAI

Mô hìnhThao tác công khai
grok-imagine-videoVăn bản sang video, từ ảnh sang video
grok-imagine-image-to-videoTừ ảnh sang video
grok-imagine-text-to-videoVăn bản sang video
grok-imagine-upscaleTừ video sang video

Khác

Mô hìnhThao tác công khai
topaz-video-upscaleTừ video sang video

Ví dụ sử dụng

Text-to-video

response = requests.post(f"{BASE}/videos/generations",
    headers=headers,
    json={
        "model": "sora-2",
        "prompt": "A calm cinematic shot of a cat walking through a sunlit garden.",
        "operation": "text-to-video",
        "duration": 4,
        "aspect_ratio": "16:9"
    }
)

Ảnh thành video

response = requests.post(f"{BASE}/videos/generations",
    headers=headers,
    json={
        "model": "hailuo-2.3-standard",
        "prompt": "The scene begins from the provided image and adds gentle natural motion.",
        "operation": "image-to-video",
        "image_url": "https://example.com/portrait.jpg",
        "duration": 6,
        "aspect_ratio": "16:9"
    }
)

Kling 3.0 Elements

Dùng kling_elements với kling-3.0-video khi cần tham chiếu phần tử. Cung cấp request có điều kiện ảnh (image_url, image_urls, start_image hoặc end_image) và tham chiếu từng phần tử trong prompt bằng @name. Không kết hợp kling_elements với output_audio=true; hãy bỏ output_audio hoặc đặt thành false khi dùng tham chiếu phần tử.
response = requests.post(f"{BASE}/videos/generations",
    headers=headers,
    json={
        "model": "kling-3.0-video",
        "prompt": "Place @hero_bag on a studio turntable with soft product lighting.",
        "operation": "image-to-video",
        "image_url": "https://example.com/studio-start.png",
        "duration": 5,
        "resolution": "720p",
        "kling_elements": [
            {
                "name": "hero_bag",
                "description": "black leather handbag",
                "element_input_urls": [
                    "https://example.com/bag-front.png",
                    "https://example.com/bag-side.png"
                ]
            }
        ]
    }
)

Reference-to-video

Với seedance-2.0seedance-2.0-fast, TokenLab hiện hỗ trợ tối đa 9 ảnh tham chiếu, cùng thêm tối đa 3 video tham chiếu và 3 audio tham chiếu. duration chỉ điều khiển độ dài đầu ra được tạo; nó không định nghĩa giới hạn riêng cho thời lượng video tham chiếu đầu vào.
response = requests.post(f"{BASE}/videos/generations",
    headers=headers,
    json={
        "model": "veo3.1",
        "prompt": "Keep the same subject identity and palette while adding subtle motion.",
        "operation": "reference-to-video",
        "reference_images": [
            "https://example.com/ref-a.jpg",
            "https://example.com/ref-b.jpg"
        ],
        "duration": 8,
        "resolution": "720p",
        "aspect_ratio": "9:16"
    }
)

Start-end-to-video

response = requests.post(f"{BASE}/videos/generations",
    headers=headers,
    json={
        "model": "viduq2-pro",
        "prompt": "Smooth transition from day to night.",
        "operation": "start-end-to-video",
        "start_image": "https://example.com/city-day.jpg",
        "end_image": "https://example.com/city-night.jpg",
        "duration": 5,
        "resolution": "720p",
        "aspect_ratio": "16:9"
    }
)

Video sang video

response = requests.post(f"{BASE}/videos/generations",
    headers=headers,
    json={
        "model": "topaz-video-upscale",
        "operation": "video-to-video",
        "video_url": "https://example.com/source.mp4",
        "prompt": "Upscale this clip while preserving the original motion."
    }
)

Motion control

response = requests.post(f"{BASE}/videos/generations",
    headers=headers,
    json={
        "model": "kling-3.0-motion-control",
        "operation": "motion-control",
        "prompt": "Keep the subject stable while following the motion reference.",
        "image_url": "https://example.com/subject.png",
        "video_url": "https://example.com/motion.mp4",
        "resolution": "720p"
    }
)

Tham chiếu tham số

Tham sốKiểuGhi chú
operationstringTrong môi trường vận hành, nên truyền một cách tường minh
image_urlstringDạng đầu vào ảnh ổn định nhất
imagestringURL data: hữu ích cho thử nghiệm cục bộ và tích hợp nhỏ
reference_imagesstring[]Trường công khai chuẩn cho conditioning bằng ảnh tham chiếu
reference_image_typestringBộ chọn tùy chọn asset / style
video_urlstringBắt buộc với các model video-to-videomotion-control công khai hiện tại
audio_urlstringDùng cho các luồng sinh video có điều kiện bằng âm thanh nếu model hỗ trợ
output_audiobooleanHọ Veo 3 sẽ coi trường bị bỏ qua là true. kling-3.0-video chấp nhận selector này cho điều khiển upstream sound và mặc định im lặng khi bỏ qua.

Hướng dẫn chọn model nhanh

Chất lượng cao nhất

Nếu chất lượng quan trọng hơn tốc độ, veo3.1-pro, kling-video-o1-pro, và viduq3-pro là những lựa chọn mạnh.

Lặp nhanh

Nếu cần thử nghiệm nhanh, bạn có thể bắt đầu với veo3.1-fast, hailuo-2.3-fast, hoặc viduq3-turbo.

Luồng nhiều ảnh tham chiếu

Khi cần conditioning chuyên biệt bằng ảnh tham chiếu, hãy ưu tiên veo3.1, veo3.1-fast, wan-2.6, hoặc kling-video-o1-pro / std.

Video sang video

Các đường video-to-video công khai đang bật phổ biến hiện nay chủ yếu gồm topaz-video-upscale, grok-imagine-upscale, và kling-video-o1-pro / std.

Thanh toán

Billing phụ thuộc vào model. Một số model video công khai thực tế gần với cách tính phí theo request, trong khi một số model khác gần với cách tính theo thời lượng giây. Để xem mặt bằng giá công khai hiện tại, hãy tham khảo trang Models hoặc Pricing API.