Vai al contenuto principale
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
}
Usa questo endpoint per avviare un job video ByteDance Seedance. Tutti i livelli di modello Seedance condividono la stessa struttura della richiesta; scegli il modello impostando il campo model. La chiamata restituisce immediatamente un id del task e il rendering continua in background.

Scegliere un modello

Model idTierNotes
doubao-seedance-2-02.0Output della qualità più alta nella famiglia 2.0.
doubao-seedance-2-0-fast2.0Variante più veloce di 2.0 per iterazioni rapide e anteprime.
doubao-seedance-1-5-pro1.5 ProSupporta 1080p. Solo text-to-video.
doubao-seedance-1-0-pro1.0 ProSupporta 1080p e clip più brevi a partire da 2 secondi. Solo text-to-video.
Consulta la pagina Models per la disponibilità in tempo reale.

Intervalli dei parametri

FieldTypeRequiredDefaultAllowed values
promptstringyesqualsiasi testo
modelstringyesdoubao-seedance-2-0, doubao-seedance-2-0-fast, doubao-seedance-1-5-pro, doubao-seedance-1-0-pro
secondsintegerno5dipende dal modello (vedi sotto)
sizestringno16:921:9, 16:9, 4:3, 1:1, 3:4, 9:16
resolutionstringno720p480p, 720p per i modelli 2.0; 480p, 720p, 1080p per 1.5 Pro e 1.0 Pro
input_referencefilenoJPEG, PNG o WebP. Accettato solo dai modelli 2.0.

Intervallo della durata per modello

Modelseconds range
doubao-seedance-2-0, doubao-seedance-2-0-fastda 4 a 15
doubao-seedance-1-5-proda 4 a 12
doubao-seedance-1-0-proda 2 a 10
L’invio di un valore fuori dall’intervallo del modello restituisce HTTP 400 con code: "InvalidParameter" e un messaggio relativo a duration.

Supporto image-to-video

Solo i modelli 2.0 accettano un file input_reference. L’invio di input_reference con doubao-seedance-1-5-pro o doubao-seedance-1-0-pro restituisce HTTP 400 con un messaggio nella forma the specified task_type r2v does not support model seedance-1-5-pro. Usa questi modelli solo per text-to-video.

Caricare un’immagine di riferimento

Il body della richiesta è multipart/form-data. Per eseguire image-to-video su un modello 2.0, allega l’immagine come parte input_reference nella stessa richiesta:
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'
Sostituisci /path/to/reference.jpg con il percorso assoluto o relativo dell’immagine che vuoi usare come ancoraggio del primo frame. I formati supportati sono JPEG, PNG e WebP.

Flusso del task

1

Submit the task

Invia una richiesta POST con almeno prompt e model. Salva l’id restituito per il passaggio successivo.
2

Poll the task

Chiama Retrieve a Seedance video ogni 10-20 secondi.
3

Download the output

Quando status diventa SUCCESS, scarica il file da video_url e ospitalo nuovamente se ti serve un accesso a lungo termine. L’URL è firmato e scade dopo un intervallo limitato.

Risposte di errore

L’endpoint restituisce HTTP 400 quando manca un campo obbligatorio, un valore è fuori dall’intervallo accettato oppure input_reference viene inviato a un modello che non supporta image-to-video. Restituisce HTTP 401 quando il bearer token manca o non è valido. Il body di errore usa una di due strutture; consulta gli esempi 400 e 401 nel playground per i campi esatti.

Autorizzazioni

Authorization
string
header
obbligatorio

Bearer token authentication. Use your CometAPI key.

Corpo

multipart/form-data
prompt
string
obbligatorio

Text prompt that describes the video. Required.

Esempio:

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

model
enum<string>
obbligatorio

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.

Opzioni disponibili:
doubao-seedance-2-0,
doubao-seedance-2-0-fast,
doubao-seedance-1-5-pro,
doubao-seedance-1-0-pro
Esempio:

"doubao-seedance-2-0-fast"

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

Intervallo richiesto: 2 <= x <= 15
Esempio:

5

size
enum<string>
predefinito:16:9

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

Opzioni disponibili:
21:9,
16:9,
4:3,
1:1,
3:4,
9:16
Esempio:

"16:9"

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

Opzioni disponibili:
480p,
720p,
1080p
Esempio:

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

Risposta

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

id
string
obbligatorio

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

object
string
obbligatorio

Object type, always video.

model
string
obbligatorio

Echo of the requested model id.

status
enum<string>
obbligatorio

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

Opzioni disponibili:
SUBMITTED,
IN_PROGRESS,
SUCCESS,
FAILED,
ERROR
progress
integer
obbligatorio

Completion percentage. 0 at creation.

Intervallo richiesto: 0 <= x <= 100
created_at
integer
obbligatorio

Task creation time as a Unix timestamp in seconds.

task_id
string

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