API Reference
Generate UGC videos, list actors, and check job status via REST API.
Getting Started
Zero to first video in 5 minutes.
1. Get an API Key
Create one in your dashboard settings. Starts with ma_.
2. List Actors
curl https://api-v2-production-2f24.up.railway.app/v1/actors?limit=5 \
-H "Authorization: Bearer ma_YOUR_KEY"3. Generate a Video
curl -X POST https://api-v2-production-2f24.up.railway.app/v1/generate/ugc_video \
-H "Authorization: Bearer ma_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"script": "Have you ever struggled with creating video content? This tool changed everything.",
"actor_slug": "sofia",
"tone": "energetic",
"style": "hormozi",
"target_duration": 10
}'4. Poll for Status
curl https://api-v2-production-2f24.up.railway.app/v1/videos/{job_id} \
-H "Authorization: Bearer ma_YOUR_KEY"
# When status: "completed", video_url has your MP4.Authentication
All endpoints require a Bearer token. API keys (ma_ prefix) or Supabase JWTs.
Authorization: Bearer ma_YOUR_API_KEYPOST
/v1/generate/ugc_videoGenerate a UGC-style video from a script or prompt.
Parameters
| Name | Type | Description |
|---|---|---|
| script | string | Narration script (50-3000 chars). Required if no prompt. |
| prompt | string | AI generates script from this. Required if no script. |
| actor_slug | string | AI actor slug. Use GET /v1/actors to browse. |
| tone | enum | energetic, calm, confident, dramatic |
| style | string | Subtitle style (17 options). Default: hormozi |
| target_duration | number | 5, 10, or 15 seconds |
| music | enum | chill, energetic, corporate, dramatic, upbeat |
| aspect_ratio | enum | 9:16, 16:9, 1:1 |
| allow_broll | boolean | Enable B-roll cutaway scenes |
| broll_images | string[] | Image URLs for B-roll (max 10) |
| webhook_url | string | HTTPS URL for completion callback |
| cta | string | End screen CTA (max 100 chars) |
GET
/v1/actorsList available AI actors. Paginated with limit/offset.
# Response: { actors: [...], total: 200, limit: 50, offset: 0 }GET
/v1/videos/{jobId}Poll job status. Returns video_url when completed.
{ "job_id": "uuid", "status": "completed", "video_url": "https://...mp4" }Webhooks
Pass webhook_url to receive a POST when the job finishes.
# Completed: { "job_id": "uuid", "status": "completed", "video_url": "https://...mp4" }
# Failed: { "job_id": "uuid", "status": "failed", "error_message": "..." }HTTPS only. 3 retries, exponential backoff. Test with webhook.site.
SDKs
TypeScript
import { AgentMedia } from '@agent-media/sdk';
const client = new AgentMedia({ apiKey: 'ma_xxx' });
const video = await client.createVideo({ script: '...', actor_slug: 'sofia' });
console.log(video.video_url);Python
from agent_media import AgentMedia
client = AgentMedia(api_key="ma_xxx")
video = client.create_video(script="...", actor_slug="sofia")
print(video["video_url"])Interactive API Explorer
Try endpoints below. Enter your API key in the auth field.