Developer

Integrations

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 .../v1/generate/ugc_video \
  -H "Authorization: Bearer ma_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"script": "Your script here...", "actor_slug": "sofia", "tone": "energetic"}'

TypeScript SDK

Typed client with createVideo() that polls until complete. Works in Node.js and Edge runtimes.

npm install @agentmedia/sdk
import { AgentMedia } from '@agentmedia/sdk';

const client = new AgentMedia({ apiKey: 'ma_YOUR_KEY' });
const video = await client.createVideo({
  script: 'Your script here...',
  actor_slug: 'sofia',
  tone: 'energetic',
});
console.log(video.video_url);

Python SDK

Sync and async clients. Works with FastAPI, Django, Flask, or standalone scripts.

pip install agent-media
from agent_media import AgentMedia

client = AgentMedia(api_key="ma_YOUR_KEY")
video = client.create_video(
    script="Your script here...",
    actor_slug="sofia",
    tone="energetic",
)
print(video["video_url"])

CLI

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

npm install -g agent-media-cli
agent-media ugc "Stop scrolling. This tool changed everything." \
  --actor sofia --style hormozi --duration 10 --sync

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" }
    }
  }
}

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

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": "..." }

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.