Skip to main content
POST
Use este endpoint para criar uma tarefa de vídeo HappyHorse. A API retorna imediatamente um ID da tarefa, então armazene o id retornado e consulte a tarefa até ela atingir um status terminal. POST /v1/videos usa multipart/form-data; passe controles escalares como campos de formulário e imagens de referência como campos de arquivo input_reference.

Escolha um modo de entrada

Para referência para vídeo, envie de 1 a 9 imagens de referência repetindo o campo multipart input_reference. A CometAPI envia cada arquivo carregado como uma imagem de referência do HappyHorse. Use imagens JPEG, JPG, PNG ou WEBP de até 20 MB cada; para obter melhores resultados, use imagens com o lado menor de pelo menos 400 px.

Definir duração e tamanho

Defina size com um valor WxH exato.

Fluxo da tarefa

1

Criar a tarefa

Envie a solicitação de formulário multipart e armazene o id retornado.
2

Consultar a tarefa

Chame Recuperar um vídeo HappyHorse até que status seja completed, failed ou error.
3

Baixar o resultado

Quando a tarefa estiver como completed, chame Recuperar conteúdo de vídeo HappyHorse para baixar o arquivo MP4.

Autorizações

Authorization
string
header
obrigatório

Bearer authentication. Use your CometAPI API key.

Corpo

multipart/form-data
model
enum<string>
obrigatório

HappyHorse model ID for this endpoint.

Opções disponíveis:
happyhorse-1.0,
happyhorse-1.1
Exemplo:

"happyhorse-1.1"

prompt
string
obrigatório

Text prompt that describes the video to generate. For reference-image requests, combine the prompt with the uploaded reference image.

Exemplo:

"Use the uploaded reference image as the visual guide. Create a short cinematic shot with gentle natural motion."

seconds
string

Requested clip duration in seconds. Use an integer from 3 through 15. Default is 5.

Exemplo:

"3"

size
string

Output size as an exact WxH value. Use one of the documented size values for the selected HappyHorse model.

Exemplo:

"1920x1080"

input_reference
file

Reference image file for reference-to-video. Required when using reference-to-video; repeat this multipart field to send additional reference images. CometAPI preserves upload order. Use JPEG, JPG, PNG, or WEBP images up to 20 MB each.

Resposta

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

id
string
obrigatório

Task ID. Use this value with retrieve and content endpoints.

Exemplo:

"task_example"

object
string
obrigatório

Object type. Video tasks return video.

Exemplo:

"video"

model
string
obrigatório

Model ID used for the task.

Exemplo:

"happyhorse-1.1"

status
enum<string>
obrigatório

Task lifecycle status. Poll until the value is completed, failed, or error.

Opções disponíveis:
queued,
in_progress,
completed,
failed,
error
Exemplo:

"queued"

progress
integer
obrigatório

Task progress as a coarse percentage.

Intervalo necessário: 0 <= x <= 100
Exemplo:

0

created_at
integer
obrigatório

Task creation time as a Unix timestamp in seconds.

Exemplo:

1779938152

task_id
string

Compatibility alias for id when present.

Exemplo:

"task_example"

completed_at
integer

Task completion time as a Unix timestamp in seconds. This field appears on completed tasks.

Exemplo:

1779938219

video_url
string

Temporary video delivery URL. This field appears on completed tasks.

Exemplo:

"<temporary-video-url>"

error
object

Failure details. This field appears when the task fails.