TL;DR โ Switch in Under 10 Minutes
- Drop multipart/form-data uploads to api.stability.ai โ use the OpenAI images.generate API
- Stable Diffusion 3.5 Large, Medium, SDXL, Stable Image Ultra, Stable Video all available
- Standard JSON request body instead of form-data
- EU-hosted endpoint, EUR billing
- Plus access to Flux, DALL-E 3, GPT-4o, Claude on the same key
Why Move Off Stability AI Platform?
Stability's REST API for SD 3.5 and Stable Image works but uses multipart/form-data and a custom credit accounting scheme that does not match the rest of your AI stack. Railwail exposes the same models behind the OpenAI Chat / Images API with simple JSON requests and per-call pricing.
Step 1 โ Get a Railwail API Key
Sign up at railwail.com and generate a key.
Sponsored
Access 100+ AI Models with One API Key
GPT-4o, Claude, Gemini, Llama, Flux, DALL-E and more โ all through a single, OpenAI-compatible endpoint. No more juggling multiple providers.
Step 2 โ Replace form-data with JSON
TypeScript / JavaScript
Before (Stability):
const form = new FormData();
form.append("prompt", "a cyberpunk city at sunset");
form.append("output_format", "webp");
form.append("aspect_ratio", "16:9");
const res = await fetch("https://api.stability.ai/v2beta/stable-image/generate/sd3", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.STABILITY_API_KEY}`,
Accept: "image/*",
},
body: form,
});
const buf = Buffer.from(await res.arrayBuffer());After (Railwail):import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.RAILWAIL_API_KEY,
baseURL: "https://api.railwail.com/v1",
});
const res = await client.images.generate({
model: "stable-diffusion-3.5-large",
prompt: "a cyberpunk city at sunset",
size: "1792x1024",
response_format: "url",
});
console.log(res.data[0].url);Python
from openai import OpenAI
client = OpenAI(
api_key=os.environ["RAILWAIL_API_KEY"],
base_url="https://api.railwail.com/v1",
)
resp = client.images.generate(
model="stable-diffusion-3.5-large",
prompt="a cyberpunk city at sunset",
size="1792x1024",
)
print(resp.data[0].url)cURL
curl https://api.railwail.com/v1/images/generations \
-H "Authorization: Bearer $RAILWAIL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "stable-diffusion-3.5-large",
"prompt": "a cyberpunk city at sunset",
"size": "1792x1024"
}'API Endpoint Mapping
Stability endpoint โ Railwail equivalent
| Stability AI | Railwail | Notes |
|---|---|---|
| POST /v2beta/stable-image/generate/sd3 | POST /v1/images/generations (model=stable-diffusion-3.5-*) | T2I |
| POST /v2beta/stable-image/generate/ultra | POST /v1/images/generations (model=stable-image-ultra) | Ultra quality |
| POST /v2beta/stable-image/generate/core | POST /v1/images/generations (model=stable-image-core) | Core |
| POST /v2beta/stable-image/edit/inpaint | POST /v1/images/edits | Inpainting |
| POST /v2beta/stable-image/edit/outpaint | POST /v1/images/edits | Outpainting |
| POST /v2beta/stable-image/control/sketch | POST /v1/images/edits (mode=sketch) | ControlNet |
| POST /v2beta/image-to-video | POST /v1/videos (model=stable-video-diffusion) | I2V |
Model Mapping
Stability model โ Railwail
| Stability AI | Railwail | Notes |
|---|---|---|
| sd3.5-large | stable-diffusion-3.5-large | Frontier |
| sd3.5-medium | stable-diffusion-3.5-medium | Mid |
| sd3.5-large-turbo | stable-diffusion-3.5-large-turbo | Fast |
| sdxl-1.0 | sdxl | Legacy |
| stable-image-ultra | stable-image-ultra | Best quality |
| stable-image-core | stable-image-core | Cheaper |
| stable-video-diffusion | stable-video-diffusion | I2V |
Sponsored
Test Any AI Model Instantly
Our built-in playground lets you compare models side by side. Find the perfect model for your use case in minutes, not days.
Pricing Comparison (per image, May 2026)
Same Stability model, Railwail in EUR
| Model | Stability (USD) | Railwail (EUR) | Notes |
|---|---|---|---|
| stable-diffusion-3.5-large | $0.065 | EUR 0.060 | Identical |
| stable-diffusion-3.5-medium | $0.035 | EUR 0.032 | Identical |
| stable-image-ultra | $0.08 | EUR 0.074 | Identical |
| stable-image-core | $0.03 | EUR 0.028 | Identical |
| sdxl per image | $0.0035 | EUR 0.0032 | Identical |
| stable-video-diffusion 5s | $0.20 | EUR 0.18 | Identical |
Why Railwail Over Stability AI Direct
- EU hosting and EUR billing
- Simple JSON requests instead of multipart/form-data
- Standard OpenAI images.generate / images.edits API
- Adds Flux Pro, DALL-E 3 โ Stability has only Stable Diffusion family
- Same per-image pricing
- Built-in playground for prompt iteration
FAQ
Are inpaint and outpaint supported?
Yes. Use POST /v1/images/edits with a base image and mask. Pass mode: 'inpaint' or 'outpaint' as an extension parameter.
What about ControlNet (sketch, structure, depth)?
ControlNet modes are accessible via POST /v1/images/edits with mode: 'sketch', 'structure', 'depth' and the appropriate control_image.
Can I do batch generation?
Yes. Pass n: 4 in the request to get 4 images in one call. Pricing scales linearly per image.
Is the negative_prompt supported?
Yes. Pass negative_prompt as an extension parameter.
What about Stable Audio?
Stable Audio 2.0 is available as stable-audio-2-0 via POST /v1/audio/generations (text-to-music).
Sponsored
Pay Only for What You Use
Transparent per-token pricing with no monthly minimums. Start with free credits and scale as you grow.
Next Steps
- Sign up at railwail.com
- Generate an API key
- Replace multipart/form-data calls with the OpenAI images SDK
- Use stable-diffusion-3.5-large etc. as model IDs
- Read the reference at railwail.com/docs
- Compare pricing at railwail.com/pricing