Build with Railwail
One API to access 100+ AI models. Text, images, video, audio — all with a single API key. No need to manage multiple providers or learn different SDKs.
npm install railwailBase URL
https://railwail.com/api/v1. The SDK handles this automatically.Get Started
Everything you need to start building with Railwail.
Quick Start
Get up and running in under a minute with your first API call.
Authentication
Learn how to authenticate your requests with API keys.
SDK Reference
Full reference for all SDK methods — run, chat, image, embed, and more.
OpenAI Compatibility
Use the OpenAI SDK with Railwail as a drop-in replacement.
What You Can Build
Railwail gives you access to every major AI capability through a unified interface.
Text & Chat
GPT-4o, Claude, Gemini, Llama, DeepSeek, and dozens more chat models.
Image Generation
Flux, DALL-E 3, Stable Diffusion, Ideogram, Recraft, and more image models.
Embeddings
text-embedding-3, Nomic, BGE — generate vector embeddings for search and RAG.
How It Works
Railwail acts as a universal gateway to AI models. You send requests through one API, and Railwail routes them to the right provider.
import railwail from "railwail";
const rw = railwail("rw_live_xxxxx");
// Text — automatically routes to the chat endpoint
const reply = await rw.run("gpt-4o", "Explain quantum computing");
// Images — automatically routes to the image endpoint
const images = await rw.run("flux-schnell", "A sunset over Tokyo");
// Embeddings — explicitly set the type
const vectors = await rw.run("text-embedding-3-small", "Hello", { type: "embed" });Smart routing
rw.run() method auto-detects whether your model is a text, image, or embedding model and routes to the correct endpoint. You can also use the specific methods (rw.chat(), rw.image(), rw.embed()) for full control over the response format.