> Documentation
Everything you need to know about the agent-media CLI and platform. Install, generate, and manage AI media from your terminal.
# Getting Started
Install the CLI
Install agent-media globally via npm.
npm install -g agent-media-cli
Authenticate
Log in with your account. This opens your browser for a one-time password (OTP) verification.
agent-media login
Your first generation
Generate a video with a single command. The --sync flag waits for the result and returns the download URL.
agent-media generate kling3 -p "robot dancing" --sync
Check your credits
View your remaining credit balance and current plan.
agent-media credits
# Commands Reference
agent-media ships with 22 commands organized into five categories. All commands support --help for detailed usage information.
Account
| Command | Description | Key Flags |
|---|---|---|
| login | Authenticate via browser OTP | --device |
| logout | Clear local session | - |
| whoami | Show current user info | - |
| credits | Display credit balance and usage | --json |
| plan | Show current subscription plan | - |
| config | View or set CLI configuration | --set, --get, --reset |
| profile | Display user profile details | --json |
Jobs
| Command | Description | Key Flags |
|---|---|---|
| generate | Create a new generation job | -p, --sync, --input, --duration |
| status | Check status of a job | <job-id> |
| list | List recent generation jobs | --limit, --status, --json |
| inspect | Show full job details | <job-id>, --json |
| download | Download generated media | <job-id>, --output |
| cancel | Cancel a pending/running job | <job-id> |
| retry | Retry a failed job | <job-id> |
| delete | Delete a job from history | <job-id>, --force |
Models & Info
| Command | Description | Key Flags |
|---|---|---|
| models | List all available models | --json |
| pricing | Show model credit costs | --json |
| text | Generate text descriptions | -p |
Billing
| Command | Description | Key Flags |
|---|---|---|
| subscribe | Subscribe to a plan or buy credits (waits for confirmation) | --plan, --credits, --manage |
| apikey | Manage API keys | list, create, revoke |
| usage | View usage analytics | --period, --json |
System
| Command | Description | Key Flags |
|---|---|---|
| doctor | Run diagnostic checks | - |
| version | Print CLI version | - |
# Models
agent-media provides access to the following AI generation models. Use the slug when specifying a model in the CLI.
| Model | Slug | Type | Duration | Resolution |
|---|---|---|---|---|
| Kling 3.0 Pro | kling3 | Video | 5-10s | 1080p |
| Veo 3.1 | veo3 | Video | 4-8s | 4K |
| Sora 2 Pro | sora2 | Video | 4-25s | 1080p |
| Seedance 1.0 Pro | seedance1 | Video | 2-12s | 1080p |
| Flux 2 Pro | flux2-pro | Image | - | 2K |
| Flux 2 Flex | flux2-flex | Image | - | 2K |
| Grok Imagine | grok-image | Image | - | 2K |
Run agent-media models for the latest list and agent-media pricing for credit costs per model.
# Generation
Basic generation
Provide a model slug and a prompt with the -p flag.
agent-media generate <model> -p "your prompt here"
Synchronous mode
Add --sync to wait for the job to complete and receive the download URL directly in your terminal.
agent-media generate kling3 -p "ocean waves at sunset" --sync
Image-to-video
Use --input to provide a reference image for image-to-video generation.
agent-media generate seedance1 -p "camera zoom out" --input photo.jpg --sync
Generation options
Fine-tune your generation with additional flags.
| Flag | Description | Example |
|---|---|---|
| --duration | Video duration in seconds | --duration 5 |
| --resolution | Output resolution | --resolution 720p |
| --aspect-ratio | Aspect ratio for output | --aspect-ratio 16:9 |
| --seed | Seed for reproducible results | --seed 42 |
| --input | Reference image path | --input ref.jpg |
| --sync | Wait for completion | --sync |
Examples
Video generation
agent-media generate kling3 -p "cinematic drone shot of a forest" --duration 5 --sync
Video with custom duration
agent-media generate sora2 -p "timelapse of city traffic" --duration 10 --sync
Image generation
agent-media generate flux2-pro -p "portrait of a cyberpunk samurai" --sync
Image-to-video
agent-media generate seedance1 -p "slow pan right" --input landscape.jpg --sync
# Plans & Credits
agent-media uses a credit-based system. Each generation costs a certain number of credits depending on the model and output settings. Choose a plan that fits your workflow.
| Plan | Price | Credits | Max Resolution | Concurrent Jobs | Extras |
|---|---|---|---|---|---|
| Newby | $19/mo | 1,000 | 1080p | 2 | - |
| Starter | $39/mo | 2,500 | 1080p | 3 | - |
| Creator | $69/mo | 5,000 | 2K | 5 | Priority queue |
| Pro Plus | $119/mo | 15,000 | 2K | 10 | API access |
Monthly credits reset each billing cycle. Additional credit packs available via the CLI.
# API Keys
API keys allow you to authenticate in scripts, CI/CD pipelines, and automated workflows without an interactive login session. Available on the Pro Plus plan.
List your keys
agent-media apikey list
Create a new key
agent-media apikey create --name "my-key"
Revoke a key
agent-media apikey revoke <key-id>
Use in scripts
Set the AGENT_MEDIA_API_KEY environment variable to authenticate without interactive login.
AGENT_MEDIA_API_KEY=ma_xxx agent-media generate kling3 -p "automated render" --sync
# Gallery & Dashboard
The web dashboard at agent-media.ai/gallery provides a visual interface for managing your generations and account.
Gallery
Browse all your completed generations. Preview videos and images, download files, and delete jobs you no longer need.
Billing
Manage your subscription, view credit balance, transaction history, and access the Stripe Customer Portal.
Settings
Update your profile, manage API keys, and configure account preferences.
# Claude Code Integration
agent-media works as a skill inside Claude Code. Once installed, you can ask Claude to generate videos and images directly from your coding session.
Install the skill
Copy the SKILL.md file from the agent-media-skill repo into your project:
mkdir -p .claude/skills cp SKILL.md .claude/skills/agent-media.md
What you can do
Once the skill is active, talk to Claude naturally:
How it works
The skill gives Claude full knowledge of every agent-media command, model, and flag. Claude picks the right model for your request, checks your credits, runs the generation, and presents the result — all within your coding session.
# MCP Server
agent-media provides a Model Context Protocol (MCP) server that exposes all generation capabilities as tools. Any MCP-compatible client (Claude Code, Claude Desktop, etc.) can use it directly.
Quick setup
Add the MCP server to your Claude Code configuration:
// .claude/settings.json or ~/.claude/settings.json
{
"mcpServers": {
"agent-media": {
"command": "npx",
"args": ["agent-media-mcp"]
}
}
}Available tools
The MCP server exposes 9 tools:
| Tool | Description |
|---|---|
| generate | Submit a video or image generation job |
| models | List available models with pricing |
| credits | Check credit balance and usage |
| status | Check job status by ID |
| list_jobs | List recent generation jobs |
| download | Download completed output |
| pricing | Show model credit costs |
| cancel | Cancel a job and refund credits |
| whoami | Current user and plan info |
How it works
The MCP server runs as a stdio process and shells out to the agent-media CLI with the --json flag. It reuses the CLI's authentication, caching, and error handling — no separate configuration needed.