vanai-sdk
v1.0.2
Published
Official SDK for the VanAI API — text generation (Groq Llama Instant) with built-in image understanding (Gemini 3.1 Flash-Lite) and built-in security filtering.
Downloads
607
Maintainers
Readme
vanai-sdk
Official SDK for the VanAI API.
- Text generation: Groq Llama Instant
- Built-in image understanding: Gemini 3.1 Flash-Lite (automatic, always on)
- Built-in security filtering (automatic, always on)
Image understanding and security filtering happen server-side and cannot be disabled by developers using this SDK.
Install
npm install vanai-sdkUsage
import VanAI from 'vanai-sdk';
const vanai = new VanAI({
apiKey: 'vanai-xxxxxxxxxxxxxxxxxxxxxxxx',
// Optional — omit to use VanAI's default system prompt
systemPrompt: 'You are a friendly support assistant for Acme Co.',
// Optional — keeps a running conversation history for you
memory: true
});
const reply = await vanai.chat({ message: 'What is in this image?', image: myBase64Image });
console.log(reply);CommonJS works too:
const VanAI = require('vanai-sdk');API
new VanAI(options)
| Option | Type | Required | Description |
|---|---|---|---|
| apiKey | string | yes | Your vanai- API key, obtained via the Discord bot's /apikey generate command. |
| systemPrompt | string | no | Your own system prompt. If omitted, a default system prompt is applied automatically. |
| memory | boolean | no | If true, the client remembers the conversation across chat() calls and sends it as context. |
vanai.chat({ message, image })
message(string, required) — the user's message.image(string, optional) — base64 string, data URL, or image URL. Automatically analyzed server-side before the text model responds.
Returns a Promise<string> with the model's reply.
vanai.clearMemory()
Clears local conversation history (only meaningful when memory: true).
vanai.getHistory()
Returns a copy of the current local conversation history.
Getting an API key
API keys are issued through the VanAI Discord bot:
/apikey generate— generates a new key (max 3 per user) and DMs it to you./apikey delete— DMs you a menu to pick which of your keys to delete.
