SDXL 1.0 API, SDXL Turbo, 1.0 Lightning (Free) API - AI Image Generation APIs

by Stability AI

SDXL 1.0 API, developers can access SDXL variants including Lightning and Turbo for different speed and quality tradeoffs. The API supports the widely-adopted SDXL ecosystem, ensuring compatibility with existing workflows and fine-tuned models.

Get API Key
SDXL API

Models Version

LIMITED TIME OFFER

Get $5 Free Credit on First Payment

No strings attached — add funds and get $5 bonus instantly

Claim Your $5 →

SDXL Turbo Text to Image API Documentation

Request Code

POST https://gateway.pixazo.ai/sdxlTurbo/v2/getData
Content-Type: application/json
Cache-Control: no-cache
Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY

{
  "prompt": "Create a detailed illustration of a sparrow perched on a branch. The bird should be depicted with its distinctive brown and gray feathers, a small beak, and bright, curious eyes. Surround the sparrow with a vibrant background of spring leaves and soft sunlight filtering through the trees, capturing the essence of a tranquil morning in nature.",
  "height": 768,
  "width": 768,
  "num_inference_steps": 50,
  "guidance_scale": 7.5,
  "seed": 42
}
import requests

url = "https://gateway.pixazo.ai/sdxlTurbo/v2/getData"
headers = {
    "Content-Type": "application/json",
    "Cache-Control": "no-cache",
    "Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY"
}
data = {
    "prompt": "Create a detailed illustration of a sparrow perched on a branch. The bird should be depicted with its distinctive brown and gray feathers, a small beak, and bright, curious eyes. Surround the sparrow with a vibrant background of spring leaves and soft sunlight filtering through the trees, capturing the essence of a tranquil morning in nature.",
    "height": 768,
    "width": 768,
    "num_inference_steps": 50,
    "guidance_scale": 7.5,
    "seed": 42
}

response = requests.post(url, json=data, headers=headers)
print(response.json())
const url = "https://gateway.pixazo.ai/sdxlTurbo/v2/getData";
const headers = {
  "Content-Type": "application/json",
  "Cache-Control": "no-cache",
  "Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY"
};
const data = {
  "prompt": "Create a detailed illustration of a sparrow perched on a branch. The bird should be depicted with its distinctive brown and gray feathers, a small beak, and bright, curious eyes. Surround the sparrow with a vibrant background of spring leaves and soft sunlight filtering through the trees, capturing the essence of a tranquil morning in nature.",
  "height": 768,
  "width": 768,
  "num_inference_steps": 50,
  "guidance_scale": 7.5,
  "seed": 42
};

fetch(url, {
  method: "POST",
  headers: headers,
  body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error("Error:", error));
curl -v -X POST "https://gateway.pixazo.ai/sdxlTurbo/v2/getData" \
  -H "Content-Type: application/json" \
  -H "Cache-Control: no-cache" \
  -H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \
  --data-raw '{
    "prompt": "Create a detailed illustration of a sparrow perched on a branch. The bird should be depicted with its distinctive brown and gray feathers, a small beak, and bright, curious eyes. Surround the sparrow with a vibrant background of spring leaves and soft sunlight filtering through the trees, capturing the essence of a tranquil morning in nature.",
    "height": 768,
    "width": 768,
    "num_inference_steps": 50,
    "guidance_scale": 7.5,
    "seed": 42
  }'

Output

{
  "output": "https://d3re0c8wemxg38.cloudfront.net/output_mme/8891449d-7bbd-4150-9a56-86ff51378640.jpeg",
  "status": "complete",
  "message": "In progress"
}

Request Parameters - SDXL Turbo Get Image

Parameter Required Type Description
prompt Yes string The text query that instructs the AI model on what kind of content to generate. In this case, "Create a detailed illustration of a sparrow perched on a branch..."
height No integer The height in pixels of the generated image. Default: 768
width No integer The width in pixels of the generated image. Default: 768
num_inference_steps Yes integer The number of diffusion steps; higher values can improve quality but take longer. Minimum: 1, Maximum: 50
guidance_scale Yes float Determines the adherence to the prompt; higher values encourage better alignment with the prompt. Minimum: 0, Maximum: 15
seed No integer A seed for random number generation to ensure reproducibility of the results. Default is usually set by the system if not specified

