# Reelamo

> Reelamo turns a one-sentence brief (plus optional photos or clips) into finished social media video ads with voiceover, word-by-word captions and music, in 9:16, 1:1 and 16:9. Use the REST API from a backend (Base44 backend functions, serverless functions, your own server) or connect an AI assistant through MCP.

- Website: https://reelamo.com
- Interactive API reference (OpenAPI): https://reelamo.com/docs and https://reelamo.com/openapi.json
- Get an API key: sign up at https://reelamo.com/signup, then in the app go to **API and webhooks** → Create key. Keys look like `rl_live_…`. Keep them server-side; never put a key in browser code.

## Authentication

Send `Authorization: Bearer rl_live_…` on every request. Errors are JSON: `{"detail": "..."}` or, for invalid input, `{"detail": {"message": "Invalid input", "errors": [{"field": "...", "message": "..."}]}}`.

## Make a video ad (the 2-call flow)

1. `POST https://reelamo.com/v1/jobs` (JSON):

```json
{
  "prompt": "Summer sale: 30% off all sunglasses this week. Shop online.",
  "media_urls": ["https://example.com/sunglasses.jpg"],
  "formats": ["9x16", "1x1", "16x9"],
  "duration": 15,
  "language": "en",
  "webhook_url": "https://your-app.example/hooks/reelamo"
}
```

   Only `prompt` is required. Optional: `media_urls` (up to 10 public image/video URLs), `formats` (`9x16`, `1x1`, `16x9`, `4x5`; default the first three, add `4x5` (1080x1350) for the Facebook/Instagram feed), `duration` (6-60 s, default 15), `language` (`en`, `nl`, `de`, …; default from the brief), `brand_id` (from `GET /v1/brands`), `template` (`auto`, `bold`, `clean`, `kinetic`, `ugc`, `neon`, `playful`, `retro`, `news`), `voice`, `music` (`auto`/`none`), `captions` (true/false), `metadata` (your own JSON, returned later), `webhook_url`.
   Send an `Idempotency-Key` header (e.g. your order id) so a retried request never creates a second ad.
   Response `202`: `{"job_id": "job_…", "status": "queued", "status_url": "…"}`.

2. Get the result, either way:
   - **Poll** `GET https://reelamo.com/v1/jobs/{job_id}` every 5-10 s until `status` is `done` or `failed` (usually 40-90 s).
   - **Webhook**: Reelamo POSTs the same job object to `webhook_url` when the ad is done or failed (retries after 10 s, 1 min, 5 min, 30 min).

When `status` is `done`, the job contains:

```json
{
  "job_id": "job_…",
  "status": "done",
  "outputs": {"9x16": "https://…/9x16.mp4?exp=…&sig=…", "1x1": "…", "16x9": "…"},
  "thumbnails": {"9x16": "https://…jpg", "1x1": "…", "16x9": "…"},
  "captions": {"srt": "…", "vtt": "…"},
  "export_zip": "…",
  "expires_at": 1793000000
}
```

The MP4 links are signed and work without an API key until `expires_at` (7 days); files are deleted after that, so download and store them if you need them longer. `status` values: `queued`, `downloading`, `analyzing`, `scripting`, `voicing`, `timing`, `rendering`, `draft` (storyboard only), `done`, `failed` (then `error` explains why; failed ads are free).

## Webhook signature

Header `X-Reelamo-Signature: t=<unix time>,v1=<hex>`. Compute HMAC-SHA256 over `"<t>." + raw request body` with your webhook secret (app → API and webhooks → Show secret) and compare with `v1` in constant time; reject if `t` is older than 5 minutes. Header `X-Reelamo-Event` is `job.done` or `job.failed`; the body is `{"event": "...", "delivery_id": "...", "job": {…}}`.

## Other useful endpoints

- `GET /v1/options`: formats, templates, voices, limits
- `GET /v1/brands`, `POST /v1/brands/from-url` (`{"url": "https://yourshop.example"}` fills name, logo, colors and site images)
- `GET /v1/jobs`: recent ads; `DELETE /v1/jobs/{id}`
- `POST /v1/jobs` with `"draft": true`: storyboard only (free); render it later with `POST /v1/jobs/{id}/render`
- `POST /v1/jobs/{id}/rerender` with a changed `script`: new version of an ad (free)

## Limits and billing

Each rendered ad uses one ad from the account's plan (ads over 30 s use two); storyboards, revisions and failed ads are free. Rate limit: 300 requests per minute per key (HTTP 429 when exceeded). Concurrent ads in progress depend on the plan.

## Use from an AI assistant (MCP)

Reelamo is an MCP server at `https://reelamo.com/mcp` (Streamable HTTP). Tools: `create_video_ad`, `get_video_ad`, `list_video_ads`, `list_brands`. Sign in with OAuth or with an API key as bearer token.

Claude (claude.ai, Claude Desktop), ChatGPT and other apps with custom connectors: add `https://reelamo.com/mcp` as a custom connector. The app opens Reelamo, where the user signs in, picks a workspace and approves; no key needed. The connection counts towards that workspace's plan like an API key and can be disconnected under API and webhooks. OAuth 2.1 details: protected resource metadata at `https://reelamo.com/.well-known/oauth-protected-resource/mcp`, authorization server metadata at `https://reelamo.com/.well-known/oauth-authorization-server`, dynamic client registration at `https://reelamo.com/oauth/register`, authorization code flow with PKCE (S256), access tokens valid for 1 hour with rotating refresh tokens. OAuth tokens only work on `/mcp`, not on the REST API.

Claude Code:

```bash
claude mcp add --transport http reelamo https://reelamo.com/mcp --header "Authorization: Bearer rl_live_…"
```

Other MCP clients: server URL `https://reelamo.com/mcp`, with OAuth or the header `Authorization: Bearer rl_live_…`. A tool call waits at most 45 s; while the ad is still rendering, call `get_video_ad` with `wait_seconds: 45` again.

## Base44

Call the API from a Base44 backend function (store the key as a secret), pass Base44 `UploadFile` URLs as `media_urls`, and receive the result through a webhook function or by polling. Ready-made functions: createVideoAd, videoAdStatus, videoAdWebhook, rerenderVideoAd.