Animate 1–10 reference images with a motion prompt and optional audio or video references. Each reference video can be up to 15 seconds. WAN generates at 1080p and sets the output length automatically: 29 seconds with no reference video, or 16 seconds with one or more.
Todas as requisições vão para https://genjutsu.top. Envie uma chave de API da Genjutsu como token bearer. POST https://genjutsu.top/v1/media/generate · Authorization: Bearer $GENJUTSU_API_KEY · Escopos necessários: generate, read, assets
Optional. Add up to 10 clips, each 15 seconds or less. Add a reference video for a 16-second output. Leave this empty for a 29-second output.
até 10 arquivos; duração do clipe de até 15 s
aspect_ratio
um de
Opcional
"16:9"
"9:16"
"16:9"
"1:1"
"4:3"
"3:4"
"21:9"
"4:5"
Duration
um de
Opcional
-
16
30
Requisição mínima
images_list: Replace with the asset ID of your own uploaded image (upload it with POST /v1/assets/uploads first).
# Media IDs below are placeholders: replace them with your own uploaded assets before running this.
curl -X POST "https://genjutsu.top/v1/media/generate" \
-H "Authorization: Bearer $GENJUTSU_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"model": "wan-3-0",
"mode": "i2v",
"params": {
"prompt": "A lighthouse on a rocky cliff at golden hour, soft clouds, cinematic light",
"images_list": [
"asset:00000000-0000-4000-8000-000000000001"
]
}
}'
Requisição com parâmetros opcionais
images_list: Replace with the asset ID of your own uploaded image (upload it with POST /v1/assets/uploads first).
images_list: Replace with the asset ID of your own uploaded image (upload it with POST /v1/assets/uploads first).
audios_list: Replace with the asset ID of your own uploaded audio (upload it with POST /v1/assets/uploads first).
audios_list: Replace with the asset ID of your own uploaded audio (upload it with POST /v1/assets/uploads first).
videos_list: Replace with the asset ID of your own uploaded video (upload it with POST /v1/assets/uploads first).
videos_list: Replace with the asset ID of your own uploaded video (upload it with POST /v1/assets/uploads first).
# Media IDs below are placeholders: replace them with your own uploaded assets before running this.
curl -X POST "https://genjutsu.top/v1/media/generate" \
-H "Authorization: Bearer $GENJUTSU_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"model": "wan-3-0",
"mode": "i2v",
"params": {
"prompt": "A lighthouse on a rocky cliff at golden hour, soft clouds, cinematic light",
"Duration": 16,
"audios_list": [
"asset:00000000-0000-4000-8000-000000000003",
"asset:00000000-0000-4000-8000-000000000004"
],
"images_list": [
"asset:00000000-0000-4000-8000-000000000001",
"asset:00000000-0000-4000-8000-000000000002"
],
"videos_list": [
"asset:00000000-0000-4000-8000-000000000005",
"asset:00000000-0000-4000-8000-000000000006"
],
"aspect_ratio": "16:9"
}
}'
Envie a solicitação para POST /v1/media/generate. Ela responde 202 com um task_id. Consulte GET /v1/media/tasks/{task_id} a cada 5 segundos até is_final ser true: o estado será succeeded, failed ou cancelled e a mesma tarefa traz o resultado (outputs) ou o erro (error_code e error_message). Repetir o envio com a mesma Idempotency-Key devolve a tarefa original. Os IDs e URLs das respostas são ilustrativos.
# Media IDs below are placeholders: replace them with your own uploaded assets before running this.
# Needs curl and jq.
# 1. Submit. The response is 202 with task_id, state and credits_held.
ID=$(curl -s -X POST "https://genjutsu.top/v1/media/generate" \
-H "Authorization: Bearer $GENJUTSU_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"model": "wan-3-0",
"mode": "i2v",
"params": {
"prompt": "A lighthouse on a rocky cliff at golden hour, soft clouds, cinematic light",
"images_list": [
"asset:00000000-0000-4000-8000-000000000001"
]
}
}' | jq -r .task_id)
echo "task: $ID"
# 2. Poll every 5 seconds until is_final is true (state is then succeeded, failed or cancelled).
while true; do
TASK=$(curl -s "https://genjutsu.top/v1/media/tasks/$ID" -H "Authorization: Bearer $GENJUTSU_API_KEY")
echo "state: $(echo "$TASK" | jq -r .state)"
[ "$(echo "$TASK" | jq -r .is_final)" = "true" ] && break
sleep 5
done
# 3. The final task carries the result: outputs[].url when succeeded, error_code and error_message when failed.
echo "$TASK" | jq '{state, outputs, error_code, error_message, credits}'
Os erros usam códigos em minúsculas e trazem retryable e request_id. Um cancelamento pendente não é um cancelamento: se o modelo terminar mesmo assim, a tarefa ainda pode ser cobrada. Veja a referência da API para cancelar.
API estilo recurso (alternativa)
POST /v1/generations aceita os mesmos valores em inputs (e um quote_id opcional) e responde com um recurso generation: consulte GET /v1/generations/{id} pelo id até o status ser succeeded, failed ou cancelled e depois busque GET /v1/generations/{id}/result. Os erros usam códigos em MAIÚSCULAS. Novas integrações devem preferir a API media acima; ambas usam o mesmo processo e os mesmos preços.
# Media IDs below are placeholders: replace them with your own uploaded assets before running this.
# Needs curl and jq.
# 1. Submit. The response is 202 with the generation id.
ID=$(curl -s -X POST "https://genjutsu.top/v1/generations" \
-H "Authorization: Bearer $GENJUTSU_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"mode": "i2v",
"model": "wan-3-0",
"inputs": {
"prompt": "A lighthouse on a rocky cliff at golden hour, soft clouds, cinematic light",
"images_list": [
"asset:00000000-0000-4000-8000-000000000001"
]
}
}' | jq -r .id)
echo "generation: $ID"
# 2. Poll until the status is succeeded, failed or cancelled.
while true; do
STATUS=$(curl -s "https://genjutsu.top/v1/generations/$ID" -H "Authorization: Bearer $GENJUTSU_API_KEY" | jq -r .status)
echo "status: $STATUS"
case "$STATUS" in succeeded|failed|cancelled) break ;; esac
sleep 2
done
# 3. Fetch the result (only available once the status is succeeded).
curl -s "https://genjutsu.top/v1/generations/$ID/result" -H "Authorization: Bearer $GENJUTSU_API_KEY"