Example Request

{
  "prompt": "Create a detailed illustration of a sparrow perched on a branch. The bird should be depicted with its distinctive brown and gray feathers, a small beak, and bright, curious eyes. Surround the sparrow with a vibrant background of spring leaves and soft sunlight filtering through the trees, capturing the essence of a tranquil morning in nature.",
  "height": 768,
  "width": 768,
  "num_inference_steps": 50,
  "guidance_scale": 7.5,
  "seed": 42
}

Response

{
  "output": "https://d3re0c8wemxg38.cloudfront.net/output_mme/8891449d-7bbd-4150-9a56-86ff51378640.jpeg",
  "status": "complete",
  "message": "In progress"
}

Request Headers

Header Value
Content-Type application/json
Cache-Control no-cache
Ocp-Apim-Subscription-Key YOUR_SUBSCRIPTION_KEY

Response Handling

Common status codes for SDXL Turbo Get Image.

Code Meaning
200 Success
Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
Too Many Requests
500 Internal Server Error

SDXL Turbo Text to Image API Pricing

ResolutionPrice (USD)
All Resolution$0
2. SDXL Base 1.0

SDXL Base 1.0 Text to Image API Documentation

Request Code

POST https://gateway.pixazo.ai/getImage/v1/getSDXLImage
Content-Type: application/json
Cache-Control: no-cache
Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY

{
  "prompt": "High-resolution, realistic image of a sparrow bird perched on a blooming cherry blossom branch during springtime. The sparrow feathers should be finely detailed with natural colors, including shades of brown and white. The background should be soft-focused with a clear blue sky, creating a serene and peaceful atmosphere.",
  "negative_prompt": "Low-quality, blurry image, with any other birds or animals. Avoid abstract or cartoonish styles, dark or gloomy atmosphere, unnecessary objects or distractions in the background, harsh lighting, and unnatural colors.",
  "height": 1024,
  "width": 1024,
  "num_steps": 20,
  "guidance_scale": 5,
  "seed": 40
}
import requests

url = "https://gateway.pixazo.ai/getImage/v1/getSDXLImage"
headers = {
    "Content-Type": "application/json",
    "Cache-Control": "no-cache",
    "Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY"
}
data = {
    "prompt": "High-resolution, realistic image of a sparrow bird perched on a blooming cherry blossom branch during springtime. The sparrow feathers should be finely detailed with natural colors, including shades of brown and white. The background should be soft-focused with a clear blue sky, creating a serene and peaceful atmosphere.",
    "negative_prompt": "Low-quality, blurry image, with any other birds or animals. Avoid abstract or cartoonish styles, dark or gloomy atmosphere, unnecessary objects or distractions in the background, harsh lighting, and unnatural colors.",
    "height": 1024,
    "width": 1024,
    "num_steps": 20,
    "guidance_scale": 5,
    "seed": 40
}

response = requests.post(url, json=data, headers=headers)
print(response.json())
const url = 'https://gateway.pixazo.ai/getImage/v1/getSDXLImage';
const headers = {
  'Content-Type': 'application/json',
  'Cache-Control': 'no-cache',
  'Ocp-Apim-Subscription-Key': 'YOUR_SUBSCRIPTION_KEY'
};

const data = {
  prompt: 'High-resolution, realistic image of a sparrow bird perched on a blooming cherry blossom branch during springtime. The sparrow feathers should be finely detailed with natural colors, including shades of brown and white. The background should be soft-focused with a clear blue sky, creating a serene and peaceful atmosphere.',
  negative_prompt: 'Low-quality, blurry image, with any other birds or animals. Avoid abstract or cartoonish styles, dark or gloomy atmosphere, unnecessary objects or distractions in the background, harsh lighting, and unnatural colors.',
  height: 1024,
  width: 1024,
  num_steps: 20,
  guidance_scale: 5,
  seed: 40
};

