Quickstart

Render your first video in 5 minutes. This guide walks you through getting an API key, installing the SDK, and submitting your first render job.

1Sign up and get an API key

Create a PhantomFlow account and navigate to the API Keys page in your dashboard. Generate a live key (prefixed ve_live_) for production use, or a test key (prefixed ve_test_) for sandbox mode where no credits are consumed.

2Install the SDK

Install the official Node.js SDK. Requires Node.js 18+ with native fetch support.

npm install @phantomflow/sdk

3Submit your first render

Create a simple video with a text overlay. The render call returns a job ID you can use to check status.

import { PhantomFlowClient } from '@phantomflow/sdk';

const client = new PhantomFlowClient({
  apiKey: 've_live_your_key_here',
});

const job = await client.render({
  width: 1920,
  height: 1080,
  scenes: [
    {
      duration: 5,
      elements: [
        {
          type: 'text',
          text: 'Hello World',
          fontSize: 72,
          color: '#FFFFFF',
          position: 'center',
        }
      ]
    }
  ]
});

console.log(`Job submitted: ${job.jobId}`);

The response includes the job ID and status:

{
  "job_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "status": "queued",
  "estimated_credits": 5,
  "credits_remaining": 995
}

4Poll for completion

The SDK provides a waitForCompletion helper that polls every 2 seconds until the job finishes. You can also use SSE for real-time progress streaming.

const result = await client.waitForCompletion(job.jobId, {
  onProgress: (p) => {
    console.log(`${p.stage}: ${Math.round(p.progress * 100)}%`);
  }
});

if (result.status === 'completed') {
  console.log(`Video ready: ${result.outputUri}`);
} else {
  console.error('Render failed:', result.error);
}

5Download your video

When the job completes, the output_uri field contains a direct download URL for your rendered MP4 file.

{
  "job_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "status": "completed",
  "progress": 1,
  "stage": "complete",
  "output_uri": "https://cdn.phantomflow.dev/output/a1b2c3d4.mp4",
  "duration_seconds": 5.0,
  "estimated_credits": 5,
  "credits_used": 5,
  "created_at": "2026-01-15T10:30:00Z",
  "completed_at": "2026-01-15T10:30:12Z"
}

Next steps

  • Read the API Reference for all available endpoints
  • Learn about Templates for reusable video scripts with variables
  • Set up Webhooks for real-time completion notifications
  • Explore Integrations with Zapier, Make.com, and n8n