First month for free!

Get started

  Overview

Image Generation API

Create high-quality AI images through our API.

100 images from just $0.50 – 40x cheaper than GPT Image 2

Our text-to-image API generates high-quality images from text prompts in just a few seconds. With a few lines of code, you can create realistic photos, illustrations, paintings, and more. Use z-image when quality matters most, or sdxl for cost-sensitive workloads. See below for examples of what you can create.

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",
    model: "z-image"
  })
})
.then(response => response.json())
.then(data => {
  console.log(data.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:

The image generation model to use. Currently supported:

z-image — Recommended for high-quality results. 50 images for $0.50.

sdxl — Stable Diffusion XL. Best for cost-sensitive workloads. 100 images for $0.50.

Prompt Examples

Start Your Free Trial