@vestavision/sdk
v0.2.0
Published
Vestavision Model API TypeScript SDK (OpenAPI-generated + façade)
Readme
@vestavision/sdk
TypeScript SDK for the Vestavision Model API.
OpenAPI types and HTTP live under src/generated/ (regenerate with make sdk from the Hub repo). The public façade in src/index.ts adds Key auth, wait / subscribe, typed APIError, and webhook verification.
Install
# from this package (path / publish as needed)
npm install @vestavision/sdkUsage
import { VestaClient, verifyWebhookSignature } from "@vestavision/sdk";
const client = new VestaClient({
apiKey: process.env.VESTA_API_KEY!,
// baseUrl: "http://127.0.0.1:18080",
});
const models = await client.listModels();
const submitted = await client.submit("vesta/face-landmarks", {
input: { image_url: "https://example.com/face.jpg" },
idempotencyKey: "demo-1",
});
const done = await client.wait(submitted.request_id!);
console.log(done.status, done.output);
// Outbound webhook: hex HMAC-SHA256 of raw body (X-Vesta-Signature)
await verifyWebhookSignature(secret, rawBody, signatureHeader);| Method | Use |
|--------|-----|
| submit | Start inference (Idempotency-Key optional) |
| wait | Poll until completed / failed / canceled |
| subscribe | Submit async then wait |
| listModels / getModel | Catalog |
| listRequests / getRequest / cancel | Jobs |
| credits | Balance |
| presignUpload | Input upload URL |
Auth: Authorization: Key vh_…. Model ids may contain / (e.g. vesta/face-landmarks).
Regenerate from Hub: make sdk (requires Docker). Spec: docs/openapi/model-api.v1.yaml.
npm test