Skip to content

Text to Image

Generating high-quality images from natural language descriptions is easy with SIRAYA Model Router. Our unified API allows you to access various state-of-the-art image generation models using a single interface.

POST https://llm.siraya.ai/v1/images/generations
Authorization string Required
Your API Key (e.g., Bearer <API_KEY>).

Body

model string Required
The ID of the model to use (e.g. gpt-image-2, imagen-4.0-generate-001).
prompt string Required
A text description of the desired image.
n integer Default: 1
The number of images to generate (1-10).
size string
The dimensions of the generated image (e.g. 1024x1024, 1792x1024, 1024x1792).
quality string
The quality of the generated image. Possible values: standard, hd, low, medium, high.
style string
The style of the generated image. Possible values: vivid, natural.
response_format string
The format in which the generated image is returned. Possible values: b64_json, url.
user string
A unique identifier representing your end-user.
background string
The background type for the generated image. Possible values: transparent, opaque, auto.
output_compression integer
The compression level for the output image (0-100). Applicable to jpeg and webp formats.
moderation string
The content moderation level. Possible values: low, auto.
negative_prompt string
Negative prompt describing content to exclude from the generated image. Supported by Imagen models.
seed integer
Random seed for reproducibility. The same seed produces the same image. Supported by Imagen models.
A reference image for image-to-image generation (URL or base64 data URL). Supported by Seedream models.
sequential_image_generation string
Controls batch image generation mode. Possible values: auto, disabled. Supported by Seedream models.
extra_body object
Additional model-specific parameters passed directly to the provider. Unknown top-level fields are also automatically captured into this object.
curl https://llm.siraya.ai/v1/images/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <API_KEY>" \
  -d '{
    "model": "imagen-4.0-generate-001",
    "prompt": "A cat is playing piano in a cozy room"
  }'
import requests

url = "https://llm.siraya.ai/v1/images/generations"
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <API_KEY>"
}
data = {
    "model": "imagen-4.0-generate-001",
    "prompt": "A cat is playing piano in a cozy room",
}

response = requests.post(url, headers=headers, json=data)
print(response.json())

Example Response

{
    "created": 1774716098,
    "data": [
        {
            "b64_json": "iVBORw0KGgoAAAANSUhEUgAABAAAAAQACAIAAADwf7zUAAAAg3..."
        }
    ]
}

For a list of all available image models, visit the Models Directory.