Client Configuration
TheVlmRun client is the main entry point for interacting with the VLM Run API. It provides access to all SDK functionality including file operations, model operations, and predictions.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
VLM Run Node.js SDK Client Configuration and Usage
VlmRun client is the main entry point for interacting with the VLM Run API. It provides access to all SDK functionality including file operations, model operations, and predictions.
import { VlmRun } from "vlmrun";
const client = new VlmRun({
apiKey: "your-api-key",
// Optional configuration options
baseUrl?: string;
});
| Option | Type | Description | Default |
|---|---|---|---|
apiKey | string | Your VLM Run API key | Required |
baseUrl | string | Custom API base URL | https://api.vlm.run |
// File operations
client.files.upload({
/* ... */
});
client.files.get();
client.files.list();
// Model operations
client.models.list();
// Image predictions
client.image.generate({
/* ... */
});
// Document predictions
client.document.generate({
/* ... */
});
import { VlmRun, ApiError } from "vlmrun";
try {
const client = new VlmRun({
apiKey: "invalid-key",
});
await client.models.list();
} catch (error) {
if (error instanceof ApiError) {
console.error("API Error:", error.message);
console.error("Status:", error.http_status);
} else if (error instanceof VlmRunError) {
console.error("SDK Error:", error.message);
} else {
console.error("Unknown Error:", error);
}
}
interface ApiError extends Error {
message: string;
http_status: number;
headers?: Record<string, string>;
}
interface VlmRunError extends Error {
message: string;
code?: string;
cause?: Error;
}