PerciaDocs
percia.ai Open app

Docs Reference

SDKs and CLI

Install the JavaScript and Python SDKs and the percia command line, sign in, and see what each one covers.

All three are open source (MIT), generated from the same OpenAPI document as the API reference, and live in github.com/percia-ai/percia-sdks.

InstallPackage
JavaScript and TypeScriptnpm install @percia/sdk@percia/sdk (latest)
Python 3.9+pip install perciapercia (latest)
Command linenpm install -g @percia/cli@percia/cli (latest)

Sign in#

import { createClient } from "@percia/sdk";

const percia = createClient({ apiKey: process.env.PERCIA_API_KEY }); // pk_live_...
// or an OAuth token: createClient({ oauthToken })
console.log(await percia.account.whoami());   // connection test

The default API address is https://playground.percia.ai. Override it with baseUrl (JavaScript), base_url or PERCIA_BASE_URL (Python).

Common jobs#

// create, test, read, pause, delete
const watch = await percia.watches.create({
  sourceUrl: "rtsp://cam.example.com/stream",
  goal: "A person is standing at the front door",
  notify: { type: "webhook", target: "https://example.com/hooks/percia" },
});
await percia.watches.testDelivery(watch.id);
for await (const e of percia.events.iterate({ type: "goal.met" })) console.log(e.at, e.reason);
await percia.watches.pause(watch.id);
await percia.watches.delete(watch.id);

// plan and free minutes
console.log(await percia.account.billing());

The CLI prints JSON with --json, exits with a code per kind of failure (3 not signed in or missing scope, 4 not found, 5 rate or plan limit, 6 network, 7 server), and shows each secret once.

What they cover#

The SDKs include retries, typed errors, pagination, webhook signature checking and an event stream. The latest SDK and CLI releases (0.5.0 and later) cover all 171 operations in the API, including the six Live operations, generated from the same OpenAPI document. If a call from the API reference is missing in the version you installed, update the package or call the HTTP API directly.

In JavaScript every covered operation is also available by its operationId as percia.api.<operationId>(options), which returns { data, error, response } without throwing. percia.raw is the generated client.

Postman and examples#

  • A Postman collection, environment and an Insomnia export are in the repository's postman/ folder.
  • examples/ has webhook receivers (Express, Cloudflare Workers, FastAPI, Go, Ruby), a Slack script, a voice alert and a GitHub Actions example.

Stuck? Ask in the Percia Discord or email support@percia.ai. This page as Markdown: sdks.md.

© 2026 PerciaPerciaOpen the appStatusDiscordSupportTermsPrivacyllms.txt