logo
API Docs

API Docs

Autentikasi

Base URL: https://api.vivareel.com/api/developer/v1. Semua endpoint open API menggunakan API Key: Authorization: Bearer sk_live_xxx atau sk_test_xxx.

Respons & penagihan

Respons open API mencakup code, message, dan data; code 200 berarti berhasil. Panggilan ditagihkan ke poin akun—periksa harga melalui GET /models. Poll GET /tasks/task_id setiap 3–5d untuk tugas asinkron.

Kemampuan Wan 3.0

Wan 3.0 adalah model video referensi all-in-one. Model yang sama mencakup text-to-video, first-frame dan first-last-frame image-to-video, serta generasi referensi campuran gambar / video / audio. Kirimkan nama model dari GET /models (misalnya wan-3.0). Anda tidak memerlukan endpoint terpisah.

Mode resmi dan aturan kombinasi materi: Wan3.0 Video Generation API Reference. Platform ini membungkusnya sebagai POST /api/developer/v1/videos/generations. Nama field berbeda dari DashScope input.media[]; gunakan parameter di halaman ini.

Cakupan field

  • Umum: model, motion_instruction (wajib bersyarat), aspect_ratio, duration_seconds, capability, image_url (spesifik mode), last_frame_url (spesifik mode; tidak didukung HappyHorse), dan reference_urls (mode referensi).
  • Multi-model: reference_video_urls (Seedance / semantik Wan3 / Wan2.7 R2V / VivaReel2.0); reference_audio_urls (Seedance / semantik Wan3 / Wan2.7 R2V / minimax-H3).
  • Semantik Wan3: resolution, audio, seed, prompt_extend, dan smart_duration. Berlaku untuk model yang menggunakan semantik field Wan 3.
  • hanya dashscope-wan3.0-video: watermark, enable_thinking, document_url, dan web_url.

Mode generasi

  • Text-to-video: kirim hanya motion_instruction dan hilangkan capability atau setel ke null.
  • Video first-frame: kirim image_url, dengan capability first_frame.
  • Video first-last-frame: kirim image_url dan last_frame_url, dengan capability flf2v.
  • Referensi all-modal: gabungkan reference_urls, reference_video_urls, dan reference_audio_urls. Gunakan capability image_reference. motion_instruction wajib.
  • Pengeditan / perpanjangan video: kirim reference_video_urls dan jelaskan suntingan atau perpanjangan di motion_instruction, misalnya “ubah ini menjadi gaya clay” atau “perpanjang Video 1 ke depan”.

Aturan saling eksklusif

  • Jangan kirim image_url / last_frame_url bersama reference_urls, reference_video_urls, atau reference_audio_urls.
  • Mode first-frame dan first-last-frame tidak menerima driving audio. Untuk generasi berbasis audio, gunakan referensi all-modal (gambar referensi + audio referensi).
  • Sediakan motion_instruction, atau set materi yang valid untuk mode saat ini.

Batas materi dan keluaran

  • Maksimal 10 gambar referensi; JPEG / JPG / PNG / BMP / WEBP, 240–8000 px per sisi, 20MB masing-masing. Batas live adalah max_reference_images dari GET /models.
  • Maksimal 5 klip referensi, masing-masing 1–15 detik, total 15 detik; mp4 / mov, 100MB masing-masing. Batas live adalah max_reference_videos.
  • Maksimal 5 klip referensi, masing-masing 1–15 detik, total 15 detik; wav / mp3, 15MB masing-masing. Batas live adalah max_reference_audios.
  • Tanpa video referensi, durasi keluaran biasanya 2–30 detik. Dengan video referensi, durasi input + durasi output tidak boleh melebihi 30 detik. Selalu periksa duration_range / max_duration_seconds.
  • Keluaran adalah MP4 pada 30 fps dan secara default dapat mencakup dialog, BGM, dan efek suara.

Merujuk materi dalam prompt

Hitung setiap jenis secara terpisah: gambar referensi pertama adalah Image 1, video referensi pertama adalah Video 1, dan audio referensi pertama adalah Audio 1. Anda dapat menulis Image 1, Video 1, atau @Image 1 / @Video 1 / @Audio 1.

Hasilkan gambar

POST/api/developer/v1/images/generations

