# Reelpipe Documentation Base URL: `https://reelpipe.dev/api/v1` OpenAPI 3.1 spec: `https://reelpipe.dev/openapi.json` --- ## 1. Quick start 1. Create an account and generate a test (`rk_test_...`) or live (`rk_live_...`) API key from the dashboard. 2. POST a scene array to `https://reelpipe.dev/api/v1/renders`: ```bash curl -X POST https://reelpipe.dev/api/v1/renders \ -H "Authorization: Bearer rk_test_YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{ "format": "16:9", "resolution": "720p", "preset": "documentary", "scenes": [ { "type": "image", "src": "https://reelpipe.dev/samples/alpine-ridge.jpg", "duration": 5, "motion": "zoom-in", "subtitle": "Hello from Reelpipe." } ], "subtitles": { "enabled": true } }' ``` 3. Poll `GET https://reelpipe.dev/api/v1/renders/{id}` until `status` is `done` (or configure a webhook URL for `render.done`, `render.failed`, and `render.canceled`). --- ## 2. Authentication Pass your API key in the `Authorization` header: ``` Authorization: Bearer rk_live_... ``` - Key format: `rk_live_` or `rk_test_` followed by 32 alphanumeric characters (40 characters total). - Only the 12-character prefix and SHA-256 hash are stored; the raw key is displayed once on creation. - **Live keys (`rk_live_`)**: reserve estimated seconds on creation and consume `ceil(duration_seconds)` on success. Failed or canceled queued renders release the reservation in full. - **Test keys (`rk_test_`)**: free (never touch credit balance), forced to `480p` with a watermark, capped at `120` seconds per video across every plan, and limited to `20` test renders per user per UTC day (returns `429 rate_limited` with `Retry-After`). --- ## 3. Renders API ### Endpoints - `POST https://reelpipe.dev/api/v1/renders` — Queue a render. Optional `Idempotency-Key` header (<= 255 chars; replays return `200` with the existing render). Returns `201` `{ id, status, estimated_seconds, created_at }`. - `GET https://reelpipe.dev/api/v1/renders/{id}` — Inspect a single render owned by the authenticated user. Returns `404 not_found` otherwise. While within plan retention (7 or 30 days), `output_url` is a fresh 1-hour presigned download URL generated per request. Once purged, `output_url` is `null` and `output_expired` is `true`. - `GET https://reelpipe.dev/api/v1/renders?limit=20&cursor=` — Cursor-paginated list of renders, newest first (`limit` 1–100, default 20). Returns `{ data: Render[], next_cursor: string | null }`. - `DELETE https://reelpipe.dev/api/v1/renders/{id}` — Cancel a render while its status is `queued`. Returns `200 { id, status: "canceled" }` or `409 cannot_cancel` if already picked up or finished. - `POST https://reelpipe.dev/api/v1/renders/validate` — Dry run returning `200 { valid, errors, estimated_seconds, estimated_cost_minutes }` without queuing a job or reserving credits. ### Status lifecycle `queued` -> `downloading` -> `rendering` -> `uploading` -> `done` | `failed` | `canceled`. ### Top-level render payload fields - `format` (required): `"16:9"` | `"9:16"` | `"1:1"` - `resolution` (optional, default `"720p"`): `"720p"` | `"1080p"` (Free allows `720p` only; test keys force `480p`) - `fps` (optional, default `30`): `24` | `25` | `30` - `preset` (optional, default `"none"`): `"documentary"` | `"short"` | `"none"` - `scenes` (required): 1 to 1,000 scene objects - `music` (optional): `{ src: httpsUrl, volume?: 0..1, ducking?: boolean }` - `subtitles` (optional): `{ enabled: boolean, style?: string (<= 64 chars) }` - `webhook_url` (optional): HTTPS URL (SSRF-checked) - `metadata` (optional): JSON object <= 4 KB UTF-8 --- ## 4. Scenes guide Each entry in `scenes` has: - `type` (required): `"image"` or `"video"` - `src` (required): HTTPS URL to image or video file - `voice` (optional): HTTPS URL to voice-over audio track - `duration` (optional): `0.5`–`600` seconds. At render time, omitted duration defaults to voice-over length + `0.3s`, or `5s` without voice. During API validation/credit reservation, scenes without `duration` are estimated at `8s` (actual billing always uses the finished MP4 duration). - `subtitle` (optional): string <= 500 characters (Unicode supported) - `motion` (optional): `"zoom-in"` | `"zoom-out"` | `"pan-left"` | `"pan-right"` | `"none"` - `fit` (optional, for video clips): `"loop"` | `"slow"` | `"freeze"` | `"cut"` - `transition` (optional): `"none"` | `"fade"` | `"crossfade"` Presets: `documentary` (smooth Ken Burns pacing for 16:9 narration), `short` (snappy pacing for 9:16 vertical clips), `none` (explicit control per scene). --- ## 5. Webhooks (Standard Webhooks) Events: `render.done`, `render.failed`, `render.canceled`. Payload shape: ```json { "type": "render.done", "data": { "id": "uuid", "status": "done", "output_url": "https://...", "duration_seconds": 12.4, "billed_seconds": 13, "error": null, "metadata": {}, "created_at": "2026-11-26T10:30:00.000Z", "finished_at": "2026-11-26T10:30:18.000Z" } } ``` Headers: - `webhook-id`: delivery UUID - `webhook-timestamp`: Unix epoch seconds - `webhook-signature`: `v1,` - `Content-Type: application/json` Delivery & retries: 10 s timeout, any 2xx marks delivered. Failed deliveries retry 5 times after the initial attempt: 1 min, 5 min, 30 min, 2 h, 12 h. Secret rotation: rotate your `whsec_...` signing secret anytime in Dashboard -> Webhooks. --- ## 6. Errors & limits Error envelope: `{ "error": { "code": "...", "message": "...", "field"?: "..." } }`. HTTP error codes: - `400 invalid_payload`: schema error, invalid URL, or plan/test duration/resolution cap exceeded - `401 invalid_api_key`: missing, malformed, or revoked key - `402 insufficient_credits`: live balance below `estimated_seconds` - `404 not_found`: render does not exist or belongs to another account - `409 cannot_cancel`: render is no longer `queued` - `413 too_large`: request body exceeds 1 MB - `422 media_unreachable` / `media_invalid`: source media cannot be fetched or decoded - `429 rate_limited`: exceeded 60 requests/min/key or 20 test renders/UTC day - `500 internal`: unexpected server error Async render failure codes: `too_long` (actual duration > 120 s on free/test), `worker_lost` (worker stopped heartbeating after automatic requeue retries; credits released), `media_unreachable`, `media_invalid`. Rate limits: 60 requests per minute per API key on all `/api/v1/*` endpoints except `/health`. Headers returned on responses: `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`, and `Retry-After` on `429`. Plan limits: - Free: 20 min/mo (refreshes monthly on signup anniversary up to 20 min, non-cumulative), 720p, watermark, max 2 min/video, up to 1 concurrent job, 7-day retention - Starter ($19): 300 min/mo, 1080p, no watermark, max 120 min/video, up to 1 concurrent job, 7-day retention - Pro ($49): 1,000 min/mo, 1080p, no watermark, max 120 min/video, up to 2 concurrent jobs, 30-day retention, queue priority - Scale ($149): 4,000 min/mo, 1080p, no watermark, max 120 min/video, up to 4 concurrent jobs, 30-day retention, highest queue priority Billing & top-ups: live renders stop at zero balance (`402 insufficient_credits`). Extra minutes are available as $10 / 100-minute packs (valid 12 months) and optional auto top-up on the Billing page (off by default; automatically buys one $10 / 100-minute pack when balance drops below 10 minutes). Payload limits: max 1 MB request body, max 4 KB metadata JSON, max 1,000 scenes, max 500 chars per scene subtitle. Output storage & retention: rendered videos are stored in the EU (Amsterdam) in private object storage, served via fresh 1-hour presigned URLs while within retention, and purged automatically after 7 days (Free/Starter) or 30 days (Pro/Scale), setting `output_url` to `null` and `output_expired` to `true`. --- ## 7. Usage API - `GET https://reelpipe.dev/api/v1/usage` returns `{ plan, balance_seconds, balance_minutes, consumed_seconds, renders_this_month }`. - `GET https://reelpipe.dev/api/v1/health` returns `{ status: "ok" }` (public, no auth).