Skip to content

Text-to-video

Create a Haiper 2.x text-to-video generation and receive a generation id.

This example assumes using Haiper; is in scope and apiKey contains your Haiper API key.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
using var client = new HaiperClient(apiKey);

var response = await client.CreateTextToVideoAsync(new TextToVideoRequest
{
    Prompt = "A sweeping drone shot over a futuristic seaside city at sunrise.",
    GenMode = TextToVideoRequestGenMode.Standard,
    Settings = new VideoSettings
    {
        AspectRatio = VideoSettingsAspectRatio.x16_9,
        Duration = 4,
    },
    IsPublic = false,
});