CLI आ SDK
@sketchie/sdk TypeScript क्लायंट आ sketchie कमांड लाइन ओही HTTP API पर पातर, टाइप कएल गेल wrapper अछि। दुनू SKETCHIE_API_KEY सँ अहाँक की पढ़ैत अछि आ डिफॉल्ट रूपसँ https://sketchie.ai/api पर जाइत अछि।
SDK आ CLI Sketchie टूलकिटक भागक रूपमे भेजल जाइत अछि। जँ अहाँक रजिस्ट्री अखनो पैकेज नहि सुलझबैत अछि, तँ अहाँ bun सँग Sketchie रिपॉजिटरीसँ चला सकैत छी। कच्चा HTTP API आइ कोनो भाषासँ काज करैत अछि।
TypeScript SDK
एकटा क्लायंट बनाउ, मैत्रीपूर्ण फील्डक सङ एकटा स्पष्टीकरण बनाउ, आ रेंडरक प्रतीक्षा करू।
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 संपादन आ पुनः-रेंडर लूप
संपादनक्षमता वेज: पूर्ण भेल स्पष्टीकरण अपन sceneGraph वापस करैत अछि। आर एकटा मुफ्त वीडियो निर्माण स्लॉट उपयोग नहि क संस्करण जोड़बाक लेल editExplainerGraph सँग कमिट करू, वा सरल भाषामे निर्देश पठाउ। हर वीडियोक पहिल पुनः-रेंडर मुफ्त अछि। बाद केर पुनः-रेंडर भुगतान योजना मिनट उपयोग करैत अछि।
// 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); आवाजक सूचीबद्ध करब
const voices = await client.listVoices();
// [{ id: 'sketchie:sulafat', name: 'Nora', isDefault: true, preview_url, ... }] आर विधि: getExplainer, listExplainers, revertExplainer, duplicateExplainer, आ deleteExplainer।
कमांड लाइन
# 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 फ्लैग आ वातावरण
| फ्लैग | अर्थ |
|---|---|
--length <M:SS|sec> | लक्ष्य लंबाइ, जेना 0:30, 1:00, वा सेकंड। 30 क धनात्मक गुणज। ऑटो लेल छोड़ू। |
--aspect <ratio> | 16:9 (डिफॉल्ट), 9:16, वा 1:1। |
--voice <ref> | एकटा आवाज ref (देखू sketchie voices)। वैकल्पिक; डिफॉल्ट Nora। |
--limit <n> | list लेल अधिकतम पंक्ति, 1 सँ 100 (डिफॉल्ट 50)। |
--wait | रेंडर पूर्ण वा विफल नहि होइत धरि पोल करैत अछि। |
--json | stdout पर मशीन-पठनीय आउटपुट। |
--api-url <url> | /api प्रीफिक्स सहित API बेस URL। Env: SKETCHIE_API_URL। |
--api-key <key> | अहाँक API की। Env: SKETCHIE_API_KEY। आउटपुटमे कहियो प्रिंट नहि होइत अछि। |