RawFrame

Quickstart

Generate your first video in under five minutes.

You need an account with credits, an API key, and either Node.js 20.3+, Python 3.11+, or curl and jq.

Get an API key

Sign in to the dashboard with your email address. Your first sign-in creates an organization. Add credits on the Billing page, then open API keys, choose Create key, and copy the key. It starts with rf_live_ and is shown only once.

Keep the key on your server: anyone with it can spend your credits. Put it in an environment variable:

export RAWFRAME_API_KEY="rf_live_..."

Install an SDK

npm install @rawframe/sdk

Generate a video

Save this as quickstart.ts, quickstart.py or quickstart.sh:

import { writeFile } from "node:fs/promises";
import { RawFrame } from "@rawframe/sdk";

const rf = new RawFrame(); // reads RAWFRAME_API_KEY

const video = await rf.generations.createAndWait({
  model: "bytedance/seedance-2.5",
  prompt: "A paper boat drifting down a rain-soaked city gutter, macro lens, golden hour",
  params: { duration_seconds: 5, aspect_ratio: "16:9", resolution: "720p" },
});

const output = video.outputs?.[0];
if (!output) throw new Error("No output");
const file = await fetch(output.url);
await writeFile("paper-boat.mp4", Buffer.from(await file.arrayBuffer()));
console.log(`Saved paper-boat.mp4 (${video.id}, charged $${(video.charge_micros ?? 0) / 1_000_000})`);

Then run it:

npx tsx quickstart.ts

A 5-second 720p video usually takes one to three minutes. When it's done, paper-boat.mp4 is in the current directory.

What just happened

  1. POST /v1/generations checked the request against Seedance 2.5's capabilities, reserved its maximum price from your credits, and queued it. It returned at once with status queued and a gen_... id.
  2. The generation moved through submitting and running while the provider rendered it, then succeeded. The SDKs' createAndWait / create_and_wait polls every two seconds until then.
  3. You were charged for the seconds of video produced, and any unused reservation went back to your balance. The charge is in charge_micros (micro-USD).
  4. The output was copied to our storage. outputs[0].url is a signed link that works for an hour.

Next steps

On this page