Skip to content
Stable Diffusion API

Stable Diffusion API Overview

Overview of the Stable Diffusion API — endpoints, authentication, request structure, and supported models.

What is the Stable Diffusion API?

The Stable Diffusion API is a REST API for generating images using Stable Diffusion 1.5, SDXL, Flux, ControlNet, LoRA, and 1,000+ community models — all without managing GPU infrastructure.

Authentication

Every request requires an API key. Get yours at modelslab.com/register — the free tier includes 20 image generations.

{
  "key": "YOUR_API_KEY",
  "model_id": "sd-1.5",
  "prompt": "..."
}

Available endpoints

Response format

Responses are JSON. Successful generations return an array of image URLs in the output field. Async requests return a fetch_result URL to poll.

Rate limits

Rate limits vary by plan. Free tier: 20 generations total. Paid plans (from $8/mo) include unlimited generations with concurrent-request limits per tier.

Error handling

The API returns standard HTTP status codes. 401 for invalid keys, 429 for rate-limit, 5xx for server errors. Retry with exponential backoff for transient failures.