/v1/images/generations endpoint generates images from natural-language prompts using state-of-the-art diffusion models such as FLUX, all served from Meliai’s European provider network. The API is OpenAI-compatible, so you can use the official OpenAI SDK’s images.generate method by pointing it at Meliai’s base URL. Generated images are returned as either a URL or base64-encoded data, and every response includes the standard environment_impact and billing_cost fields.
Endpoint
Bearer sk-mel-<KEY> via Authorization header.
Parameters
string
required
The image generation model ID. FLUX-family models and other open-weight image models available on the Meliai network are listed under
GET /v1/models. Routing flavor suffixes such as :price are supported.string
required
A natural-language description of the image you want to generate. More specific, detailed prompts generally produce higher-quality results.
integer
Number of images to generate in a single request. Default:
1. Higher values multiply credit usage proportionally.string
Dimensions of the output image in
"WxH" format, e.g. "1024x1024", "1280x720". Available sizes depend on the model. Defaults to the model’s native resolution if omitted.string
How the generated image is returned:
"url"— a temporary URL pointing to the image (default)"b64_json"— the image encoded as a base64 string inside the JSON response
Examples
Retrieve as base64
To embed the image directly in your application without a follow-up HTTP request, setresponse_format to "b64_json":
Response
integer
Unix timestamp of when the image was generated.
array
Array of image objects, one per generated image. Each contains:
url— temporary download URL (present whenresponse_formatis"url")b64_json— base64-encoded image data (present whenresponse_formatis"b64_json")
object
Per-request environmental footprint. Fields:
energy_kwh, carbon_g_co2, water_liters, renewable_percent, pue, provider_id, location.object
Itemised cost:
energy (EUR), credits deducted, and paid_with.Image generation runs entirely on European infrastructure. Your prompts and generated images are never used to train models and never leave the EU.