Kirim tugas generasi gambar mandiri (text-to-image atau komposisi gambar referensi). Mengembalikan task_id; poll GET /api/developer/v1/tasks/task_id untuk hasil.

Parameter

nameintyperequireddesc
modelbodystringNama model gambar; daftar model yang tersedia melalui GET /models
promptbodystringDeskripsi teks gambar yang akan dihasilkan
aspect_ratiobodystringRasio aspek: 16:9, 9:16, 4:3, atau 3:4
image_resolutionbodystringResolusi keluaran: 1K, 2K, atau 4K
reference_urlsbodystring[]URL gambar referensi (0–5); tidak kosong mengaktifkan mode komposisi referensi

Contoh Kode

curl -X POST "https://vivareel.ai/api/developer/v1/images/generations" \
  -H "Authorization: Bearer sk_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "dashscope-wan2.1-t2i-turbo",
  "prompt": "一只可爱的猫咪在草地上奔跑",
  "aspect_ratio": "16:9",
  "image_resolution": "2K",
  "reference_urls": [
    "https://example.com/ref1.jpg"
  ]
}'

Contoh Request Body

{
  "model": "dashscope-wan2.1-t2i-turbo",
  "prompt": "一只可爱的猫咪在草地上奔跑",
  "aspect_ratio": "16:9",
  "image_resolution": "2K",
  "reference_urls": [
    "https://example.com/ref1.jpg"
  ]
}

Contoh Response

{
  "code": 200,
  "message": "ok",
  "data": {
    "task_id": "550e8400-e29b-41d4-a716-446655440000"
  }
}

Hasilkan video

POST/api/developer/v1/videos/generations

Kirim tugas generasi video mandiri. Model all-in-one seperti Wan 3.0 mendukung text-to-video, first frame, first/last frame, dan referensi campuran gambar / video / audio. Mengembalikan task_id; poll GET /api/developer/v1/tasks/task_id untuk hasil.

Parameter

nameintyperequireddesc
modelbodystring[Umum] Nama model video dari GET /models; biasanya wan-3.0 atau dashscope-wan3.0-video
motion_instructionbodystring | null[Umum / wajib bersyarat] Prompt / instruksi gerak. Wajib untuk text-to-video, referensi all-modal, pengeditan, dan perpanjangan. Anda dapat menyebutkan Image 1 / Video 1 / Audio 1
aspect_ratiobody16:9 | 9:16 | 4:3 | 3:4 | null[Umum] Rasio aspek: 16:9, 9:16, 4:3, atau 3:4
duration_secondsbodyinteger | null[Umum] Durasi keluaran dalam detik. Lihat duration_range / max_duration_seconds dari GET /models
capabilitybodyfirst_frame | flf2v | image_reference | null[Umum] first_frame, flf2v, atau image_reference; hilangkan atau null untuk disimpulkan dari field (hanya motion_instruction = text-to-video)
image_urlbodystring | null[Umum / spesifik mode] URL gambar first-frame untuk first_frame / flf2v. Jangan kirim bersama field reference_*
last_frame_urlbodystring | null[Umum / spesifik mode] URL gambar last-frame untuk flf2v. Harus digunakan bersama image_url dan tidak boleh gambar yang sama. Tidak didukung HappyHorse
reference_urlsbodystring[][Umum / mode referensi] URL gambar referensi untuk image_reference
reference_video_urlsbodystring[][Multi-model] Seedance / semantik Wan3 / Wan2.7 R2V / VivaReel2.0. URL video referensi
reference_audio_urlsbodystring[][Multi-model] Seedance / semantik Wan3 / Wan2.7 R2V / minimax-H3. URL audio referensi
resolutionbody480P | 720P | 1080P | null[Semantik Wan3] Resolusi keluaran: 480P, 720P, atau 1080P
audiobodyboolean | null[Semantik Wan3] Apakah akan menghasilkan audio
seedbodyinteger | null[Semantik Wan3] Seed acak untuk hasil yang dapat direproduksi
watermarkbodyboolean | null[hanya dashscope-wan3.0-video] Apakah akan menambahkan watermark
prompt_extendbodyboolean | null[Semantik Wan3] Apakah akan memperluas prompt
smart_durationbodyboolean[Semantik Wan3] Durasi cerdas; default false
enable_thinkingbodyboolean | null[hanya dashscope-wan3.0-video] Apakah akan mengaktifkan thinking
document_urlbodystring | null[hanya dashscope-wan3.0-video] URL referensi dokumen
web_urlbodystring | null[hanya dashscope-wan3.0-video] URL referensi halaman web

