@skailar-ai/sdk 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +74 -0
- package/dist/index.cjs +861 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1254 -0
- package/dist/index.d.ts +1254 -0
- package/dist/index.js +846 -0
- package/dist/index.js.map +1 -0
- package/package.json +58 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Skailar-AI
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Skailar SDK for TypeScript
|
|
2
|
+
|
|
3
|
+
The Skailar SDK for TypeScript provides access to the [Skailar API](https://skailar.com) — an OpenAI-compatible, multi-provider LLM gateway — from server-side TypeScript or JavaScript applications.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
This package is **pre-release and not yet published to npm.** Consume it locally with `bun link`:
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
# in this repo
|
|
11
|
+
bun install
|
|
12
|
+
bun run build
|
|
13
|
+
bun link
|
|
14
|
+
|
|
15
|
+
# in your project (declare the dep, then link)
|
|
16
|
+
# add "@skailar-ai/sdk": "*" to package.json dependencies, then:
|
|
17
|
+
bun link @skailar-ai/sdk
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Once published, installation will be:
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
bun add @skailar-ai/sdk
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Getting started
|
|
27
|
+
|
|
28
|
+
```js
|
|
29
|
+
import Skailar from '@skailar-ai/sdk';
|
|
30
|
+
|
|
31
|
+
const client = new Skailar({
|
|
32
|
+
apiKey: process.env.SKAILAR_API_KEY,
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const completion = await client.chat.completions.create({
|
|
36
|
+
model: 'claude-sonnet-4-6',
|
|
37
|
+
messages: [{ role: 'user', content: 'Hello, Skailar' }],
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
console.log(completion.choices[0].message.content);
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Streaming
|
|
44
|
+
|
|
45
|
+
```js
|
|
46
|
+
const stream = await client.chat.completions.create({
|
|
47
|
+
model: 'claude-sonnet-4-6',
|
|
48
|
+
messages: [{ role: 'user', content: 'Count to ten.' }],
|
|
49
|
+
stream: true,
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
for await (const chunk of stream) {
|
|
53
|
+
process.stdout.write(chunk.choices[0]?.delta?.content ?? '');
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Drop-in OpenAI replacement
|
|
58
|
+
|
|
59
|
+
The wire format mirrors OpenAI's, so migrating is typically just the import and client construction:
|
|
60
|
+
|
|
61
|
+
```diff
|
|
62
|
+
- import OpenAI from 'openai';
|
|
63
|
+
- const client = new OpenAI({ apiKey: process.env['OPENAI_API_KEY'] });
|
|
64
|
+
+ import Skailar from '@skailar-ai/sdk';
|
|
65
|
+
+ const client = new Skailar({ apiKey: process.env['SKAILAR_API_KEY'] });
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Requirements
|
|
69
|
+
|
|
70
|
+
Node.js 18+ (also runs on Bun, Deno and modern browsers). Zero runtime dependencies.
|
|
71
|
+
|
|
72
|
+
## License
|
|
73
|
+
|
|
74
|
+
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
|