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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@apiary-gateway/sdk

v1.0.2

Published

A TypeScript client for the Apiary LLM Gateway

Downloads

9

Readme

Apiary SDK

Apiary is an open-source LLM Gateway for managing requests across leading providers. It routes all LLM requests through a single API endpoint, simplifying access to multiple models with a unified API, centralized management of features like routing, caching, and guardrails, and built-in observability.

Use the Apiary TypeScript SDK in your applications to easily send client requests to multiple LLM providers.

Supported Providers

  • Anthropic
  • Gemini
  • OpenAI

Setup

Prerequisites

To send LLM requests using the Apiary SDK, you must have a running Apiary instance set up in your AWS account. Follow the setup instructions in our installation guide to easily deploy Apiary's infrastructure using our CLI tool.

The deployment process will provide an AiGatewayRestApiEndpoint URL and API key that you can use to send LLM requests with the Apiary SDK.

Installation

To install the Apiary SDK, run the following command:

npm install @apiary-gateway/sdk

Usage

Import the Apiary client and initialize an instance with your configuration details.

Call the chatCompletion method with a prompt (required). A threadID may also be provided to include conversation context with the prompt. Optionally, specify the LLM provider and model to override your configuration details for these fields.

import Apiary from '@apiary-gateway/sdk';

// Initialize the Apiary client
const client = new Apiary({
  apiKey: '<YOUR_API_KEY>',
  baseUrl: 'https://<YOUR_GATEWAY_URL>.com',
  // Optionally include a userId to partition cache responses based on userId
  userId: '<userId>',
  // Optionally include a metadata object with your custom routing configuration groups
  metadata: {
    user-type: 'pro-users'
  },
});

const main = async () => {
  const completion = await client.chatCompletion(
    // Example prompt
    'Do all bees make honey?',
    // Optionally include a `threadID` to manage conversation context 
    '1745267450008',
    // Optionally specify the provider and model to override your configuration defaults
    'openai',
    'gpt-4',
  );

  // Log the returned LLM response
  console.log(completion.response.text);

  // Log the threadID for the returned LLM response
  console.log(completion.threadID);
}

main();