TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/anil-matcha/open-generative-ai/llms.txt
Use this file to discover all available pages before exploring further.
generateVideo and generateI2V functions power video generation in Open Generative AI. Both follow the same submit-and-poll pattern as image generation, but with a higher polling timeout — video generation typically takes between 30 seconds and several minutes depending on the model and duration, so the polling loop runs up to 900 attempts at 2-second intervals (30 minutes total). Use generateVideo for text-to-video generation and generateI2V to animate a start-frame image.
generateVideo(apiKey, params)
Generates a video from a text prompt using any of the 40+ text-to-video models. Supports aspect ratio, duration, quality, and optional mode selection (e.g., for Grok Imagine’s fun/normal/spicy modes).
Your Muapi.ai API key. Passed as the
x-api-key header.Text-to-video model ID. Examples:
kling-v3, sora-2, veo-3, wan-2.6, seedance-2.0, hailuo-2.3, runway-gen3.Text prompt describing the video to generate. Required for most models.
Output aspect ratio. Common values:
16:9, 9:16, 4:3, 3:4, 1:1. Model-dependent.Video duration. Common values:
5, 10, 15 (seconds). Model-dependent — check model capabilities.Output resolution (model-dependent). E.g.,
480p, 720p, 1080p.Quality preset:
basic or high. Supported by Seedance 2.0 and similar ByteDance models.Generation mode for models that support it. E.g., Grok Imagine modes:
fun, normal, spicy.Optional start-frame image URL. Some T2V models accept an initial frame for style guidance.
Optional callback invoked after submission with the
request_id.Promise<{ url: string, outputs: string[], status: string, request_id: string }>
The url field is the generated video URL.
generateI2V(apiKey, params)
Generates a video from a start-frame image using any of the 60+ image-to-video models. The model animates the provided image into a video clip.
generateI2V uses the i2v model registry. Some models accept multiple reference images via images_list and also support a last_image parameter to specify the final frame of the animation.Your Muapi.ai API key.
Image-to-video model ID. Examples:
kling-v2.1-i2v, veo3-i2v, runway-i2v, seedance-2.0-i2v, midjourney-v7-i2v, wan2.2-i2v.Optional prompt to guide the animation style and motion.
URL of the start-frame image to animate.
Array of reference image URLs for models that support multiple inputs (e.g., Seedance 2.0 I2V supports up to 9 reference images).
URL of the desired end frame for models that support first-to-last frame interpolation.
Output aspect ratio (model-dependent).
Video duration in seconds. Common values:
5, 10.Output resolution (model-dependent).
Quality preset (model-dependent).
Generation mode (model-dependent).
Name value for models that define a
name input field in their model info. Falls back to the model’s default name if not provided.Optional callback with
request_id after submission.Promise<{ url: string, outputs: string[], status: string }>
Polling Timeout
Video generation uses a maximum of 900 poll attempts at 2-second intervals, giving a 30-minute window before the call times out with"Generation timed out after polling.". For long-form video models (e.g., Veo 3, Sora 2), ensure your calling environment does not time out the connection before the polling completes.
