Skip to Content
API ReferenceGenerativeGenerative Image Models

Generative Image Models

The Generative endpoint provides access to cutting-edge image generation AI models. Instead of returning JSON text, these endpoints return binary image data directly.

POST https://z.os7.site/api/generative/[modelname]

Use this endpoint to generate images from text prompts. Replace [modelname] with a valid model slug (e.g., stable-diffusion-xl).

Request Parameters

ParameterTypeRequiredDescription
apikeystringYesYour secret Zapi API key.
promptstringYesA detailed visual description of the image you want to generate.
aspect_ratiostringNoThe ratio of the output image (e.g., 1:1, 16:9, 9:16).
noncestringNoA random string to bypass caching and force a completely new generation.

Example Request

cURL
curl -X POST https://z.os7.site/api/generative/stable-diffusion-xl \ -H "Content-Type: application/json" \ -d '{ "apikey": "zp_your_secret_api_key", "prompt": "A futuristic cyberpunk city skyline during a heavy rainstorm, cinematic lighting, 8k resolution", "aspect_ratio": "16:9" }' \ --output result.png

Example Response

The response is a raw binary image buffer (image/png or image/jpeg).

Headers
HTTP/1.1 200 OK Content-Type: image/png Content-Length: 1048576 <Binary Image Data>
Last updated on