The official JavaScript/TypeScript SDK for the XALEN AI API. Drop-in replacement for the OpenAI SDK.
npm install xalen-sdkimport XALEN from 'xalen-sdk';
const client = new XALEN({ apiKey: 'xln_live_your_key_here' });
const response = await client.chat.completions.create({
model: 'vedika-standard',
messages: [{ role: 'user', content: 'What is Shakata Yoga?' }],
});
console.log(response.choices[0].message.content);const stream = await client.chat.completions.create({
model: 'vedika-fast',
messages: [{ role: 'user', content: 'Analyze planetary transits' }],
stream: true,
});
for await (const chunk of stream) {
process.stdout.write(chunk.choices[0]?.delta?.content || '');
}Set XALEN_API_KEY to avoid passing the key explicitly:
export XALEN_API_KEY=xln_live_your_key_hereDefault: https://api.xalen.io/v1
Full API docs: xalen.io/docs
MIT