TypeScript SDK

Typed client for the Pipevideo API — Node.js 18+ and edge runtimes.

The official Pipevideo SDK provides typed helpers for engines, responses, and usage.

npm install pipevideo

Works in Node.js 18+ and edge runtimes (Cloudflare Workers, Vercel Edge, Deno Deploy).

Quick start

import { PipevideoClient } from "pipevideo";

const pv = new PipevideoClient({
  apiKey: process.env.PIPEVIDEO_API_KEY,
});

const response = await pv.responses.createAndWait({
  model: "moonshotai/kimi-k2.5",
  input: "Animated logo with pulsing circles",
  width: 1080,
  height: 1920,
});

console.log(response.output_video_url);

Configuration

const pv = new PipevideoClient({
  apiKey: "pv_...",
  baseUrl: "https://api.pipevideo.co",
  timeoutMs: 30_000,
  fetch: customFetch,
});
OptionDefaultDescription
apiKeyPIPEVIDEO_API_KEY envAPI key (required)
baseUrlhttps://api.pipevideo.coAPI base URL
timeoutMs30_000Request timeout in milliseconds
fetchGlobal fetchCustom fetch implementation

Engines

const { engines } = await pv.engines.list();
// [{ id: "hyperframes", name: "HyperFrames", supported_models: [...] }]

Responses

Create and poll separately

const { id } = await pv.responses.create({
  model: "moonshotai/kimi-k2.5",
  input: "A cat riding a skateboard",
});

const response = await pv.responses.get(id);
const video = await pv.responses.wait(id);

Create and wait

const response = await pv.responses.createAndWait({
  model: "moonshotai/kimi-k2.5",
  input: "A cat riding a skateboard",
});

Request fields

FieldTypeDescription
modelstringOrchestration LLM id
inputstring | arrayPrompt text or input message items
instructionsstringSystem-level guidance
widthnumberCanvas width in pixels
heightnumberCanvas height in pixels
aspectRatiostringAspect ratio (e.g. 16:9)
providerobject{ order: string[] } for provider routing

Completed responses include output_video_url and engine: "hyperframes".

Provider routing

await pv.responses.create({
  model: "moonshotai/kimi-k2.5",
  input: "Logo animation",
  provider: { order: ["framerate"] },
});

Usage

const usage = await pv.usage.get();
console.log(usage.credit_balance_usd, usage.totals);

Errors

ErrorWhen
PipevideoErrorAPI returned a non-2xx response
PipevideoTimeoutErrorcreateAndWait / wait exceeded the timeout