fetch(url, {
  method: 'POST',
  headers: headers,
  body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
curl -v -X POST "https://gateway.pixazo.ai/getImage/v1/getSDXLImage" \
  -H "Content-Type: application/json" \
  -H "Cache-Control: no-cache" \
  -H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \
  --data-raw '{
    "prompt": "High-resolution, realistic image of a sparrow bird perched on a blooming cherry blossom branch during springtime. The sparrow feathers should be finely detailed with natural colors, including shades of brown and white. The background should be soft-focused with a clear blue sky, creating a serene and peaceful atmosphere.",
    "negative_prompt": "Low-quality, blurry image, with any other birds or animals. Avoid abstract or cartoonish styles, dark or gloomy atmosphere, unnecessary objects or distractions in the background, harsh lighting, and unnatural colors.",
    "height": 1024,
    "width": 1024,
    "num_steps": 20,
    "guidance_scale": 5,
    "seed": 40
  }'

Output

{
  "imageUrl": ""
}

Request Parameters - Get Image

Parameter Required Type Description
promptYesStringThe main instruction for the image generation
negative_promptNoStringA prompt to specify what should be avoided in the image
heightNoIntegerThe height of the output image (e.g., 1024)
widthNoIntegerThe width of the output image (e.g., 1024)
num_stepsNoIntegerThe number of steps for the generation process (e.g., 20)
guidance_scaleNoIntegerThe guidance scale for the generation (e.g., 5)
seedNoIntegerThe seed value for random number generation to ensure reproducibility

Example Request

{
  "prompt": "High-resolution, realistic image of a sparrow bird perched on a blooming cherry blossom branch during springtime. The sparrow feathers should be finely detailed with natural colors, including shades of brown and white. The background should be soft-focused with a clear blue sky, creating a serene and peaceful atmosphere.",
  "negative_prompt": "Low-quality, blurry image, with any other birds or animals. Avoid abstract or cartoonish styles, dark or gloomy atmosphere, unnecessary objects or distractions in the background, harsh lighting, and unnatural colors.",
  "height": 1024,
  "width": 1024,
  "num_steps": 20,
  "guidance_scale": 5,
  "seed": 40
}

Response

{
  "imageUrl": ""
}

Request Headers

Header Value
Content-Typeapplication/json
Cache-Controlno-cache
Ocp-Apim-Subscription-KeyYOUR_SUBSCRIPTION_KEY

Response Handling

Common status codes for Get Image.

Code Meaning
200 Success
Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
Too Many Requests
500 Internal Server Error

SDXL Base 1.0 Text to Image API Pricing

ResolutionPrice (USD)
All Resolution$0
3. SDXL Lightning

SDXL Lightning Text to Image API Documentation

Request Code

POST https://gateway.pixazo.ai/sdxl_lightning/getImage/v1/getSDXLImage
Content-Type: application/json
Cache-Control: no-cache
Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY

{
  "prompt": "High-resolution, realistic image of a sparrow bird perched on a blooming cherry blossom branch during springtime. The sparrow feathers should be finely detailed with natural colors, including shades of brown and white. The background should be soft-focused with a clear blue sky, creating a serene and peaceful atmosphere.",
  "negativePrompt": "Low-quality, blurry image, with any other birds or animals. Avoid abstract or cartoonish styles, dark or gloomy atmosphere, unnecessary objects or distractions in the background, harsh lighting, and unnatural colors.",
  "height": 1024,
  "width": 1024,
  "num_steps": 20,
  "guidance": 5,
  "seed": 42
}
import requests

url = "https://gateway.pixazo.ai/sdxl_lightning/getImage/v1/getSDXLImage"
headers = {
    "Content-Type": "application/json",
    "Cache-Control": "no-cache",
    "Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY"
}
data = {
    "prompt": "High-resolution, realistic image of a sparrow bird perched on a blooming cherry blossom branch during springtime. The sparrow feathers should be finely detailed with natural colors, including shades of brown and white. The background should be soft-focused with a clear blue sky, creating a serene and peaceful atmosphere.",
    "negativePrompt": "Low-quality, blurry image, with any other birds or animals. Avoid abstract or cartoonish styles, dark or gloomy atmosphere, unnecessary objects or distractions in the background, harsh lighting, and unnatural colors.",
    "height": 1024,
    "width": 1024,
    "num_steps": 20,
    "guidance": 5,
    "seed": 42
}

response = requests.post(url, json=data, headers=headers)
print(response.json())
fetch('https://gateway.pixazo.ai/sdxl_lightning/getImage/v1/getSDXLImage', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Cache-Control': 'no-cache',
    'Ocp-Apim-Subscription-Key': 'YOUR_SUBSCRIPTION_KEY'
  },
  body: JSON.stringify({
    prompt: "High-resolution, realistic image of a sparrow bird perched on a blooming cherry blossom branch during springtime. The sparrow feathers should be finely detailed with natural colors, including shades of brown and white. The background should be soft-focused with a clear blue sky, creating a serene and peaceful atmosphere.",
    negativePrompt: "Low-quality, blurry image, with any other birds or animals. Avoid abstract or cartoonish styles, dark or gloomy atmosphere, unnecessary objects or distractions in the background, harsh lighting, and unnatural colors.",
    height: 1024,
    width: 1024,
    num_steps: 20,
    guidance: 5,
    seed: 42
  })
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
curl -v -X POST "https://gateway.pixazo.ai/sdxl_lightning/getImage/v1/getSDXLImage" \
  -H "Content-Type: application/json" \
  -H "Cache-Control: no-cache" \
  -H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \
  --data-raw '{
    "prompt": "High-resolution, realistic image of a sparrow bird perched on a blooming cherry blossom branch during springtime. The sparrow feathers should be finely detailed with natural colors, including shades of brown and white. The background should be soft-focused with a clear blue sky, creating a serene and peaceful atmosphere.",
    "negativePrompt": "Low-quality, blurry image, with any other birds or animals. Avoid abstract or cartoonish styles, dark or gloomy atmosphere, unnecessary objects or distractions in the background, harsh lighting, and unnatural colors.",
    "height": 1024,
    "width": 1024,
    "num_steps": 20,
    "guidance": 5,
    "seed": 42
  }'

Output

{
  "imageUrl": ""
}

Request Parameters - Get Image

Parameter Required Type Description
promptYesStringThe main instruction for the image generation
negativePromptNoStringA prompt to specify what should be avoided in the image
heightNoIntegerThe height of the output image (e.g., 1024)
widthNoIntegerThe width of the output image (e.g., 1024)
num_stepsNoIntegerThe number of steps for the generation process (e.g., 20)
guidanceNoIntegerThe guidance scale for the generation (e.g., 5)
seedNoIntegerThe seed value for random number generation to ensure reproducibility

Example Request

{
  "prompt": "High-resolution, realistic image of a sparrow bird perched on a blooming cherry blossom branch during springtime. The sparrow feathers should be finely detailed with natural colors, including shades of brown and white. The background should be soft-focused with a clear blue sky, creating a serene and peaceful atmosphere.",
  "negativePrompt": "Low-quality, blurry image, with any other birds or animals. Avoid abstract or cartoonish styles, dark or gloomy atmosphere, unnecessary objects or distractions in the background, harsh lighting, and unnatural colors.",
  "height": 1024,
  "width": 1024,
  "num_steps": 20,
  "guidance": 5,
  "seed": 42
}

Response

{
  "imageUrl": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/sdxl_lightning/prompt-355182775-1724841428119-422172.png"
}

Request Headers

Header Value
Content-Typeapplication/json
Cache-Controlno-cache
Ocp-Apim-Subscription-KeyYOUR_SUBSCRIPTION_KEY

Response Handling

Common status codes for Get Image.

Code Meaning
200 Success
Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
Too Many Requests
500 Internal Server Error

SDXL Lightning Text to Image API Pricing

ResolutionPrice (USD)
All Resolution$0