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, October 7, 2026.
- Stable Diffusion 3.5 LargeStability AI$0.078 per imageTry
- Stable Diffusion 3Stability AI$0.042 per imageTry
- Stable Diffusion 3.5 Large TurboStability AI$0.048 per imageTry
- Stable Diffusion XLStability AIโ $0.0015 per runTry
- GPT-4oOpenAI$3.00 / 1M input tokens$12.00/1M out1K in + 500 out tokens: โ $0.0090Try
- Flux ProBlack Forest Labs$0.066 per imageTry
โ 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. Unused balance does not expire.