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 pipevideoWorks 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,
});| Option | Default | Description |
|---|---|---|
apiKey | PIPEVIDEO_API_KEY env | API key (required) |
baseUrl | https://api.pipevideo.co | API base URL |
timeoutMs | 30_000 | Request timeout in milliseconds |
fetch | Global fetch | Custom 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
| Field | Type | Description |
|---|---|---|
model | string | Orchestration LLM id |
input | string | array | Prompt text or input message items |
instructions | string | System-level guidance |
width | number | Canvas width in pixels |
height | number | Canvas height in pixels |
aspectRatio | string | Aspect ratio (e.g. 16:9) |
provider | object | { 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
| Error | When |
|---|---|
PipevideoError | API returned a non-2xx response |
PipevideoTimeoutError | createAndWait / wait exceeded the timeout |
Related
- Responses API — full HTTP reference
- OpenAI SDK compatibility — use OpenAI SDK with Pipevideo