First month for free!

Get started

  Overview
Stable Diffusion XL API

Stable Diffusion XL API

Create high-quality AI images through our API.

Lowest price on the market - 100 images for just $0.50

Stable Diffusion XL (SDXL) is a state-of-the-art image generation model that can generate high-quality images from text prompts in just a few seconds. With a few lines of code, our easy-to-use API enables you to generate realistic photos, illustrations, paintings, and more. See below for examples of what you can create with our SDXL API.

API Usage

To use our text-to-image API send a POST request to https://api.lemonfox.ai/v1/images/generations. If you haven't already, you will need to create an API key to authenticate your requests.

fetch('https://api.lemonfox.ai/v1/images/generations', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    prompt: "photo of a cat"
  })
})
.then(response => response.json())
.then(data => {
  console.log(data[0].url);
})
.catch(error => {
  console.error('Error:', error);
});

API Response

Image URLs remain accessible for a 12-hour window, after which they will be removed from our servers.

{
  "created": 1698265325,
  "data": [
    { 
      "url": "https://output.lemonfox.ai/images/f3a45520-1da4-4126-b924-22ab3818f91b.png" 
    }
  ]
}

API Parameters

The API POST https://api.lemonfox.ai/v1/images/generations takes the following parameters:

SDXL Prompt Examples

Start Your Free Trial