Videos

Starts a video job and answers 202 at once: a clip takes from half a minute to several minutes. Requires an API key. Poll GET /v1/videos/{id} until status is completed or failed, then fetch the file from GET /v1/videos/{id}/content. NagaAI holds the full price of the clip on the balance while the job runs and charges it once, when the clip is ready. A job that fails is not charged.

post/v1/videos

Request

Request body

modelstring required

The video model, named by its id or alias.

promptstring required

What to generate, in words. One to 8192 characters, and moderation screens it first.

durationinteger nullable

Clip length in seconds; one of the duration values the model's video_generation operation lists in GET /v1/models. Absent takes its default.

resolutionstring nullable

One of the resolution values the operation lists, such as 720p. Absent takes its default.

aspect_ratiostring nullable

One of the aspect_ratio values the operation lists, such as 16:9. Absent takes its default.

generate_audioboolean nullable

Ask for a soundtrack. Only a model whose operation lists generate_audio accepts true, and the audio price applies.

seedinteger nullable

A seed for repeatable output, where the model supports one.

Response

The job, accepted and queued. Poll polling_url until status is completed or failed.

idstring required

The job id; the polling and content URLs carry it.

objectstring required

Always video.generation.

modelstring required

The model the job was submitted for, as the caller named it.

statusstring required

pending, in_progress, completed or failed.

polling_urlstring required

Where to poll this job.

created_atinteger required

Unix seconds when the job was accepted.

completed_atinteger nullable

Unix seconds when the job reached completed or failed.

durationinteger required

The requested clip length in seconds.

resolutionstring required

The requested resolution.

aspect_ratiostring required

The requested aspect ratio.

urlsstring[] nullable

Links to the finished file; present once the job is completed.

Example response

{
  "object": "video.generation"
}

Changes