Node.js SDK
Getting Started
Learn how to install and use the VLM Run Node.js SDK
Installation
You can install the VLM Run Node.js SDK using npm, yarn, or pnpm:
Authentication
To use the VLM Run API, you’ll need an API key. You can obtain one by:
- Create an account at VLM Run
- Navigate to dashboard Settings -> API Keys
Then use it to initialize the client:
Basic Usage
Image Predictions
Here’s a simple example of using the SDK to process an image:
Process an image passing zod schema
Process an image using local file
Document Predictions
Here’s how to process documents:
Process a document passing zod schema
TypeScript Support
The VLM Run Node.js SDK is written in TypeScript and provides full type definitions out of the box. When using TypeScript, you’ll get:
- Full IntelliSense support
- Type checking for all API calls
- Type definitions for request and response objects
- Autocomplete for configuration options
To get the best development experience, make sure your tsconfig.json
includes: