Designed for fast regeneration and low-friction updates when the upstream API changes without breaking compatibility.
Modern .NET
Targets current .NET practices including nullability, trimming, NativeAOT awareness, and source-generated serialization.
Docs from examples
Examples stay in sync between the README, MkDocs site, and integration tests through the AutoSDK docs pipeline.
Usage
123
usingVidu;usingvarclient=newViduClient(apiKey);
Text to Video
Shows how to submit a text-to-video generation task with Vidu and poll for the result.
1 2 3 4 5 6 7 8 910111213141516171819202122
usingvarclient=newViduClient(apiKey);// Submit a text-to-video generation task with viduq3-turbo at 720p.vartask=awaitclient.Generation.CreateTextToVideoTaskAsync(model:Model.Viduq3Turbo,prompt:"A golden retriever running through a sunlit meadow in cinematic slow motion",duration:5,aspectRatio:AspectRatio.x16_9,resolution:Resolution.x720p);Console.WriteLine($"Task ID: {task.TaskId}");Console.WriteLine($"State: {task.State}");// Poll the task until it reaches a terminal state (success/failed).varcreations=awaitclient.Tasks.GetTaskCreationsAsync(id:task.TaskId!);Console.WriteLine($"Creations state: {creations.State}");// When the task succeeds, the result contains one or more creation URLs valid for 24 hours.if(creations.State==TaskState.Success&&creations.Creationsis{Count:>0}){Console.WriteLine($"Video URL: {creations.Creations[0].Url}");}
Image to Video
Shows how to animate a single reference image into a short video clip.
1 2 3 4 5 6 7 8 9101112
usingvarclient=newViduClient(apiKey);// Provide a publicly reachable image URL. Base64 data URIs are also accepted.vartask=awaitclient.Generation.CreateImageToVideoTaskAsync(model:Model.Viduq3Turbo,images:newList<string>{"https://prod-file.vidu.studio/static/images/home/sample.png"},prompt:"The subject gently turns its head and smiles",duration:5,resolution:Resolution.x720p);Console.WriteLine($"Task ID: {task.TaskId}");Console.WriteLine($"State: {task.State}");
Reference to Video
Shows Vidu's differentiated Reference-to-Video feature - generating a video that
preserves the identity of multiple subjects supplied as reference images.
1 2 3 4 5 6 7 8 9101112131415161718
usingvarclient=newViduClient(apiKey);// Up to 7 reference images can be supplied; each is used as a subject reference// that Vidu preserves across the generated frames.vartask=awaitclient.Generation.CreateReferenceToVideoTaskAsync(model:Model.Viduq3Turbo,prompt:"The two characters walk together through a neon-lit Tokyo street at night",images:newList<string>{"https://prod-file.vidu.studio/static/images/home/ref1.png","https://prod-file.vidu.studio/static/images/home/ref2.png",},duration:5,aspectRatio:AspectRatio.x16_9,resolution:Resolution.x720p);Console.WriteLine($"Task ID: {task.TaskId}");Console.WriteLine($"State: {task.State}");
Start End to Video
Shows how to generate a video that interpolates between a start frame and end frame.
1 2 3 4 5 6 7 8 910111213141516
usingvarclient=newViduClient(apiKey);// Provide exactly two images - the start frame and the end frame.// Aspect ratios must be between 0.8 and 1.25 of each other.vartask=awaitclient.Generation.CreateStartEndToVideoTaskAsync(model:Model.Viduq3Turbo,images:newList<string>{"https://prod-file.vidu.studio/static/images/home/start.png","https://prod-file.vidu.studio/static/images/home/end.png",},prompt:"Smooth transition with a subtle camera push-in",duration:5,resolution:Resolution.x720p);Console.WriteLine($"Task ID: {task.TaskId}");
MEAI Tools
Shows how to expose Vidu operations as Microsoft.Extensions.AI tools so any
IChatClient (OpenAI, Anthropic, etc.) can invoke them as function calls.
1 2 3 4 5 6 7 8 9101112131415
// Use a fake API key - we only exercise the tool builders, not the network.usingvarclient=newViduClient(apiKey:"test-key");// Each helper returns an AIFunction that can be passed into ChatOptions.Tools.vartextToVideo=client.AsTextToVideoTool();varimageToVideo=client.AsImageToVideoTool();varreferenceToVideo=client.AsReferenceToVideoTool();varstartEndToVideo=client.AsStartEndToVideoTool();vargetTask=client.AsGetTaskCreationsTool();varupscale=client.AsUpscaleTool();vartools=newAIFunction[]{textToVideo,imageToVideo,referenceToVideo,startEndToVideo,getTask,upscale,};