Skip to main content

Overview

Tool identifier video_generate. video_generate generates videos from text. The example below first uses image_generate to create a first and last frame, then composes a video. Import path: from veadk.tools.builtin_tools.video_generate import video_generate

Environment & prerequisites

Requirements:
  1. Configure the API key for the agent’s reasoning model.
  2. Configure the video-generation model name (MODEL_VIDEO_NAME).
  3. If composing from a first/last frame, also configure the image-generation model name (MODEL_IMAGE_NAME).
Environment variables:
  • MODEL_VIDEO_API_KEY: API key for the video-generation model; falls back to MODEL_AGENT_API_KEY and then to model.api_key from the config file when unset
  • MODEL_AGENT_API_KEY: API key for the agent’s reasoning model
  • MODEL_VIDEO_NAME: video-generation model name
  • MODEL_VIDEO_API_BASE: video-generation model API endpoint; defaults to the ModelArk endpoint
  • MODEL_IMAGE_NAME: image-generation model name
Credentials are resolved at tool execution time, not at import time. Importing the tool module does not initialize a client or require credentials to be present.
config.yaml keys:
config.yaml
For BytePlus, explicitly configure the media model name, API base URL, and key for your enabled service. Do not assume CLOUD_PROVIDER overrides media configuration. Capabilities and parameter limits depend on the selected model service. The video API base and default model name are resolved at import time; configure them before starting the process.

Usage

examples/tools/video_generate/agent.py

Parameters and task states

Each request requires video_name: str and prompt: str. Other fields use service defaults when omitted: Results contain status, success_list, error_list, error_details, and pending_list. Success items map video names to URLs. Pending items include a task_id. Ending local waiting does not cancel remote generation; query the existing task instead of resubmitting it. video_task_query(task_id: str, tool_context: ToolContext) requires the task ID and injected context, with no optional arguments. It returns fields including status, video_url, and error. queued and running are still in progress; deliver a video only after succeeded with a URL. Inspect errors for failed tasks. Query using the same service endpoint and authorized credentials as generation.
Last modified on September 19, 2026