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
| Parameter | Type | Required | Description |
|---|---|---|---|
apikey | string | Yes | Your secret Zapi API key. |
prompt | string | Yes | A detailed visual description of the image you want to generate. |
aspect_ratio | string | No | The ratio of the output image (e.g., 1:1, 16:9, 9:16). |
nonce | string | No | A 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.pngExample 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