Image Generation
Platform image generation via a two-step Gemini pipeline: prompt refinement then image generation.
I Let AI Agents Build My Entire Webinar
Dec 2025
How It Works
Submit an image generation request via API with a prompt, an optional use_case (general, thumbnail, diagram, social, avatar; default general) and an optional aspect_ratio (1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3; default 1:1).
Step 1 — Prompt Refinement: Gemini refines the prompt using best-practice templates for the use case. Send refine_prompt: false to skip this step and use your prompt as written.
Step 2 — Image Generation: Gemini generates the image from the refined prompt.
The image is returned as base64 (image_base64, mime_type) together with the refined_prompt, the original_prompt and the model_used.
Usage
Generation needs a Gemini key — saved in Settings → Integrations (Platform Keys) or set as GEMINI_API_KEY. Without one the endpoint answers 501; a generation the provider rejects answers 422 with the reason and the refined prompt that was tried.
Used internally for agent avatars and other platform features.
API Endpoints
| Endpoint | Method | Description |
|---|---|---|
| /api/images/generate | POST | Generate an image from a text prompt (prompt, use_case?, aspect_ratio?, refine_prompt?) |
| /api/images/models | GET | Whether generation is available, the text-refinement and image models in use, and the valid use cases and aspect ratios |