Skip to content

TypeScript SDK

Official typed client: generate, poll, publish, verify webhooks.

Install

npm install @reeloop/sdk

Quickstart

import { ReeloopClient } from "@reeloop/sdk";

const reeloop = new ReeloopClient(process.env.REELOOP_API_KEY!);

const { jobId } = await reeloop.generate({ topic: "5 facts about the ocean nobody knows", style: "documentary", voice: "charlotte", duration: "30", mode: "instant", // charge + render now; "director" (the default) is a free draft });

const done = await reeloop.waitForCompletion(jobId); console.log(done.finalVideoUrl); ```

What the SDK handles for you

  • Idempotency - every generate() sends a fresh Idempotency-Key, so a network retry replays the original response instead of double-charging. Pass your own key to dedupe across calls.
  • Correct completion detection - waitForCompletion() checks renderStatus/finalVideoUrl (a job can read status: "completed" with a FAILED, refunded render) and rejects on failure.
  • Typed errors - ReeloopApiError exposes status, the API's code, rate-limit headers, and a retryable flag.
  • Webhook verification - verifyWebhookSignature(rawBody, signatureHeader, secret) validates X-Reeloop-Signature (HMAC-SHA256, constant-time) and returns the parsed payload.
import { verifyWebhookSignature } from "@reeloop/sdk";

const payload = verifyWebhookSignature(rawBody, headers["x-reeloop-signature"], secret); if (!payload) return new Response("bad signature", { status: 401 }); ```

Sandbox

Use an fl_test_ key (see the Sandbox doc) to develop without spending credits - the SDK works identically against test keys.

Python

A Python client (reeloop-sdk, packages/reeloop-sdk-py in the repo) mirrors this SDK's method surface field-for-field. Not yet published to PyPI - install from source:

pip install "reeloop-sdk @ git+https://github.com/theodorosmd/postai.git#subdirectory=packages/reeloop-sdk-py"
from reeloop_sdk import ReeloopClient

reeloop = ReeloopClient(api_key) job = reeloop.generate(topic="5 facts about the ocean nobody knows", mode="instant") done = reeloop.wait_for_completion(job["jobId"]) ```

Start building

Create an API key in Settings → API.

Start for free

1 free video · no credit card