Official SDKs
Typed clients that handle keys, retries, idempotency, waiting for jobs and webhook checks for you.
Choose your SDK
JavaScript / TypeScript
Node 20+, Bun and Deno. Full types.
npm i @framera/sdkPython
Python 3.9+. Sync and async clients.
pip install frameraInstall and configure
npm install @framera/sdkCreate the client once and reuse it. It reads FRAMERA_API_KEY from the environment when you don't pass apiKey.
import { Framera } from '@framera/sdk';
const framera = new Framera({
apiKey: process.env.FRAMERA_API_KEY, // optional: this is the default
});What you can call
| Call | What it does |
|---|---|
models.list() | Models and the settings each takes, with prices |
quotes.create({ product, operation?, …body }) | The exact price of a request, free. For a UGC ad pass the ad as body: { product: "ugc", body: { product: { … } } } |
videos.create(body) | Films from text and videos from pictures |
avatars.create(body) | Talking avatars |
ugc.create(body) | UGC ads |
images.create(body) | One to four images |
tools.upscale() · removeBackground() · inpaint() | Image tools |
audio.speech() · voiceChange() · translate() | Voice and audio |
swap.create(body) | Swap a person into a clip |
uploads.create() · upload(file) | Upload images, clips and audio to use as inputs |
jobs.get · list · wait · cancel | Follow and manage jobs; list pages for you |
balance.get() | Balance, holds and auto-recharge |
webhookEndpoints.create · get · update · list · delete · rollSecret | Webhook endpoints |
events.list · get | Every event on your account |
Framera.webhooks.verify(body, header, secret) | Check a webhook is really from Framera |
Built in
- Retries on rate limits, server errors and network failures, with backoff.
- Idempotency keys on every create, so a retry never charges twice. Pass your own as
{ idempotencyKey }. - Typed errors:
FrameraErrorwithstatus,codeandmessage. - Waiting helpers with progress callbacks and timeouts.
- Webhook verification in one line.
- Types for every request, job and event, including the
priceon every job.
Uploading inputs
Pictures, clips and audio can be public https URLs, or files you upload first. uploads.upload(file) takes a file path, a Blob or File, or bytes; it asks for an upload slot and sends the file in one step, then returns the upload, whose upload_… id you pass as image, audio, video or inside references. JPEG, PNG, WebP, MP3, WAV, M4A, AAC, MP4 and MOV; up to 10 MB, or 50 MB for video.
const photo = await framera.uploads.upload('./founder.jpg');
const job = await framera.avatars.create({
image: photo.id,
script: 'Welcome to the team! Here is what happens next.',
voice: 'English_expressive_narrator',
});Waiting for jobs
jobs.wait(id) polls until the job succeeds, fails or is cancelled, and returns it. Pass onUpdate to see each change and timeoutMs to stop waiting after a while. In apps, webhooks save you the polling.
const done = await framera.jobs.wait(job.id, {
timeoutMs: 15 * 60_000,
onUpdate: (j) => console.log(j.status),
});Listing jobs
jobs.list() pages for you: loop with for await and the next page is fetched when you reach the end of the current one. See Pagination.
for await (const job of framera.jobs.list({ type: 'video', status: 'succeeded' })) {
console.log(job.id, job.price.amount);
}Errors
Every failed request throws a FrameraError with the HTTP status, the API's code (such as insufficient_balance), a plain message and the details. Each code has its own subclass, such as InsufficientBalanceError, PermissionDeniedError or ConflictError (409). Errors that are safe to retry are retried before they reach you. The full list is on Errors.
Verifying webhooks
Framera.webhooks.verify(body, header, secret) checks the Framera-Signature header against the raw body and your signing secret, refuses events more than five minutes old, and returns the parsed event. It throws if anything is wrong. Pass the raw body, not parsed JSON. Example on the right.
AI agents
Claude and other AI agents can make films with your key and your prices. See Claude and AI agents.