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

@aiqlick/inference

v0.1.0

Published

TypeScript client for the AIQLick inference API

Readme

@aiqlick/inference — TypeScript client

A thin wrapper over the official openai package for the AIQLick inference API.

Deliberately thin. The whole product claim is that the API is OpenAI-compatible, so a client that reimplemented the protocol could drift away from that claim without anyone noticing. AIQLick extends OpenAI, so anything the official client does — streaming, tool calling, retries, whatever it adds next — works here unchanged.

Install

npm install @aiqlick/inference openai

openai is a peer dependency, so you control its version and there is never a second copy of the SDK in your tree.

Use

import { AIQLick, Models } from "@aiqlick/inference";

const client = new AIQLick({ apiKey: process.env.AIQLICK_API_KEY });

const reply = await client.chat.completions.create({
  model: Models.CHAT_DEFAULT,
  messages: [{ role: "user", content: "hello" }],
});
console.log(reply.choices[0]?.message?.content);

Streaming works exactly as it does with the official client:

const stream = await client.chat.completions.create({
  model: Models.CHAT_DEFAULT,
  messages: [{ role: "user", content: "hello" }],
  stream: true,
});
for await (const chunk of stream) {
  process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
}

Models

Use the aliases, not provider model ids:

| Constant | Alias | |---|---| | Models.CHAT_PREMIUM | aiqlick/chat-premium | | Models.CHAT_DEFAULT | aiqlick/chat-default | | Models.CHAT_CHEAP | aiqlick/chat-cheap | | Models.EXTRACT_DEFAULT | aiqlick/extract-default | | Models.EXTRACT_FAST | aiqlick/extract-fast | | Models.EMBED_DEFAULT | aiqlick/embed-default |

The mapping from an alias to a specific provider model is a platform decision that changes without callers changing — that is the entire point of the gateway. Pinning a provider id in your own code gives that up.

Your key may be scoped to a subset. client.models.list() returns only what it can actually call.

Errors

The OpenAI SDK gives you a status and a message. asAIQLickError() promotes our code onto a typed error, which is what lets you tell "out of credits" from "subscription lapsed" — the same 402 with entirely different fixes.

import { asAIQLickError, ErrorCodes } from "@aiqlick/inference";

try {
  await client.chat.completions.create({ /* … */ });
} catch (err) {
  const specific = asAIQLickError(err);
  if (specific?.code === ErrorCodes.INSUFFICIENT_CREDITS) {
    // top up or upgrade the plan
  }
  throw specific ?? err;
}

It returns undefined for anything it does not recognise rather than guessing, so a provider error never gets mislabelled as a platform error.

| code | Meaning | |---|---| | INSUFFICIENT_CREDITS | Credit balance exhausted | | SUBSCRIPTION_INACTIVE | No active subscription for the company | | LLM_MODEL_NOT_ALLOWED | Key not permitted to use that alias | | LLM_GATEWAY_UNAVAILABLE | Gateway unreachable — retry with backoff |

Configuration

| Variable | Default | |---|---| | AIQLICK_API_KEY | — | | AIQLICK_BASE_URL | https://api.aiqlick.com/llm/v1 |

Reading the base URL from the environment means one build can be pointed at dev or a self-hosted deployment without a code change.

Not using this client

You do not have to. The API is OpenAI-compatible, so the official client works directly — this package only saves you the base URL and the constants:

import OpenAI from "openai";
const client = new OpenAI({
  apiKey: "sk-…",
  baseURL: "https://api.aiqlick.com/llm/v1",
});

Full documentation: https://docs.aiqlick.com