Zum Hauptinhalt springen
POST
/
v1
/
videos
curl https://api.cometapi.com/v1/videos \
  -H "Authorization: Bearer <COMETAPI_KEY>" \
  -F 'prompt="A slow cinematic camera push across a coastal landscape at sunrise"' \
  -F 'model="doubao-seedance-2-0-fast"' \
  -F 'seconds="5"' \
  -F 'size="16:9"' \
  -F 'resolution="720p"'
{
  "id": "task_abc123",
  "task_id": "task_abc123",
  "object": "video",
  "model": "doubao-seedance-2-0-fast",
  "status": "SUBMITTED",
  "progress": 0,
  "created_at": 1776681149
}
Verwenden Sie diesen Endpunkt, um einen ByteDance Seedance-Videojob zu starten. Alle Seedance-Modellstufen verwenden dieselbe Request-Struktur; Sie wählen das Modell, indem Sie das Feld model setzen. Der Aufruf gibt sofort eine Task-ID zurück, und das Rendering läuft im Hintergrund weiter.

Ein Modell auswählen

Model idStufeHinweise
doubao-seedance-2-02.0Ausgabe mit der höchsten Qualität in der 2.0-Familie.
doubao-seedance-2-0-fast2.0Schnellere Variante von 2.0 für schnelle Iterationen und Vorschauen.
doubao-seedance-1-5-pro1.5 ProUnterstützt 1080p. Nur Text-zu-Video.
doubao-seedance-1-0-pro1.0 ProUnterstützt 1080p und kürzere Clips ab 2 Sekunden. Nur Text-zu-Video.
Siehe die Models-Seite für die aktuelle Verfügbarkeit.

Parameterbereiche

FeldTypErforderlichStandardZulässige Werte
promptstringjabeliebiger Text
modelstringjadoubao-seedance-2-0, doubao-seedance-2-0-fast, doubao-seedance-1-5-pro, doubao-seedance-1-0-pro
secondsintegernein5abhängig vom Modell (siehe unten)
sizestringnein16:921:9, 16:9, 4:3, 1:1, 3:4, 9:16
resolutionstringnein720p480p, 720p für 2.0-Modelle; 480p, 720p, 1080p für 1.5 Pro und 1.0 Pro
input_referencefileneinJPEG, PNG oder WebP. Wird nur von den 2.0-Modellen akzeptiert.

Dauerbereich nach Modell

Modelseconds-Bereich
doubao-seedance-2-0, doubao-seedance-2-0-fast4 bis 15
doubao-seedance-1-5-pro4 bis 12
doubao-seedance-1-0-pro2 bis 10
Wenn Sie einen Wert außerhalb des Modellbereichs senden, gibt der Endpunkt HTTP 400 mit code: "InvalidParameter" und einer Meldung zu duration zurück.

Image-to-video-Unterstützung

Nur die 2.0-Modelle akzeptieren eine input_reference-Datei. Wenn input_reference mit doubao-seedance-1-5-pro oder doubao-seedance-1-0-pro gesendet wird, gibt der Endpunkt HTTP 400 mit einer Meldung der Form the specified task_type r2v does not support model seedance-1-5-pro zurück. Verwenden Sie diese Modelle nur für Text-zu-Video.

Ein Referenzbild hochladen

Der Request-Body ist multipart/form-data. Um Image-to-video auf einem 2.0-Modell auszuführen, hängen Sie das Bild in derselben Anfrage als Part input_reference an:
curl https://api.cometapi.com/v1/videos \
  -H "Authorization: Bearer <COMETAPI_KEY>" \
  -F 'prompt="A slow cinematic camera push across a coastal landscape at sunrise."' \
  -F 'model="doubao-seedance-2-0"' \
  -F 'seconds="5"' \
  -F 'size="16:9"' \
  -F 'resolution="720p"' \
  -F 'input_reference=@/path/to/reference.jpg'
Ersetzen Sie /path/to/reference.jpg durch den absoluten oder relativen Pfad zu dem Bild, das Sie als Anker für das erste Frame verwenden möchten. Unterstützte Formate sind JPEG, PNG und WebP.

