Stability AI REST API
Generate and edit images with AI-powered REST API
Stability AI provides a REST API for generating, editing, and enhancing images using state-of-the-art AI models including Stable Diffusion. Developers use it to integrate text-to-image generation, image-to-image transformation, upscaling, and inpainting capabilities into applications for creative workflows, content generation, and automated design processes.
https://api.stability.ai/v1
API Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /generation/stable-diffusion-xl-1024-v1-0/text-to-image | Generate images from text prompts using Stable Diffusion XL |
| POST | /generation/stable-diffusion-xl-1024-v1-0/image-to-image | Transform existing images based on text prompts |
| POST | /generation/stable-diffusion-xl-1024-v1-0/image-to-image/upscale | Upscale images using AI-powered enhancement |
| POST | /generation/stable-diffusion-xl-1024-v1-0/image-to-image/masking | Inpaint or edit specific parts of an image using masks |
| GET | /engines/list | List all available AI generation engines and models |
| GET | /user/account | Retrieve account information and credit balance |
| GET | /user/balance | Get current API credit balance |
| POST | /generation/stable-diffusion-v1-6/text-to-image | Generate images using Stable Diffusion v1.6 model |
| POST | /generation/esrgan-v1-x2plus/image-to-image/upscale | Upscale images by 2x using ESRGAN model |
| POST | /generation/stable-diffusion-xl-beta-v2-2-2/text-to-image | Generate images using SDXL Beta v2.2.2 for experimental features |
| POST | /generation/stable-diffusion-512-v2-1/text-to-image | Generate 512x512 images using Stable Diffusion v2.1 |
| DELETE | /generation/{generation_id} | Cancel an in-progress image generation request |
Sponsor this page
AvailableReach developers actively building with Stability AI. See live pageview data and self-serve checkout — your slot goes live in minutes.
View inventory & pricing →Code Examples
curl -X POST https://api.stability.ai/v1/generation/stable-diffusion-xl-1024-v1-0/text-to-image \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer sk-your-api-key-here' \
-d '{
"text_prompts": [
{
"text": "A serene landscape with mountains and lake at sunset",
"weight": 1
}
],
"cfg_scale": 7,
"height": 1024,
"width": 1024,
"steps": 30,
"samples": 1
}'
Use Stability AI from Claude / Cursor / ChatGPT
Get a hosted MCP endpoint for Stability AI. Paste your Stability AI API key, copy back one URL, drop it into Claude Desktop, Cursor, or any AI client that supports remote MCP. Your AI calls Stability AI directly with your credentials — no local install, works on mobile.
generate_image_from_text
Generate AI images from natural language descriptions using Stable Diffusion models
transform_image
Modify existing images based on text prompts while preserving structure
upscale_image
Enhance and upscale images using AI-powered super-resolution
inpaint_image
Edit specific regions of images using masks and text prompts
list_available_models
Retrieve information about available generation engines and their capabilities
Connect in 60 seconds
Paste your Stability AI key → get an MCP URL → paste into Claude/Cursor. Hosted by IOX, encrypted at rest.
Connect Stability AI to your AI →