Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xalen-sdk

The official JavaScript/TypeScript SDK for the XALEN AI API. Drop-in replacement for the OpenAI SDK.

Installation

npm install xalen-sdk

Quick Start

import 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);

Streaming

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 || '');
}

Environment Variable

Set XALEN_API_KEY to avoid passing the key explicitly:

export XALEN_API_KEY=xln_live_your_key_here

API Base URL

Default: https://api.xalen.io/v1

Documentation

Full API docs: xalen.io/docs

License

MIT

About

Official XALEN JavaScript/TypeScript SDK — npm install xalen-sdk

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages