> 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

CommandDescription
loginAuthenticate via browser OTP
logoutClear local session
whoamiShow current user info
creditsDisplay credit balance and usage
planShow current subscription plan
configView or set CLI configuration
profileDisplay user profile details

Jobs

CommandDescription
generateCreate a new generation job
statusCheck status of a job
listList recent generation jobs
inspectShow full job details
downloadDownload generated media
cancelCancel a pending/running job
retryRetry a failed job
deleteDelete a job from history

Models & Info

CommandDescription
modelsList all available models
pricingShow model credit costs
textGenerate text descriptions

Billing

CommandDescription
subscribeSubscribe to a plan or buy credits (waits for confirmation)
apikeyManage API keys
usageView usage analytics

System

CommandDescription
doctorRun diagnostic checks
versionPrint CLI version

# Models

agent-media provides access to the following AI generation models. Use the slug when specifying a model in the CLI.

ModelSlugType
Kling 3.0 Prokling3Video
Veo 3.1veo3Video
Sora 2 Prosora2Video
Seedance 1.0 Proseedance1Video
Flux 2 Proflux2-proImage
Flux 2 Flexflux2-flexImage
Grok Imaginegrok-imageImage

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.

FlagDescription
--durationVideo duration in seconds
--resolutionOutput resolution
--aspect-ratioAspect ratio for output
--seedSeed for reproducible results
--inputReference image path
--syncWait for completion

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.

PlanPriceCredits
Newby$19/mo1,000
Starter$39/mo2,500
Creator$69/mo5,000
Pro Plus$119/mo15,000

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:

"Generate a video of a robot walking through a neon city"
"Create a cyberpunk portrait image with Flux 2 Pro"
"Show me my credit balance and recent jobs"
"Generate 3 variations of a sunset timelapse"
"Animate this image with Seedance"

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:

ToolDescription
generateSubmit a video or image generation job
modelsList available models with pricing
creditsCheck credit balance and usage
statusCheck job status by ID
list_jobsList recent generation jobs
downloadDownload completed output
pricingShow model credit costs
cancelCancel a job and refund credits
whoamiCurrent 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.