Seedance 2.0
Seedance 2.0
เอกสารเริ่มต้นใช้งาน
ภาพรวม APIข้อความเป็นวิดีโอภาพเป็นวิดีโอ
เอกสารอ้างอิง API

ข้อความเป็นวิดีโอ

สร้างวิดีโอจากพรอมต์ข้อความด้วย Seedance 2.0 Open API

หากไม่ส่ง mediaUrls มา endpoint นี้จะทำงานในโหมด text-to-video แบบล้วน

Endpoint

POST /api/open/v1/video/generations

ตัวอย่างคำขอ

curl --request POST \
  --url https://www.seedance2.ink/api/open/v1/video/generations \
  --header 'Authorization: Bearer sd2_live_your_api_key' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "seedance-2.0",
    "prompt": "A river flowing through an autumn forest, aerial view, cinematic motion",
    "aspectRatio": "16:9",
    "duration": 5,
    "resolution": "720p",
    "webhookUrl": "https://your-app.com/webhooks/seedance",
    "metadata": {
      "projectId": "proj_1001",
      "sceneId": "scene_08"
    }
  }'

ตัวอย่างการตอบกลับสำเร็จ

{
  "success": true,
  "requestId": "req_1234567890",
  "status": "queued",
  "creditsCharged": 40
}

ฟิลด์คำขอ

FieldTypeRequiredDescription
modelstringYesเลือกได้จาก seedance-2.0, seedance-2.0-fast, seedance-1.5-pro
promptstringYesพรอมต์ภาษาธรรมชาติที่อธิบายวิดีโอเป้าหมาย
aspectRatiostringNoเลือกได้จาก 16:9, 9:16, 1:1
durationintegerNoseedance-2.0 และ seedance-2.0-fast รองรับ 4-15 วินาที ส่วน seedance-1.5-pro รองรับ 5 หรือ 10 วินาที
resolutionstringNoเลือกได้จาก 480p, 720p, 1080p
webhookUrlstringNoCallback URL สำหรับรับผลลัพธ์สุดท้าย
metadataobjectNoMetadata แบบกำหนดเองที่บันทึกไปพร้อมกับคำขอ

ตรวจสอบผลลัพธ์

curl https://www.seedance2.ink/api/open/v1/video/generations/req_1234567890 \
  --header 'Authorization: Bearer sd2_live_your_api_key'
{
  "success": true,
  "requestId": "req_1234567890",
  "status": "succeeded",
  "model": "seedance-2.0",
  "prompt": "A river flowing through an autumn forest, aerial view, cinematic motion",
  "duration": 5,
  "aspectRatio": "16:9",
  "output": {
    "type": "video",
    "url": "https://pub-your-bucket.r2.dev/open-api-results/req_1234567890.mp4"
  },
  "error": null
}

ยกเลิกงาน

curl --request POST \
  --url https://www.seedance2.ink/api/open/v1/video/generations/req_1234567890/cancel \
  --header 'Authorization: Bearer sd2_live_your_api_key'
{
  "success": true,
  "requestId": "req_1234567890",
  "status": "cancelled"
}

หมายเหตุ

  • creditsCharged จะถูกคำนวณเมื่อระบบรับงานแล้ว
  • output.url จะมีเฉพาะเมื่อ status เป็น succeeded
  • หากต้องการการแจ้งเตือนแบบ push แทน polling ให้ตั้งค่า webhook

ภาพรวม API

ทำความเข้าใจการยืนยันตัวตน การส่งงาน การตรวจสอบสถานะ และ webhook ของ Seedance 2.0 Open API

ภาพเป็นวิดีโอ

สร้างวิดีโอจากภาพและสื่ออ้างอิงด้วย Seedance 2.0 Open API

สารบัญ

Endpointตัวอย่างคำขอตัวอย่างการตอบกลับสำเร็จฟิลด์คำขอตรวจสอบผลลัพธ์ยกเลิกงานหมายเหตุ