Task-Ablauf

1

Task übermitteln

Senden Sie eine POST-Anfrage mit mindestens prompt und model. Speichern Sie die zurückgegebene id für den nächsten Schritt.
2

Task abfragen

Rufen Sie Ein Seedance-Video abrufen alle 10 bis 20 Sekunden auf.
3

Ausgabe herunterladen

Wenn status zu SUCCESS wird, laden Sie die Datei unter video_url herunter und hosten Sie sie erneut, wenn Sie langfristigen Zugriff benötigen. Die URL ist signiert und läuft nach einem begrenzten Zeitraum ab.

Fehlerantworten

Der Endpunkt gibt HTTP 400 zurück, wenn ein erforderliches Feld fehlt, ein Wert außerhalb des akzeptierten Bereichs liegt oder input_reference an ein Modell gesendet wird, das Image-to-video nicht unterstützt. Er gibt HTTP 401 zurück, wenn das Bearer-Token fehlt oder ungültig ist. Der Error-Body verwendet eine von zwei Strukturen; siehe die 400- und 401-Beispiele im Playground für die genauen Felder.

Autorisierungen

Authorization
string
header
erforderlich

Bearer token authentication. Use your CometAPI key.

Body

multipart/form-data
prompt
string
erforderlich

Text prompt that describes the video. Required.

Beispiel:

"A slow cinematic camera push across a coastal landscape at sunrise."

model
enum<string>
erforderlich

Seedance model id. Choose doubao-seedance-2-0 for the highest quality 2.0 output, doubao-seedance-2-0-fast for quick iteration on 2.0, doubao-seedance-1-5-pro for the 1.5 Pro tier, or doubao-seedance-1-0-pro for the 1.0 Pro tier. Only the two 2.0 models accept input_reference.

Verfügbare Optionen:
doubao-seedance-2-0,
doubao-seedance-2-0-fast,
doubao-seedance-1-5-pro,
doubao-seedance-1-0-pro
Beispiel:

"doubao-seedance-2-0-fast"

seconds
integer
Standard:5

Video duration in seconds. The accepted range depends on the model: doubao-seedance-2-0 and doubao-seedance-2-0-fast accept 4 to 15, doubao-seedance-1-5-pro accepts 4 to 12, and doubao-seedance-1-0-pro accepts 2 to 10. The default is 5 for every model.

Erforderlicher Bereich: 2 <= x <= 15
Beispiel:

5

size
enum<string>
Standard:16:9

Output aspect ratio. All Seedance models accept the same set of values.

Verfügbare Optionen:
21:9,
16:9,
4:3,
1:1,
3:4,
9:16
Beispiel:

"16:9"

resolution
enum<string>
Standard:720p

Output resolution. 480p and 720p are accepted by every model; 1080p is supported only by doubao-seedance-1-5-pro and doubao-seedance-1-0-pro.

Verfügbare Optionen:
480p,
720p,
1080p
Beispiel:

"720p"

input_reference
file

Optional reference image. When included, the job runs in image-to-video mode and uses the image as the visual anchor. Only doubao-seedance-2-0 and doubao-seedance-2-0-fast accept this field; sending it with a 1.0 Pro or 1.5 Pro model returns HTTP 400.

Antwort

Task created. Save the returned id and poll GET /v1/videos/{id}.

id
string
erforderlich

Task id. Use it as the path parameter for GET /v1/videos/{id}.

object
string
erforderlich

Object type, always video.

model
string
erforderlich

Echo of the requested model id.

status
enum<string>
erforderlich

Initial task status. A newly created task is returned as SUBMITTED.

Verfügbare Optionen:
SUBMITTED,
IN_PROGRESS,
SUCCESS,
FAILED,
ERROR
progress
integer
erforderlich

Completion percentage. 0 at creation.

Erforderlicher Bereich: 0 <= x <= 100
created_at
integer
erforderlich

Task creation time as a Unix timestamp in seconds.

task_id
string

Alias of id returned for compatibility. The value matches id.