Documentation Index
Fetch the complete documentation index at: https://docs.electronhub.ai/llms.txt
Use this file to discover all available pages before exploring further.
Create original images using AI models like DALL-E.
Generate Images
POST /images/generations
Generate images from text descriptions.
Request Body
A text description of the desired image(s)
The model to use for image generation (e.g., “dall-e-3”, “dall-e-2”)
Number of images to generate (1-10 for dall-e-2, 1 for dall-e-3)
Size of the generated images (“256x256”, “512x512”, “1024x1024”, “1792x1024”, “1024x1792”)
Quality of the image (“standard” or “hd”)
Style of the generated images (“vivid” or “natural”)
Format of the generated images (“url” or “b64_json”)
Response
Returns an array of image objects with URLs or base64-encoded images.
Example
const response = await fetch('https://api.electronhub.ai/v1/images/generations', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
prompt: 'A futuristic cityscape at sunset',
model: 'dall-e-3',
n: 1,
size: '1024x1024',
quality: 'hd'
})
});
const data = await response.json();
console.log(data);
Enter your API key (starts with 'ek-')
Text description of the desired image
Number of images to generate
Required range: 1 <= x <= 10
quality
enum<string>
default:standard
Available options:
standard,
hd
size
enum<string>
default:1024x1024
Available options:
256x256,
512x512,
1024x1024,
1792x1024,
1024x1792
Available options:
url,
b64_json
Whether to make the image publicly accessible