REST API
Models API
The public model catalog as JSON: names, categories, prices in credits, limits and configuration. No API key needed, which makes it handy for model pickers in your own product.
- List
- GET /api/v1/models
- One model
- GET /api/v1/models/{slug}
- Auth
- none (key optional)
- Cost
- free
Try it
A real request against the live catalog, straight from this page.
curl -s "https://railwail.com/api/v1/models?category=image&limit=3"Public endpoint: no key, no cost. Press “Send request” to see the live JSON.
List models
/api/v1/modelsQuery parameters
categoryproviderfeaturedinclude_unavailableavailable: false and the reason.Default falselimitall (≤ 500)offset0Unknown category or provider
400 invalid_request_error with the code invalid_category or invalid_provider; the message lists the allowed values.Examples
curl -s "https://railwail.com/api/v1/models?category=image&limit=10"# pip install requests
import requests
res = requests.get(
"https://railwail.com/api/v1/models",
params={"category": "image", "limit": 10},
timeout=30,
)
for model in res.json()["data"]:
print(model["id"], model["pricing"]["unit"], model["pricing"]["usd"])const res = await fetch("https://railwail.com/api/v1/models?category=image&limit=10");
const { data, has_more } = await res.json();
console.log(data.map((m) => m.id), has_more);import os
from openai import OpenAI
client = OpenAI(api_key=os.environ["RAILWAIL_API_KEY"], base_url="https://railwail.com/api/v1")
for model in client.models.list(): # every model the API can run, one page
print(model.id, model.owned_by)Response
Shape of the answer; values are placeholders.
{
"object": "list",
"data": [
{
"id": "<slug>",
"object": "model",
"created": <unix seconds>,
"owned_by": "<infrastructure provider, e.g. replicate>",
"name": "<display name>",
"description": "<short description>",
"category": "image",
"provider_model_id": "<id at the provider>",
"image": null,
"available": true,
"unavailable_reason": "<only when available is false>",
"use_instead": "<slug of a model that can run, when there is one>",
"lifecycle": { "status": "deprecated", "successor_slug": "<slug>" },
"pricing": {
"unit": "per_image",
"usd": <USD of one default call>,
"credits": <the same in credits>,
"basis": "<what usd is the price of>",
"credit_cost_input_per_1k": <credits, legacy>,
"credit_cost_output_per_1k": <credits, legacy>,
"credit_cost_fixed": <credits, legacy>,
"currency": "credits",
"credit_usd": <USD per credit>
},
"capabilities": { "context_window": <tokens | null>, "max_output_tokens": <tokens | null>, "supported_formats": [] },
"metadata": { "tags": [], "is_new": false, "is_featured": true, "avg_latency_ms": null, "estimated_duration_seconds": null }
}
],
"has_more": false,
"total": <number of models in this list>
}pricing.unit, usd and credits come from the pricing rule the API bills with (1 credit = USD 0.01). unit is one of per_token, per_image, per_video, per_output, per_second_of_output, per_1000_characters or per_gpu_second; token models have usd: null and carry input_usd_per_1m and output_usd_per_1m instead, GPU-time models the estimated seconds and the amount held up front. The credit_cost_* fields are older columns, kept for existing clients. lifecycle appears only for deprecated, removed or duplicate entries. id is the slug you pass as model everywhere else.
Get one model
/api/v1/models/{slug}Everything from the list plus long_description, configuration.input_schema (the model's inputs), configuration.default_params and examples. A provider model id also resolves, but can match several slugs, so use the slug.
curl -s "https://railwail.com/api/v1/models/flux-1-schnell"The list holds models that can run
?include_unavailable=true adds the rest with available: false, unavailable_reason and, when there is a runnable alternative, use_instead; calling such a model returns 503 model_unavailable. GET /api/v1/models/{slug} answers 200 with the same fields for every slug. With a key, the request needs the read scope (on by default) and counts toward the key's rate limit.