---
title: "Klipper Studio JavaScript SDK (klipperstudio-sdk)"
url: https://klipperstudio.com/developers/sdk
description: "Official JavaScript and TypeScript SDK for the Klipper Studio API on npm: klipperstudio-sdk. Zero dependencies, ESM, typed, retries with Idempotency-Key."
---

# Klipper Studio JavaScript SDK

The official client for the [Klipper Studio API](https://klipperstudio.com/developers): npm package
**`klipperstudio-sdk`**. ESM, zero dependencies, TypeScript types included, runs on Node 18+, Deno, Bun and in
browsers. Source: [github.com/zenkriztao/klipperstudio-sdk](https://github.com/zenkriztao/klipperstudio-sdk) (MIT).

## Install

```bash
npm install klipperstudio-sdk
```

## Use

```js
import { KlipperStudio } from "klipperstudio-sdk";

const ks = new KlipperStudio();                 // production; { sandbox: true } for demo data
const plans = await ks.listPlans({ kind: "time_plan" });
const cost = await ks.estimate({ minutes: 45, account: "free" });
const moments = await ks.mostReplayedMoments("https://youtu.be/VIDEO_ID");
const plan = await ks.createClipPlan({ videos_per_month: 20, minutes_per_video: 60 }); // waits until completed
const updated = await ks.updateClipPlan(plan.id, { videos_per_month: 30 });
for await (const hit of ks.searchAll("alternatif opus clip")) console.log(hit.title);
```

| Method | Endpoint |
| --- | --- |
| `listPlans({ kind, cursor, limit })` | `GET /plans` |
| `getPlan(code)` | `GET /plans/{code}` |
| `features()` | `GET /features` |
| `estimate({ minutes, account, removeWatermark })` | `GET /estimate` |
| `mostReplayedMoments(url)` | `GET /most-replayed-moments` |
| `search(q, { kind, cursor, limit })`, `searchAll(q)` | `GET /search` |
| `readPage(path)` | `GET /pages/{path}` |
| `createClipPlan(input, { wait })`, `getClipPlan(id)`, `updateClipPlan(id, changes)` | `/clip-plans` |

Errors throw `KlipperStudioError` with `status`, `code` and `detail` from the
[problem+json body](https://klipperstudio.com/developers/errors). `429` responses are retried once after
`Retry-After`. Every create sends a fresh `Idempotency-Key`.

See also the [CLI](https://klipperstudio.com/developers/cli) and the [MCP package](https://klipperstudio.com/developers/mcp).
