Generate Image
Generate images using AI with automatic provider fallback. Supports multiple AI providers (Gemini, Azure, Vercel) with automatic fallback if one fails. Images are automatically saved to storage and can be used in conversations or content.
Input Schema
| Parameter | Type | Description |
|---|---|---|
| prompt | string | Detailed text description of the image to generate. Be specific about style, colors, composition, and any important details. |
| provider | string | AI provider to use for generation. Only Gemini is currently supported. |
| size | string | Size of the generated image. Defaults to 1024x1024 for best quality. Enum: 256x256, 512x512, 1024x1024 |
| n | number | Number of images to generate. Defaults to 1. |
| quality | string | Quality of the generated image. HD quality is higher resolution but may take longer. Defaults to standard. Enum: standard, hd |
| ratio | string | Aspect ratio of the generated image. Defaults to 1:1 (square). Enum: 1:1, 4:3, 3:4, 16:9, 9:16, 3:2, 2:3 |
| reference_images | array | Array of image URLs to use as reference/context for generation. Images will be converted to base64 and sent as context to the AI model. |
REST Endpoint
POST /api/agents/tools/generateImagePOST /api/agents/tools/generateImage
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
"prompt": "A minimalist logo for a tech startup, flat design, blue and white palette",
"size": "1024x1024",
"quality": "standard",
"ratio": "1:1"
}Response:
{
"success": true,
"images": [
{
"url": "https://...",
"width": 1024,
"height": 1024
}
]
}Last updated on