Documentation

Build with Railwail

One API key and one balance for chat, image, video, speech, transcription and embedding models; the rest of the catalog (music, upscaling, background removal …) runs on the model pages. The API is OpenAI-compatible, so the official OpenAI SDKs work with a new base URL. There is also a small npm SDK and an MCP server that gives coding agents the catalog and these docs.

  1. 1Create an API keySign in, open API keys, create one. It starts with rw_live_ and is shown once.
  2. 2Try a model in the browserEvery model page has a playground and ready-made API code for that model.
  3. 3Connect your coding agentClaude Code, Cursor or VS Code read the catalog and docs over MCP.
Base URLhttps://railwail.com/api/v1Every request sends Authorization: Bearer rw_live_…; the public catalog and the MCP read tools also work without it.

What you can call

Every endpoint takes the same key. The last column counts the models each endpoint can run right now; it is computed from the live catalog, so it matches what the API accepts.

API endpoints
EndpointWhat it doesKey scopeOpenAI SDKModels nowDocs
POST /chat/completionsChat with streaming, tools and JSON outputchatchat.completions.create28Docs
POST /images/generationsImages from a promptimagesimages.generate77Docs
POST /videos/generationsVideo jobs, result via /jobsvideoRailwail only33Docs
POST /audio/speechText to speech, returns audioaudioaudio.speech.create2Docs
POST /audio/transcriptionsSpeech to text from an audio fileaudioaudio.transcriptions.create2Docs
POST /embeddingsVector embeddings for search and retrievalembeddingsembeddings.create2Docs
GET /modelsThe catalog, public without a keynone (read with a key)models.list—Docs
GET /jobs/{id}Status and result of a runjobs or the run's scope——Docs

New keys can read and chat, nothing else

A key starts with the scopes read and chat. For images, video, audio or embeddings tick those scopes (or all) when you create the key, otherwise the API answers 403 insufficient_scope. Details in Authentication.

Your first request

Put the key in RAILWAIL_API_KEY (see Quick Start) and run one of these. max_tokens keeps the reserved credits small, which also keeps the call inside the free trial limits.

// npm i openai   (ESM: save as .mjs)
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.RAILWAIL_API_KEY,
  baseURL: "https://railwail.com/api/v1",
});

const completion = await client.chat.completions.create({
  model: "gpt-4o-mini",
  messages: [{ role: "user", content: "Explain vector databases in two sentences." }],
  max_tokens: 300,
});
console.log(completion.choices[0].message.content);

What runs where

A few of the models each endpoint runs today, with real prices as charged. Every model page has its own playground and API code.

SDKs and tools

rw.run() picks the endpoint from the model name

The npm SDK's rw.run() guesses chat, image or embedding from the model slug, inside the SDK. Slugs it does not recognise go to chat; pass { type: "image" } to be explicit. See rw.run().

Prices, limits and the free trial

  • Prices are in US dollars; balances are credits (1 credit = USD 0.01). Every model page and the pricing page show the price per token, image, second or run.
  • Before a run the API estimates the price and holds it; token and GPU-time runs are settled to real usage afterwards. Failed runs are refunded automatically.
  • Each key has its own rate limit (default 600 requests per minute, 60 to 6,000 when you create it). See Rate limits.
  • Signing in with Google gives 10 free credits ($0.10), usable 24 hours after sign-up, for runs of up to 2 credits each. Keep max_tokens low while you test on them.