CLI and SDK
The @sketchie/sdk TypeScript client and the sketchie command line are thin, typed wrappers over the same HTTP API. Both read your key from SKETCHIE_API_KEY and default to https://sketchie.ai/api.
The SDK and CLI ship as part of the Sketchie toolkit. If your registry does not yet resolve the package, you can run them from the Sketchie repository with bun. The raw HTTP API works from any language today.
TypeScript SDK
Create a client, generate an explainer with the friendly fields, and wait for the render.
import { SketchieClient } from '@sketchie/sdk';
const client = new SketchieClient({
apiKey: process.env.SKETCHIE_API_KEY, // Bearer sk_...
// baseUrl defaults to https://sketchie.ai/api
});
// Friendly fields: input (the topic) and length ("M:SS", a multiple of 30).
const created = await client.createExplainer({
input: 'Explain how DNS resolves a domain name',
length: '0:30',
aspect: '16:9',
});
// Poll until the render finishes (or fails).
const done = await client.waitForExplainer(created.id, {
onUpdate: (e) => console.log(e.status),
});
console.log(done.videoUrl); // the rendered MP4
console.log(done.sceneGraph); // the editable scene graph The edit and re-render loop
The editability wedge: a finished explainer hands back its sceneGraph. Commit it with editExplainerGraph to append a version without consuming another free-video creation slot, or send a plain-language instruction. The first re-render of each video is free. Later re-renders use paid-plan minutes.
// After a video is ready you get back its editable sceneGraph.
// Edit it, then append a new version to the existing explainer.
const edited = editScenes(done.sceneGraph!); // your UI edits the graph
const rerender = await client.editExplainerGraph(done.id, edited);
await client.waitForVersion(done.id, rerender.id);
// Or apply a plain-language instruction (a targeted re-render):
const version = await client.editExplainer(done.id, 'make scene 2 shorter');
await client.waitForVersion(done.id, version.id); Listing voices
const voices = await client.listVoices();
// [{ id: 'sketchie:sulafat', name: 'Nora', isDefault: true, preview_url, ... }] Other methods: getExplainer, listExplainers, revertExplainer, duplicateExplainer, and deleteExplainer.
Command line
# Discover voices
sketchie voices
# Generate (returns the queued record immediately)
sketchie generate "Explain how DNS resolves a domain name" --length 0:30 --aspect 16:9
# Generate and wait for the finished render
sketchie generate "Explain how DNS resolves" --length 1:00 --wait
# Status of an existing explainer
sketchie status <id>
# Conversational edit (a targeted re-render)
sketchie edit <id> "make the title scene shorter" --wait
# List your explainers
sketchie list --limit 20 Flags and environment
| Flag | Meaning |
|---|---|
--length <M:SS|sec> | Target length, e.g. 0:30, 1:00, or seconds. A positive multiple of 30. Omit for auto. |
--aspect <ratio> | 16:9 (default), 9:16, or 1:1. |
--voice <ref> | A voice ref (see sketchie voices). Optional; defaults to Nora. |
--limit <n> | Max rows for list, 1 to 100 (default 50). |
--wait | Poll until the render finishes or fails. |
--json | Machine-readable output on stdout. |
--api-url <url> | API base URL including the /api prefix. Env: SKETCHIE_API_URL. |
--api-key <key> | Your API key. Env: SKETCHIE_API_KEY. Never printed in output. |