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

aisool-sdk

v1.1.11

Published

Official JS/TS SDK for Aisool AI

Readme

Aisool SDK

The official JavaScript / TypeScript SDK for interacting with Aisool AI – Sool Max v2.

Aisool SDK provides a simple and secure way to communicate with the Aisool AI API using the OpenAI-compatible Chat Completions and Image Generations format.


✨ Features

  • 🚀 Simple and lightweight
  • 🔐 Secure Bearer token authentication
  • 💬 Chat-based AI interaction (Sool Max v2)
  • 🎨 AI Image Generation (Powered by FreeGen)
  • 📦 Full TypeScript support
  • ⚡ Works in Node.js and modern frameworks (Next.js, Vite, etc.)
  • 🔄 OpenAI-compatible API format

📦 Installation

Install via your favorite package manager:

npm install aisool-sdk
# or
pnpm add aisool-sdk
# or
yarn add aisool-sdk

🚀 Quick Start

Chat Completion

import { AisoolClient } from 'aisool-sdk';

const client = new AisoolClient('YOUR_API_KEY');

async function askAI() {
  try {
    const response = await client.chat('Hello! How are you?');
    console.log('AI Response:', response.content);
  } catch (error: any) {
    console.error('Error:', error.message);
  }
}

askAI();

Image Generation

async function generateArt() {
  try {
    const response = await client.generateImage('A futuristic neon city at night');
    console.log('Image URL (Base64):', response.data[0].url);
  } catch (error: any) {
    console.error('Error:', error.message);
  }
}

generateArt();

🔑 Authentication

You must provide your Aisool API Key when creating the client.

const client = new AisoolClient('YOUR_API_KEY');

⚠️ Never expose your API key in frontend public code. Use environment variables: const client = new AisoolClient(process.env.AISOOL_API_KEY!);


🎨 Image Generation Method

client.generateImage(prompt: string)

Generates a high-quality image based on the provided text prompt. Note that this method uses Selenium-based automation on the backend, so it may take up to 30–60 seconds.

Response Format:

interface ImageResponse {
  created: number;
  data: Array<{
    url: string; // Base64 encoded image string or URL
  }>;
}

💬 Chat Method

client.chat(message: string)

Sends a message to Sool Max v2 (sool-max model) and returns a structured AI response.

Response Format:

interface ChatResponse {
  role: 'assistant' | 'user';
  content: string;
  finish_reason: string | null;
  usage?: {
    prompt_tokens: number;
    completion_tokens: number;
    total_tokens: number;
  };
}

🛠 Error Handling

Always wrap requests in try/catch. If you call a chat completion without the correct internal model mapping, the SDK will catch the error returned by the server.

try {
  const res = await client.chat('Hello AI');
} catch (error: any) {
  // Catch authentication errors, model mismatch (400), or timeouts (504)
  console.error(error.message);
}

🌍 Environment Support

  • Node.js 18+
  • Next.js / Nuxt.js
  • Vite / React / Vue
  • TypeScript projects
  • Any environment supporting fetch

📄 License

MIT License © 2026 AiSool


🔗 Official Links


Built with ❤️ for developers.