Naar hoofdinhoud gaan
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
}
Gebruik dit endpoint om een ByteDance Seedance-videojob te starten. Alle Seedance-modeltiers delen dezelfde request-vorm; je kiest het model door het veld model in te stellen. De aanroep retourneert meteen een task id en het renderen gaat op de achtergrond door.

Kies een model

Model idTierOpmerkingen
doubao-seedance-2-02.0Uitvoer van de hoogste kwaliteit binnen de 2.0-familie.
doubao-seedance-2-0-fast2.0Snellere variant van 2.0 voor snelle iteratie en previews.
doubao-seedance-1-5-pro1.5 ProOndersteunt 1080p. Alleen text-to-video.
doubao-seedance-1-0-pro1.0 ProOndersteunt 1080p en kortere clips vanaf 2 seconden. Alleen text-to-video.
Zie de Models-pagina voor actuele beschikbaarheid.

Parameterbereiken

FieldTypeRequiredDefaultToegestane waarden
promptstringyeswillekeurige tekst
modelstringyesdoubao-seedance-2-0, doubao-seedance-2-0-fast, doubao-seedance-1-5-pro, doubao-seedance-1-0-pro
secondsintegerno5afhankelijk van model (zie hieronder)
sizestringno16:921:9, 16:9, 4:3, 1:1, 3:4, 9:16
resolutionstringno720p480p, 720p voor 2.0-modellen; 480p, 720p, 1080p voor 1.5 Pro en 1.0 Pro
input_referencefilenoJPEG, PNG of WebP. Alleen geaccepteerd door de 2.0-modellen.

Duurbereik per model

Modelseconds-bereik
doubao-seedance-2-0, doubao-seedance-2-0-fast4 tot 15
doubao-seedance-1-5-pro4 tot 12
doubao-seedance-1-0-pro2 tot 10
Als je een waarde buiten het modelbereik verstuurt, retourneert de API HTTP 400 met code: "InvalidParameter" en een bericht over duration.

Ondersteuning voor image-to-video

Alleen de 2.0-modellen accepteren een input_reference-bestand. Het versturen van input_reference met doubao-seedance-1-5-pro of doubao-seedance-1-0-pro retourneert HTTP 400 met een bericht in de vorm the specified task_type r2v does not support model seedance-1-5-pro. Gebruik die modellen alleen voor text-to-video.

Een referentieafbeelding uploaden

De request body is multipart/form-data. Om image-to-video op een 2.0-model uit te voeren, voeg je de afbeelding toe als het input_reference-onderdeel in dezelfde request:
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'
Vervang /path/to/reference.jpg door het absolute of relatieve pad naar de afbeelding die je wilt gebruiken als anker voor het eerste frame. Ondersteunde formaten zijn JPEG, PNG en WebP.

Task-flow

1

Submit the task

Stuur een POST-request met ten minste prompt en model. Bewaar de geretourneerde id voor de volgende stap.
2

Poll the task

Roep Een Seedance-video ophalen elke 10 tot 20 seconden aan.
3

Download the output

Wanneer status SUCCESS wordt, download je het bestand op video_url en host je het opnieuw als je langdurige toegang nodig hebt. De URL is ondertekend en verloopt na een beperkte periode.

Error responses

Het endpoint retourneert HTTP 400 wanneer een verplicht veld ontbreekt, een waarde buiten het geaccepteerde bereik valt, of input_reference naar een model wordt gestuurd dat image-to-video niet ondersteunt. Het retourneert HTTP 401 wanneer het bearer token ontbreekt of ongeldig is. De error body gebruikt een van twee vormen; zie de 400- en 401-voorbeelden in de playground voor de exacte velden.

Autorisaties

Authorization
string
header
vereist

Bearer token authentication. Use your CometAPI key.

Body

multipart/form-data
prompt
string
vereist

Text prompt that describes the video. Required.

Voorbeeld:

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

model
enum<string>
vereist

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.

Beschikbare opties:
doubao-seedance-2-0,
doubao-seedance-2-0-fast,
doubao-seedance-1-5-pro,
doubao-seedance-1-0-pro
Voorbeeld:

"doubao-seedance-2-0-fast"

seconds
integer
standaard: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.

Vereist bereik: 2 <= x <= 15
Voorbeeld:

5

size
enum<string>
standaard:16:9

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

Beschikbare opties:
21:9,
16:9,
4:3,
1:1,
3:4,
9:16
Voorbeeld:

"16:9"

resolution
enum<string>
standaard: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.

Beschikbare opties:
480p,
720p,
1080p
Voorbeeld:

"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.

Respons

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

id
string
vereist

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

object
string
vereist

Object type, always video.

model
string
vereist

Echo of the requested model id.

status
enum<string>
vereist

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

Beschikbare opties:
SUBMITTED,
IN_PROGRESS,
SUCCESS,
FAILED,
ERROR
progress
integer
vereist

Completion percentage. 0 at creation.

Vereist bereik: 0 <= x <= 100
created_at
integer
vereist

Task creation time as a Unix timestamp in seconds.

task_id
string

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