SDKs
The official TypeScript and Python SDKs for the Reeltopus API: typed models, multipart uploads, wait helpers, retries with idempotency keys and webhook verification.
Both SDKs are generated from the OpenAPI document and tested against a mock of it, so every endpoint has a typed method. Both are MIT licensed.
TypeScript and JavaScript
npm install @reeltopus/sdkESM, no runtime dependencies, Node 20+, Deno, Bun, Cloudflare Workers and Vercel Edge.
import { Reeltopus } from "@reeltopus/sdk";
const reeltopus = new Reeltopus(); // reads REELTOPUS_API_KEY
const project = await reeltopus.uploads.uploadFile("./episode-12.mp4");
await reeltopus.projects.waitUntilReady(project.id);
const { data: clips } = await reeltopus.projects.clips(project.id);
const exported = await reeltopus.clips.exportAndWait(clips[0].id, { resolution: "1080p" });
console.log(exported.files.mp4?.url);Python
pip install reeltopusPython 3.9+, on httpx. Reeltopus for sync code and AsyncReeltopus for asyncio, with the same methods. Every request and response is a typed dict, and the package ships py.typed.
from reeltopus import Reeltopus
client = Reeltopus() # reads REELTOPUS_API_KEY
project = client.uploads.upload_file("episode-12.mp4")
client.projects.wait_until_ready(project["id"])
clips = client.projects.clips(project["id"])["data"]
exported = client.clips.export_and_wait(clips[0]["id"], {"resolution": "1080p"})
print(exported["files"]["mp4"]["url"])What the SDKs do for you
- Uploads: files go straight to storage in parallel parts, each retried on its own; expired part URLs are re-signed; progress callbacks.
- Waiting:
waitUntilReady,waitForExport,exportAndWaitandwaitUntilPublishedpoll for you and raise a clear error with the reason when a job fails. - Retries: network errors, timeouts, 429 and 5xx are retried, waiting for Retry-After. Every write carries an Idempotency-Key that stays the same across retries, so a retry never creates a second project, export or post.
- Errors: one class per status (
InsufficientHoursError,RateLimitError,PermissionDeniedError…) with the API's stablecodeand the request id to quote to support. - Pagination:
listAll/list_alliterate every page.
Verifying webhooks
import { verifyWebhook } from "@reeltopus/sdk/webhooks";
export async function POST(request: Request) {
const event = await verifyWebhook(process.env.REELTOPUS_WEBHOOK_SECRET!, request.headers, await request.text());
if (event.type === "clip.exported") console.log(event.data.export.files.mp4?.url);
return new Response(null, { status: 204 });
}from reeltopus.webhooks import verify_webhook
event = verify_webhook(os.environ["REELTOPUS_WEBHOOK_SECRET"], request.headers, request.get_data())
if event["type"] == "clip.exported":
print(event["data"]["export"]["files"]["mp4"]["url"])Pass the raw body, before JSON parsing. Deliveries older than 5 minutes are refused, and event ids stay the same on retries, so use them to de-duplicate.
Other languages
The OpenAPI 3.1 document works with openapi-generator, Speakeasy, Stainless and Postman. Webhooks follow Standard Webhooks, which has verification libraries for Go, Ruby, PHP, Java, Rust, C# and more.