npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

skailar-api

v1.5.0

Published

An wrapper made for the Skailar API

Downloads

2

Readme

Skailar Api

npm version

wakatime

Introduction

This is a wrapper for the Skailar Api.

Made with Axios and TypeScript for better type support.

Installation

Firstly, you need to install the SkailarChat package by running:

npm install skailar-api

How to Use

(async () => {
    const SkailarChat = await import("chimera-api");

    const Skailar = SkailarChat.default;

    const apiKey = "YOUR_API_KEY";

    const skailarApi = new Skailar(apiKey);

    const createChatCompletion = await skailarApi.CreateChatCompletion({
        model: "gpt-4",
        messages: [
            {
                content: "Hello, how are you?",
                role: "user",
            },
        ],
    });

    console.log(createChatCompletion);
    process.exit(0);
})();

No, you can not use top-level awaits in CommonJS. You can use the workaround above or use ESM instead.

The SkailarChat class provides an easy-to-use interface for interacting with the Skailar API in a Node.js environment.

First, you must import the SkailarChat class:

import SkailarChat from "skailar";

Then, initialize a new instance of SkailarChat using your API key (You can get one by joining this Discord Server):

let skailar = new SkailarChat("your-api-key");

If you need to use a proxy, provide a configuration object as the second parameter to the constructor:

let skailar = new SkailarChat("your-api-key", {
    host: "proxy-host",
    port: "proxy-port",
    protocol: "http",
    auth: {
        username: "proxy-username",
        password: "proxy-password",
    } /* Optional */,
});

You can also pass a debugLogging boolean as the third parameter to the constructor to enable debug logging of the Proxy Handler:

let skailar = new SkailarChat("your-api-key", undefined, true);

The SkailarChat class has a number of public methods:

  • CreateChatCompletion(data): Creates a chat completion. Expects a ChatCompletionRequest object as the parameter.

  • CreateClaudeChatCompletion(data): Creates a Claude chat completion. Expects a ClaudeChatCompletionRequest object as the parameter.

  • Usage(): Fetches usage data.

  • Models(): Fetches available models.

Example

Here is an example usage of the SkailarChat class:

import SkailarChat from "skailar";

let skailar = new SkailarChat("your-api-key");

let request = {
    model: "gpt-4",
    messages: [
        { role: "system", content: "You are a helpful assistant." },
        { role: "user", content: "Who won the world series in 2020?" },
    ],
    max_tokens: 60,
};

skailar
    .CreateChatCompletion(request, true)
    .then((response) => console.log(response))
    .catch((err) => console.error(err));

Note

You might encounter some issues while using any model that is not gpt-4-32k. This is because Skailar Api had some problems with the other models and that wasnt fixed yet (As of 17/07/2023 - v1.0.0).

Also note that the 32k model is only available for boosters/donators on their discord server. You can also get access to it giving proper feedback/suggestions/use cases for the model.

Types

The following types are used in the context of the SkailarChat:

  • Messages
  • Functions
  • Models
  • ChatCompletionRequest
  • ClaudeChatCompletionRequest
  • ChatCompletionResponseChoices
  • ChatCompletionResponseUsage
  • ChatCompletionResponse
  • ClaudeChatCompletionResponse
  • UsageResponse
  • ModelList
  • ModelData
  • Permission

Refer to the code comments in the SkailarChat class for more details about these types.

Disclaimer

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.

The author is not affiliated with the Skailar development team and created this wrapper for personal use and thought it might be helpful to others. This wrapper is to be used at your own risk.

Also, this was not made by using fetch because the built-in fetch does not support proxies by default, and I don't want to use an workaround.

Support and Others

Proxy Handler:

The Proxy handler is 100% not a thing to be used with a single API: It provides advanced management of Axios instances, such as per-URL instance caching and optional proxy support. Originally, it was designed for managing multiple API endpoints, hence the proxy handler might seem over-engineered for a single API wrapper. It's optional and doesn't affect the main functionality if not utilized.

TLDR: The Proxy Handler is way too overengineered for a single API wrapper, but it's optional and doesn't affect the main functionality if not utilized.