Contoh Kode

curl -X POST "https://vivareel.ai/api/developer/v1/videos/generations" \
  -H "Authorization: Bearer sk_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "wan-3.0",
  "motion_instruction": "Video 1 sits on the chair in Image 2 and sings. Image 1 walks over, places Image 3 on the table, and says: the sunshine is so nice today.",
  "aspect_ratio": "9:16",
  "duration_seconds": 8,
  "capability": "image_reference",
  "reference_urls": [
    "https://example.com/character.jpg",
    "https://example.com/chair.jpg",
    "https://example.com/prop.jpg"
  ],
  "reference_video_urls": [
    "https://example.com/performance.mp4"
  ],
  "resolution": "720P",
  "audio": true,
  "prompt_extend": true,
  "smart_duration": false
}'

Contoh Request Body

{
  "model": "wan-3.0",
  "motion_instruction": "Video 1 sits on the chair in Image 2 and sings. Image 1 walks over, places Image 3 on the table, and says: the sunshine is so nice today.",
  "aspect_ratio": "9:16",
  "duration_seconds": 8,
  "capability": "image_reference",
  "reference_urls": [
    "https://example.com/character.jpg",
    "https://example.com/chair.jpg",
    "https://example.com/prop.jpg"
  ],
  "reference_video_urls": [
    "https://example.com/performance.mp4"
  ],
  "resolution": "720P",
  "audio": true,
  "prompt_extend": true,
  "smart_duration": false
}

Contoh Response

{
  "code": 200,
  "message": "ok",
  "data": {
    "task_id": "550e8400-e29b-41d4-a716-446655440000"
  }
}

Ganti karakter dalam video

POST/api/developer/v1/videos/replace-character

Kirim tugas penggantian karakter dengan 1–3 video sumber dan 1–9 gambar referensi. Mengembalikan task_id; poll GET /api/developer/v1/tasks/task_id untuk result_url.

Parameter

nameintyperequireddesc
video_urlsbodystring[]URL video sumber (1–3), harus tautan http(s)
reference_urlsbodystring[]URL gambar referensi (1–9), harus tautan http(s)
promptbodystringPrompt penggantian yang mendeskripsikan tukar yang diinginkan
resolutionbodystringResolusi keluaran; default 720P
aspect_ratiobodystringRasio aspek; default 9:16
modelbodystringModel video; menggunakan default jika dihilangkan
duration_secondsbodynumberTotal durasi video sumber (detik) untuk perkiraan penagihan; terdeteksi otomatis jika dihilangkan
seedbodyintegerSeed acak untuk hasil yang dapat direproduksi
watermarkbodybooleanApakah akan menambahkan watermark; default false

Contoh Kode

curl -X POST "https://vivareel.ai/api/developer/v1/videos/replace-character" \
  -H "Authorization: Bearer sk_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
  "video_urls": [
    "https://example.com/video1.mp4"
  ],
  "reference_urls": [
    "https://example.com/face1.jpg",
    "https://example.com/face2.jpg"
  ],
  "prompt": "将视频中的人物替换为参考图中的人物,保持表情和动作自然",
  "resolution": "720P",
  "aspect_ratio": "9:16",
  "model": "dashscope-wan2.1-i2v-plus",
  "duration_seconds": 10.5,
  "seed": 12345,
  "watermark": false
}'

Contoh Request Body

{
  "video_urls": [
    "https://example.com/video1.mp4"
  ],
  "reference_urls": [
    "https://example.com/face1.jpg",
    "https://example.com/face2.jpg"
  ],
  "prompt": "将视频中的人物替换为参考图中的人物,保持表情和动作自然",
  "resolution": "720P",
  "aspect_ratio": "9:16",
  "model": "dashscope-wan2.1-i2v-plus",
  "duration_seconds": 10.5,
  "seed": 12345,
  "watermark": false
}

Contoh Response

