Image Generation API

Create stunning, high-quality images, graphics, and illustrations in a few seconds using Stable Diffusion XL.
Our Image Generation API allows you to programmatically generate visual content for your applications, providing fine-grained control over style, aspect ratio, and composition.

Quick Start

Endpoint

POST https://sonna.web.id/api/v1/images/generations

Authentication

bash
curl -X POST https://sonna.web.id/api/v1/images/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "sdxl",
    "prompt": "A futuristic city under a neon sunset, cinematic lighting, ultra detailed",
    "n": 1,
    "size": "1024x1024"
  }'

Request Parameters

ParameterTypeRequiredDescription
modelstringYesThe model ID. Use sdxl for high-quality generations.
promptstringYesA text description of the desired image.
nintegerNoThe number of images to generate. Default is 1.
sizestringNoThe resolution of the generated images (1024x1024, 512x512).

Response

json
{
  "created": 1677652288,
  "data": [
    {
      "url": "https://sonna.web.id/generated-images/img-99.png"
    }
  ]
}

Any questions? Email us at hello@sonna.ai