Video Generation

Generate videos from text prompts or images using the z-ai-web-dev-sdk asynchronous task API.

Updated Jul 11, 2026
One-click install
npx skills add https://github.com/mukaddam-ali/Anadolu-Kitchen --skill video-generation-mukaddam-ali
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Video Generation
Source: https://github.com/mukaddam-ali/Anadolu-Kitchen/tree/main/skills/video-generation
Command: npx skills add https://github.com/mukaddam-ali/Anadolu-Kitchen --skill video-generation-mukaddam-ali

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires z-ai-web-dev-sdk, and includes scripts (resource) components.

What problem does it solve? Building video generation into an application requires handling asynchronous task creation, status polling, and result retrieval, which is error-prone to implement from scratch. This Skill provides ready-to-use patterns for generating videos from text prompts or images with the z-ai-web-dev-sdk. ## Core Features & Use Cases - Text-to-Video and Image-to-Video: Create videos from text descriptions, a single starting image, or start/end keyframe pairs with configurable resolution, frame rate, duration, and quality mode. - Asynchronous Task Management: Create generation tasks, poll task status with fixed intervals or exponential backoff, and extract the resulting video URL from multiple possible response fields. - CLI and SDK Workflows: Use the z-ai CLI for quick one-off generation with automatic polling, or the SDK for batch generation, queue management, Express.js endpoints, and WebSocket status updates. - Use Case: A developer building a social media tool can submit a prompt like "A sunset over the ocean", poll the returned task ID until it succeeds, and serve the generated MP4 URL to end users. ## Quick Start Use the video generation skill to create a five-second 1080p video from the prompt "A cat playing with a ball" and poll until the video URL is ready.

Frequently Asked Questions about Video Generation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate a video from a text prompt with z-ai-web-dev-sdk?

Call zai.video.generations.create with a prompt and optional parameters like quality, size, fps, and duration to receive a task ID. Then poll zai.async.result.query with that task ID until the status becomes SUCCESS and read the video URL from the response.

How to generate a video from an image using the SDK?

Pass an image_url parameter to zai.video.generations.create along with an optional prompt describing the motion. You can supply a single image URL as the starting frame or an array of two URLs for start and end keyframes.

Can I use z-ai-web-dev-sdk in client-side browser code?

No, z-ai-web-dev-sdk must be used in backend code only. Importing it in client-side code will fail and risks exposing credentials, so video generation calls should live behind server endpoints.

Why does my video generation task stay in PROCESSING status?

Video generation is asynchronous and can take minutes depending on duration, resolution, and quality mode. Implement polling with a reasonable interval such as 5 to 10 seconds, a maximum poll count, and consider exponential backoff for longer tasks.

What parameters does the video generation API support?

The API accepts prompt, image_url, quality (speed or quality), with_audio, size (e.g. 1920x1080), fps (30 or 60), duration (5 or 10 seconds), and model. At least one of prompt or image_url is required.

When should I use the z-ai CLI instead of the SDK for video generation?

Use the CLI for quick tests, one-off video creation, and simple automation since it handles polling automatically with the --poll flag. Use the SDK for batch generation, custom queue management, and integration into web applications.