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, 3.5 Large Turbo and SDXL available
- Standard JSON request body instead of form-data
- Plus access to Flux, GPT-4o, Claude on the same key
Stability AI's 8B MMDiT-based flagship. Open weights at 1MP with improved typography and prompt adherence over SDXL. The largest model in the SD 3.5 release line.
Models in this article
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 SD 3.5 and SDXL behind the OpenAI Chat / Images API with simple JSON requests.
Step 1 — Get a Railwail API Key
Sign up at railwail.com and generate a key.
Step 2 — Replace form-data with JSON
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://railwail.com/api/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);from openai import OpenAI
client = OpenAI(
api_key=os.environ["RAILWAIL_API_KEY"],
base_url="https://railwail.com/api/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 https://railwail.com/api/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
Model Mapping
Why Railwail Over Stability AI Direct
- Simple JSON requests instead of multipart/form-data
- Standard OpenAI images.generate API
- Adds Flux Pro — Stability has only Stable Diffusion family
- Built-in playground for prompt iteration
FAQ
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.
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
Models in this article
Live prices from Railwail's current rules, 29 листопада 2026 р..
- Stable Diffusion 3.5 LargeStability AI0,078 USD за зображенняTry
- Stable Diffusion 3Stability AI0,042 USD за зображенняTry
- Stable Diffusion 3.5 Large TurboStability AI0,048 USD за зображенняTry
- Stable Diffusion XLStability AI≈ 0,0015 USD за запускTry
- GPT-4oOpenAI3,00 USD / 1M вхідних токенів12,00 USD/1M вих1K in + 500 out tokens: ≈ 0,0090 USDTry
- Flux ProBlack Forest Labs0,066 USD за зображенняTry
≈ billed by actual tokens or GPU time
Next step
Try Stable Diffusion 3.5 Large on Railwail
Sign in with Google for 10 free credits (usable 24 hours after sign-up, runs up to 2 credits), or top up from 5,00 USD. Unused balance does not expire.