Generate AI images from text prompts
/api/generate/imageGenerate images using various AI models including DALL-E 3, Stable Diffusion, and Gemini. The API supports different image sizes, styles, and quality settings.
| Parameter | Type | Required | Description |
|---|---|---|---|
| prompt | string | Yes | Text description of the image to generate |
| model | string | No | Model ID (dall-e-3, stable-diffusion-xl, gemini-image). Default: dall-e-3 |
| size | string | No | Image size: 1024x1024, 1792x1024, 1024x1792. Default: 1024x1024 |
| quality | string | No | Quality: standard or hd. Default: standard |
| style | string | No | Style: vivid or natural. Default: vivid |
curl -X POST https://your-domain.com/api/generate/image \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A futuristic cityscape at sunset with flying cars",
"model": "dall-e-3",
"size": "1792x1024",
"quality": "hd",
"style": "vivid"
}'{
"success": true,
"data": {
"id": "gen_abc123xyz",
"url": "https://storage.example.com/images/gen_abc123xyz.png",
"prompt": "A futuristic cityscape at sunset with flying cars",
"model": "dall-e-3",
"size": "1792x1024",
"creditsUsed": 15,
"createdAt": "2026-02-04T12:00:00Z"
}
}| Code | Description |
|---|---|
| 400 | Bad Request - Invalid parameters |
| 401 | Unauthorized - Invalid or missing API key |
| 402 | Payment Required - Insufficient credits |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Internal Server Error |
dall-e-315 creditsdall-e-28 creditsgemini-image12 credits