AI Image Generator
This API provides high-speed latent diffusion models to generate images from text descriptions and provides you with an image link.
Endpoint
Section titled “Endpoint” POST
/api/v1/image Request Parameters
Section titled “Request Parameters”The following parameters are accepted in the request body:
| Field | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | Description of the image(s) to generate. |
Request Examples
Section titled “Request Examples”curl -X POST https://heavstal.com.ng/api/v1/image \-H "Content-Type: application/json" \-H "x-api-key: <YOUR_API_KEY>" \-d '{"prompt": "A cyberpunk city in rain, neon lights"}'const response = await fetch('https://heavstal.com.ng/api/v1/image', { method: 'POST', headers: { 'Content-Type': 'application/json', 'x-api-key': '<YOUR_API_KEY>' }, body: JSON.stringify({ prompt: "A cyberpunk city in rain, neon lights" })});
const res = await response.json();console.log(res.data.url);import { ai } from '@heavstal/api';
const img = await ai.image("A cyberpunk city in rain, neon lights");console.log(img.url); // returns image urlimport requests
url = "https://heavstal.com.ng/api/v1/image"headers = { "Content-Type": "application/json", "x-api-key": "<YOUR_API_KEY>"}payload = { "prompt": "A cyberpunk city in rain, neon lights"}
response = requests.post(url, headers=headers, json=payload)print(response.json()["data"]["url"])Response Examples
Section titled “Response Examples”{ "status": "success", "creator": "HEAVSTAL TECH", "data": { "prompt": "A cyberpunk city...", "url": "https://img-url.com/xyz.jpg", "model": "turbo" }}{ "status": "error", "error": "prompt is required."}