CoreReflex SDK Quickstart and First Render

Install the CoreReflex SDK, authenticate with an API key, and ship your first render in minutes, typed calls over the JSON engine and generation endpoints.

The CoreReflex SDK lets you drive the whole agentic film studio from code, author a project as structured JSON, generate shots, and trigger a deterministic render, all with typed calls and an API key instead of clicking through the editor. If you can describe a film, you can now do it programmatically and ship your first render in minutes.

This quickstart walks through installation, authentication, and a first end-to-end render. The exact package name, method signatures, and field names are canonical in the developer documentation, treat the snippets here as the shape of the workflow, and check the docs for the current surface.

What the SDK gives you

The SDK is a typed wrapper over the same platform the editor uses: a programmable JSON engine over editor state, the generation endpoints (video, image, music, voice on Google Vertex AI), and the deterministic render path. Instead of crafting raw HTTP requests, you get ergonomic methods, typed responses, and sensible defaults, while the underlying contract stays identical to the public API.

That matters for two reasons. First, anything you can do in the UI you can do in code, because both speak to the same JSON engine. Second, the same manifest renders to the same cut every time, so your code produces reproducible results rather than one-off surprises. If you'd rather work at the raw HTTP layer, the CoreReflex API quickstart covers the same ground without the SDK.

Step 1: Get an API key

Everything authenticates with an API key tied to your account. Create one from your dashboard's API settings, then store it as an environment variable, never hard-code it into source or commit it to a repo.

export COREREFLEX_API_KEY="sk_live_..."

Keys carry your account's permissions and consume credits when they trigger generation, so treat them like passwords: scope them where you can, rotate them if exposed, and keep separate keys for development and production.

Step 2: Install the SDK

Install from your package manager of choice. The snippet below shows the JavaScript/TypeScript package; consult the docs for the exact name and for other supported languages.

npm install @corereflex/sdk

Then initialize the client, reading the key from the environment:

import { CoreReflex } from "@corereflex/sdk";

const client = new CoreReflex({
  apiKey: process.env.COREREFLEX_API_KEY,
});

The client is the single entry point. From here you author projects, request generations, and kick off renders without managing tokens or endpoints by hand.

Step 3: Author a project as JSON

The heart of the platform is the JSON engine, a structured representation of editor state that you can read, build, and mutate programmatically. A minimal project describes the composition and its shots. Planning and scoring are free; only generation costs credits, so you can build and validate structure without spending a thing.

const project = await client.projects.create({
  name: "Launch teaser",
  composition: { width: 1920, height: 1080, fps: 30 },
  shots: [
    {
      role: "hero",
      prompt: "A sunrise over a quiet coastline, slow push-in",
      camera: "dolly-in",
      durationInFrames: 90,
    },
  ],
});

This is the same structure the agentic Director produces when it boards a film, role, camera move, and prompt per shot. You can hand-author it, generate it, or let the Director plan it and then refine the JSON in code.

Step 4: Generate shots through the quality gate

Request generation for your shots. Each shot passes through CoreReflex's quality gate, where it's scored on concrete checks, prompt match, sharpness, motion coherence, on-screen text legibility, on-brand, and claims-risk, and any failures auto-regenerate selectively rather than restarting the whole job.

const result = await client.generate.shots({
  projectId: project.id,
  // optional: cap spend / iterations per the docs
});

for (const shot of result.shots) {
  console.log(shot.role, shot.score, shot.status);
}

Every generation carries a portable provenance trace, model, prompt, parameters, and score, so a result is reproducible and auditable from code, not just from the UI. That trace is what makes programmatic generation trustworthy at scale.

Step 5: Render and fetch the output

With shots generated, trigger the deterministic render. Under the hood a real Remotion render-worker claims the job, renders, uploads to your storage, and writes an asset row, with retry, a dead-letter queue, faststart, and encoder tiers handled for you.

const render = await client.renders.create({ projectId: project.id });

const final = await client.renders.waitFor(render.id);
console.log("Done:", final.assetUrl);

Because the render path is deterministic, the same manifest yields the same cut, so a render you trigger in CI matches the one you previewed, that's your first finished, graded output, produced entirely from code.

Where to go from here

Once the basic loop works, the SDK becomes the foundation for real automation:

For more patterns, scheduling, error handling, and integrating the SDK into existing pipelines, see how to automate creative in code with the CoreReflex SDK and the full developer documentation.

Frequently asked questions

How do I install the CoreReflex SDK?

Install it from your language's package manager, for JavaScript and TypeScript, that's a single npm install of the SDK package, then initialize a client with your API key read from an environment variable. The exact package name and the list of supported languages live in the developer documentation, which is the canonical reference for the current surface. Once the client is initialized, you can author projects, generate shots, and trigger renders.

Does the SDK wrap the JSON engine?

Yes. The SDK is a typed convenience layer over the same programmable JSON engine and generation endpoints that the editor and public API use. You author and mutate projects as structured JSON, request generations that pass through the quality gate, and trigger deterministic renders, all with typed methods instead of hand-rolled HTTP. Because it speaks the same contract as the API, anything you can do in the UI you can do in code.

Does using the SDK cost credits?

Authoring and validating JSON, planning, and scoring are free, only generation consumes credits, exactly as in the editor. That means you can build and test your project structure, wire up your integration, and iterate on your code without spending credits, and only pay when you actually generate shots or renders.

Ship your first render in minutes

The SDK collapses the whole studio into a handful of typed calls: authenticate with a key, author a project as JSON, generate shots through the quality gate, and trigger a deterministic render that produces the same cut every time. From there, batching, scheduling, and agent integrations are a short step away.

Get a key and run the quickstart yourself, start free, no credit card required.

Share this article

Pass it to someone who is still editing by hand.

Ready to direct your own film? It is free to start — no credit card.

Start free

← All articles