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

routerbase-quickstart

v0.1.0

Published

A tiny Node.js quickstart and CLI for the RouterBase OpenAI-compatible API.

Readme

RouterBase Quickstart

RouterBase is an OpenAI-compatible API gateway for calling many frontier AI models through one base URL: https://routerbase.com/v1.

This package gives Node.js developers a tiny, dependency-free helper and CLI for trying RouterBase chat completions without changing their app architecture.

Why RouterBase

  • One OpenAI-compatible API surface for chat, image, video, audio, and embeddings.
  • Use the same Authorization: Bearer <YOUR_API_KEY> and Content-Type: application/json headers you already know.
  • Point compatible clients at https://routerbase.com/v1.
  • Try models such as Gemini, Claude, GPT, DeepSeek, Mistral, and more from one account.

Learn more at RouterBase or read the docs at docs.routerbase.com.

Install

npm install routerbase-quickstart

CLI

Set your API key:

export ROUTERBASE_API_KEY="sk-rb-..."

Ask a quick question:

npx routerbase-quickstart --prompt "Write a one sentence product tagline for RouterBase"

Choose a model:

npx routerbase-quickstart --model google/gemini-2.5-flash --prompt "What is 2+2?"

Print the raw JSON response:

npx routerbase-quickstart --json --prompt "Return a tiny JSON object"

JavaScript

import { chatCompletion } from "routerbase-quickstart";

const response = await chatCompletion({
  apiKey: process.env.ROUTERBASE_API_KEY,
  model: "google/gemini-2.5-flash",
  messages: [
    { role: "user", content: "Write a haiku about routing AI models." }
  ]
});

console.log(response.choices[0].message.content);

API

chatCompletion(options)

Sends a POST /chat/completions request to the RouterBase OpenAI-compatible API.

Options:

  • apiKey: RouterBase API key. Defaults to process.env.ROUTERBASE_API_KEY.
  • baseURL: Defaults to https://routerbase.com/v1.
  • model: Defaults to google/gemini-2.5-flash.
  • messages: Required OpenAI-style message array.
  • Any other fields are forwarded to the RouterBase API body, such as temperature, max_tokens, stream, tools, or response_format.

createRouterBaseClient(options)

Creates a tiny client wrapper:

import { createRouterBaseClient } from "routerbase-quickstart";

const routerbase = createRouterBaseClient({
  apiKey: process.env.ROUTERBASE_API_KEY
});

const response = await routerbase.chat.completions.create({
  model: "google/gemini-2.5-flash",
  messages: [{ role: "user", content: "Hello RouterBase" }]
});

Notes

This is a lightweight community quickstart. For full API details, model availability, pricing, and production guidance, use the official RouterBase documentation: