Integrations, API, SDK, CLI, MCP Server

Every way to generate AI videos from your code. REST API, TypeScript & Python SDKs, CLI, MCP server for AI agents, OpenAPI spec, and webhooks.

REST API

Full programmatic access. Submit generation jobs, poll status, list actors. OpenAPI 3.1 spec included.

curl -X POST .../v2/generate/video \
  -H "Authorization: Bearer ma_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "Your script here...", "seconds": 5, "aspect": "9:16"}'

Interactive Docs · OpenAPI Spec

TypeScript SDK

Typed client for models, jobs, and actors. Works in Node.js and Edge runtimes. For video generation, call the REST API directly.

npm install @agentmedia/sdk
curl -X POST .../v2/generate/video \
  -H "Authorization: Bearer ma_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "Your script here...", "seconds": 5, "aspect": "9:16"}'

npm

Python SDK

Sync and async clients. Works with FastAPI, Django, Flask, or standalone scripts. For video generation, call the REST API directly.

pip install agent-media
curl -X POST .../v2/generate/video \
  -H "Authorization: Bearer ma_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "Your script here...", "seconds": 5, "aspect": "9:16"}'

PyPI

CLI

Generate videos from your terminal. Pipe scripts, integrate with shell workflows, automate with cron.

npm install -g agent-media-cli
agent-media selfie \
  --description "woman in her late 20s, warm and natural, kitchen morning light" \
  --script "Stop scrolling. This tool changed everything." \
  --duration 10

agent-media status <job-id> --watch

npm · CLI Docs

MCP Server

Use agent-media from Claude Code, Cursor, or Windsurf. Three tools: create_video, list_actors, get_video_status.

// Add to ~/.claude/settings.json
{
  "mcpServers": {
    "agent-media": {
      "command": "npx",
      "args": ["-y", "@agentmedia/mcp-server"],
      "env": { "AGENT_MEDIA_API_KEY": "ma_YOUR_KEY" }
    }
  }
}

npm · MCP Registry

OpenAPI Spec

Auto-generate SDKs in any language, import into Postman or Insomnia, build custom integrations.

# Download the spec
curl https://agent-media.ai/openapi.json -o openapi.json

# Generate a Go client
npx @openapitools/openapi-generator-cli generate \
  -i openapi.json -g go -o ./go-client

# Import into Postman: File > Import > paste the URL

Download Spec · Interactive Docs

Webhooks

Get notified when videos complete. No polling. HTTPS only, 3x retry with exponential backoff.

// Pass webhook_url when generating:
{ "script": "...", "webhook_url": "https://your-app.com/api/video-ready" }

// We POST when done:
{ "job_id": "uuid", "status": "completed", "video_url": "https://...mp4" }

// Or on failure:
{ "job_id": "uuid", "status": "failed", "error_message": "..." }

Webhook Docs

Build Your Own Integration

Our OpenAPI spec lets you auto-generate an SDK in any language. Download the spec and use openapi-generator to create a client for Go, Ruby, PHP, Java, or anything else.