{
  "code": 200,
  "message": "ok",
  "data": {
    "task_id": "550e8400-e29b-41d4-a716-446655440000"
  }
}

Dapatkan status tugas

GET/api/developer/v1/tasks/{task_id}

Poll status dan hasil tugas asinkron. Poll setiap 3–5 detik hingga status completed atau failed.

Parameter

nameintyperequireddesc
task_idpathstringTask ID yang dikembalikan oleh endpoint image/video/replace

Contoh Kode

curl -X GET "https://vivareel.ai/api/developer/v1/tasks/{task_id}" \
  -H "Authorization: Bearer sk_live_xxx"

Contoh Response

{
  "code": 200,
  "message": "ok",
  "data": {
    "task_id": "550e8400-e29b-41d4-a716-446655440000",
    "task_type": "standalone_image_generate",
    "status": "completed",
    "progress": 1,
    "points_cost": 10,
    "result_url": "https://storage.vivareel.com/output/xxx.png",
    "error_message": null,
    "extra": {
      "model": "dashscope-wan2.1-t2i-turbo",
      "aspect_ratio": "16:9"
    }
  }
}

Unggah file

POST/api/developer/v1/files

Unggah file ke penyimpanan dan terima URL yang dapat dirujuk. Gunakan untuk gambar first-frame, gambar referensi, video referensi, atau audio referensi (Content-Type: multipart/form-data).

Parameter

nameintyperequireddesc
fileformDatafileFile yang akan diunggah (gambar, video, audio, dll.)

Contoh Kode

curl -X POST "https://vivareel.ai/api/developer/v1/files" \
  -H "Authorization: Bearer sk_live_xxx"

Contoh Response

{
  "code": 200,
  "message": "ok",
  "data": {
    "url": "https://storage.vivareel.com/uploads/xxx.jpg",
    "storage_key": "uploads/2024/01/xxx.jpg",
    "original_filename": "my_image.jpg",
    "size_bytes": 204800,
    "content_type": "image/jpeg"
  }
}

Daftar model

GET/api/developer/v1/models

Daftar model gambar dan video yang tersedia beserta kemampuan, parameter yang didukung, dan harga. Sebelum memanggil Wan 3.0, konfirmasikan capabilities, duration_range, dan max_reference_images / videos / audios.

Parameter

Tidak ada

Contoh Kode

curl -X GET "https://vivareel.ai/api/developer/v1/models" \
  -H "Authorization: Bearer sk_live_xxx"

Contoh Response

{
  "code": 200,
  "message": "ok",
  "data": {
    "image_models": [
      {
        "name": "dashscope-wan2.1-t2i-turbo",
        "display_name": "Wan 2.1 Turbo",
        "icon_url": "https://api.vivareel.com/icons/wan.png",
        "capabilities": [
          "text_to_image"
        ],
        "capability_labels": {
          "text_to_image": "文生图"
        },
        "max_reference_images": 0,
        "pricing_by_capability": {
          "text_to_image": {
            "capability": "text_to_image",
            "feature_key": "image_generation",
            "billing_unit": "flat",
            "label": "文生图",
            "points": 10
          }
        }
      }
    ],
    "video_models": [
      {
        "name": "wan-3.0",
        "display_name": "Wan 3.0",
        "icon_url": "https://api.vivareel.com/icons/wan_video.png",
        "capabilities": [
          "text_to_video",
          "first_frame",
          "flf2v",
          "image_reference"
        ],
        "capability_labels": {
          "text_to_video": "文生视频",
          "first_frame": "首帧生视频",
          "flf2v": "首尾帧生视频",
          "image_reference": "全能参考"
        },
        "duration_range": {
          "min": 2,
          "max": 30
        },
        "max_duration_seconds": {
          "text_to_video": 30,
          "first_frame": 30,
          "flf2v": 30,
          "image_reference": 30
        },
        "max_reference_images": 10,
        "max_reference_videos": 5,
        "max_reference_audios": 5,
        "pricing_by_capability": {
          "image_reference": {
            "capability": "image_reference",
            "feature_key": "video_generation_image_reference",
            "billing_unit": "per_second",
            "label": "全能参考",
            "points_per_second": 5
          }
        }
      }
    ]
  }
}