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

railwail

v1.0.0

Published

Official SDK for the Railwail API — run 100+ AI models (text, image, video, audio) with one simple call.

Downloads

90

Readme

railwail

Official SDK for the Railwail API — run 100+ AI models (text, image, video, audio) with one simple call.

Install

npm install railwail

Quick Start

import railwail from "railwail";

const rw = railwail("rw_live_your_api_key");

// Text generation
const text = await rw.run("gpt-4", "Explain quantum computing in one sentence");
console.log(text);

// Image generation
const images = await rw.run("flux-schnell", "A sunset over Tokyo, studio ghibli style");
console.log(images[0].url);

// Embeddings
const vectors = await rw.run("text-embedding-3-small", "Hello world", { type: "embed" });

Get your API key at railwail.com/settings/api-keys.

Usage

rw.run(model, input, options?) — Universal

Auto-detects the right endpoint based on the model name. Returns a string for text, an array of image objects for images, or embedding vectors.

// String prompt → chat completion, returns string
const reply = await rw.run("claude-3-opus", "Write a haiku about coding");

// Message array → chat completion with history
const reply = await rw.run("gpt-4", [
  { role: "system", content: "You are a pirate." },
  { role: "user", content: "Tell me a joke" },
]);

// Image model → returns ImageResult[]
const images = await rw.run("flux-schnell", "A cat astronaut");
console.log(images[0].url);

// Force a type with { type: "embed" | "image" | "chat" }
const vectors = await rw.run("text-embedding-3-small", "Hello", { type: "embed" });

rw.chat(model, messages, options?) — Chat Completions

Full OpenAI-compatible chat completions response.

const res = await rw.chat("gpt-4", [
  { role: "user", content: "Hello!" }
], {
  temperature: 0.7,
  max_tokens: 500,
});

console.log(res.choices[0].message.content);
console.log(res.usage); // { prompt_tokens, completion_tokens, total_tokens }

rw.image(model, prompt, options?) — Image Generation

const res = await rw.image("flux-schnell", "A cyberpunk cityscape", {
  size: "1024x1024",
  n: 2,
  negative_prompt: "blurry, low quality",
});

for (const img of res.data) {
  console.log(img.url);
}

rw.embed(model, input, options?) — Embeddings

const res = await rw.embed("text-embedding-3-small", ["Hello", "World"]);

for (const item of res.data) {
  console.log(item.embedding.length); // vector dimensions
}

rw.models(options?) — List Models

const all = await rw.models();
const imageModels = await rw.models({ category: "image" });
const featured = await rw.models({ featured: true, limit: 10 });

rw.model(slug) — Get Model Details

const model = await rw.model("flux-schnell");
console.log(model.name, model.pricing);

rw.job(id) — Check Job Status

const job = await rw.job("job_abc123");
console.log(job.status); // "completed" | "queued" | "processing" | "failed"

Options

import { Railwail } from "railwail";

const rw = new Railwail("rw_live_xxx", {
  baseUrl: "https://railwail.com",  // default
  timeout: 120000,                   // 2 min default
});

Error Handling

import { RailwailError } from "railwail";

try {
  await rw.run("gpt-4", "Hello");
} catch (err) {
  if (err instanceof RailwailError) {
    console.log(err.status);  // 401, 402, 429, etc.
    console.log(err.code);    // "invalid_api_key", "insufficient_credits", etc.
    console.log(err.message); // Human-readable error
  }
}

Available Models

Browse all models at railwail.com/models. Categories include:

  • Text & Chat — GPT-4, Claude, Gemini, Llama, Mistral, Qwen, DeepSeek
  • Image — Flux, DALL-E, Stable Diffusion, Ideogram, Recraft
  • Video — Sora, Runway, Kling, Luma
  • Audio — Suno, ElevenLabs, Whisper
  • Embeddings — text-embedding-3, Nomic, BGE
  • Code — Codestral, StarCoder, DeepSeek Coder

License

MIT