Guides
AnyCap · 2026-07-11
How to add video generation
to an AI agent
AI agents can write code, answer questions, and automate workflows, but they need a media tool to create video. AnyCap adds video generation through a skill and CLI so the agent can discover models, inspect live schemas, run generation, and keep the downloaded asset in the same workflow.
This guide covers Claude Code, Cursor, and Codex. It connects source selection, installation, model discovery, schema validation, prompt structure, and the single-command path from a plain-language request to a completed video.
The practical goal is simple: after setup, an agent can treat video generation like another tool call. A user can ask for a product demo, motion concept, or short social clip, and the agent can handle the end-to-end execution path.
What you need
- An AI agent that can run shell commands, such as Claude Code, Cursor, or Codex
- Node.js for the skills installer or npm-based CLI installation path
- Access to the browser or device authentication flow selected by the CLI
- A clear text brief, source image, or existing clip for the first generation test
Video generation completes through one CLI command. The CLI waits for server-side completion, downloads the requested output, and prints flat JSON when the command completes; no separate follow-up command is required.
Choose the workflow from your source
Start with the material you already have. Each path uses a different mode, and the selected model must expose that mode in the live catalog.
text-to-video
Text brief to video
Use a written scene, product, or motion brief as the only creative input.
- Best fit
- New clips when the agent can describe the subject, setting, movement, and intended use.
- Check first
- The model has no visual anchor, so include concrete composition and motion direction in the prompt.
Live schema
anycap video models <model-id> schema --operation generate --mode text-to-videoGenerate
anycap video generate --model <model-id> --mode text-to-video --prompt "a short product walkthrough" -o product-walkthrough.mp4image-to-video
Source image to video
Animate a still image while keeping its subject and composition as the starting point.
- Best fit
- Mockups, product frames, key art, or other approved visuals that need controlled motion.
- Check first
- Pass the local image only when the selected mode's schema declares the images field.
Live schema
anycap video models <model-id> schema --operation generate --mode image-to-videoUse this local-media parameter only when the returned schema declares it: images
Generate
anycap video generate --model <model-id> --mode image-to-video --prompt "animate this still with subtle camera movement" --param images=./source.png -o animated-source.mp4edit-video
Existing footage to edited video
Transform a source clip while preserving the useful subject and camera continuity.
- Best fit
- Prompt-directed revisions such as lighting, atmosphere, or visual treatment changes.
- Check first
- This path appears only while the live catalog has an edit-video model, and its schema must declare the videos field.
Live schema
anycap video models <edit-model-id> schema --operation generate --mode edit-videoUse this local-media parameter only when the returned schema declares it: videos
Generate
anycap video generate --model <edit-model-id> --mode edit-video --prompt "brighten the scene while preserving the subject and camera motion" --param videos=./source.mp4 -o edited-source.mp4Install the AnyCap skill
Install the AnyCap skill for the agent that will run the workflow. The target-specific command gives that agent durable instructions for choosing a mode, checking the schema, and invoking the CLI.
Install the skill for your agent
Choose the command that matches the agent running the workflow. The skill supplies operating instructions; the CLI performs the generation.
| Agent | Skill command |
|---|---|
| Claude Code | npx -y skills add anycap-ai/anycap -a claude-code -y |
| Cursor | npx -y skills add anycap-ai/anycap -a cursor -y |
| Codex | npx -y skills add anycap-ai/anycap -a codex -y |
Install the AnyCap CLI
curl -fsSL https://anycap.ai/install.sh | shnpm install -g @anycap/cliInstall the AnyCap CLI with the shell installer. The npm command is an alternative; Node.js is required for that package route and for the skills installer, not for the standalone CLI binary.
Log in
anycap loginRun one login command. The CLI chooses a browser or device flow for the current environment, so the same setup works locally and on a remote shell.
Discover available video models
anycap video modelsList the live video catalog before choosing a model. Match the requested source path to a mode the selected model currently exposes.
Inspect the live model schema
Inspect the selected model's generate schema for the chosen mode. Add a local image or video parameter only when that schema declares the corresponding field.
Generate your first video
Run the generation command for the chosen source path. The CLI waits for server-side completion, downloads the file, and prints a flat JSON result when the command completes.
Use video generation in agent workflows
The agent can now translate a brief into a source decision, select a compatible model, validate its schema, run generation, and carry the downloaded file into review or publishing.
Representative completed result
credits_used: 20 is illustrative. Actual credits vary by model, duration, and output settings.
Flat JSON output
{
"status": "success",
"local_path": "/workspace/product-walkthrough.mp4",
"model": "<model-id>",
"credits_used": 20,
"request_id": "req_abc123"
}Treat the shown result as representative: the real response can include additional fields, and the absolute local path depends on the directory where the command runs.
Continue the agent workflow
Use these focused pages after the end-to-end setup when you need Codex guidance, generation details, or video review.
Where video generation helps most
Product demos
Turn release notes or a feature summary into a short product demo video that an agent can generate as part of launch preparation.
Marketing experiments
Ask the agent for short variations of an ad concept, hero animation, or social teaser without leaving the terminal workflow.
Design handoff
Animate a static mockup into a walkthrough so teams can review motion and narrative earlier in the design cycle.
How to get better video outputs
Prompt quality matters because a video model must infer shot composition, movement, duration, and visual continuity. A short vague prompt can work, but a structured prompt is usually more repeatable.
Describe the subject, camera movement, scene, lighting, tone, and intended duration. When an approved visual already exists, choose image-to-video so the source frame anchors the composition.
Ask the agent to draft the prompt first, review it, and then run the matching schema and generation commands. This keeps creative approval separate from execution without breaking the workflow.
Common setup and workflow mistakes
Skipping model discovery
Models expose different modes and tradeoffs. Run anycap video models before choosing one instead of hardcoding the same model for every request.
Using underspecified prompts
A request such as 'make a product video' is too broad. Add scene context, pacing, camera direction, and intended use before generation.
Assuming every source uses the same schema
Local images and videos are schema-driven parameters. Inspect the selected mode and add images or videos only when that live schema declares the field.
FAQ
Which video mode should an agent choose?
Use text-to-video for a written brief, image-to-video when a still should anchor the clip, and edit-video for existing footage when that mode is present in the live catalog.
Can the commands use local images and videos?
Yes, when the selected mode's live schema declares the matching images or videos field. Check the schema before adding the local path parameter.
Does the generation command return before the video is ready?
No. The CLI waits for server-side completion, downloads the output, and prints the result when the command finishes.
Is every video generation charged 20 credits?
No. The example value is illustrative; actual usage varies with the selected model, duration, and output settings.