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.
- 1Create an API keySign in, open API keys, create one. It starts with rw_live_ and is shown once.
- 2Try a model in the browserEvery model page has a playground and ready-made API code for that model.
- 3Connect your coding agentClaude Code, Cursor or VS Code read the catalog and docs over MCP.
https://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.
| Endpoint | What it does | Key scope | OpenAI SDK | Models now | Docs |
|---|---|---|---|---|---|
POST /chat/completions | Chat with streaming, tools and JSON output | chat | chat.completions.create | 28 | Docs |
POST /images/generations | Images from a prompt | images | images.generate | 77 | Docs |
POST /videos/generations | Video jobs, result via /jobs | video | Railwail only | 33 | Docs |
POST /audio/speech | Text to speech, returns audio | audio | audio.speech.create | 2 | Docs |
POST /audio/transcriptions | Speech to text from an audio file | audio | audio.transcriptions.create | 2 | Docs |
POST /embeddings | Vector embeddings for search and retrieval | embeddings | embeddings.create | 2 | Docs |
GET /models | The catalog, public without a key | none (read with a key) | models.list | — | Docs |
GET /jobs/{id} | Status and result of a run | jobs or the run's scope | — | — | Docs |
New keys can read and chat, nothing else
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.
curl https://railwail.com/api/v1/chat/completions \
-H "Authorization: Bearer $RAILWAIL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o-mini",
"messages": [{"role": "user", "content": "Explain vector databases in two sentences."}],
"max_tokens": 300
}'# pip install openai
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["RAILWAIL_API_KEY"],
base_url="https://railwail.com/api/v1",
)
completion = client.chat.completions.create(
model="gpt-4o-mini",
messages=[{"role": "user", "content": "Explain vector databases in two sentences."}],
max_tokens=300,
)
print(completion.choices[0].message.content)// 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);// npm i railwail (ESM: save as .mjs)
import railwail from "railwail";
const rw = railwail(process.env.RAILWAIL_API_KEY);
const reply = await rw.run("gpt-4o-mini", "Explain vector databases in two sentences.", {
max_tokens: 300,
});
console.log(reply);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.
Text & chat
28 modelsImages
77 modelsEverything else
Music, upscaling, background removal and more run in the browser from their model pages. Filter the catalog by task, price and provider.
SDKs and tools
OpenAI SDKs (Python, Node)
Set base_url and your rw_live_ key. Chat with streaming, tools and JSON output, images and audio work with the SDK you already use.
railwail npm SDK
railwail 1.0.0: chat, image, embed, models and jobs in a few lines. No streaming, tools, video or audio; use the OpenAI SDK or REST for those.
MCP server for agents
Your coding agent searches models, compares prices and reads these docs through one MCP endpoint. No key needed to read.
Public catalog API
GET /api/v1/models lists models with prices in credits. No key required; handy for model pickers in your own UI.
rw.run() picks the endpoint from the model name
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_tokenslow while you test on them.