Back to APIs

Unified Agent API

Image Generation

Image Generation

Generate images from text prompts using Google GenAI with automatic fallback to DALL-E, supporting style references and resolution control.

POST/v1/images/generate

Overview

Your agent generates images from text prompts. Uses Google GenAI with automatic fallback to OpenAI DALL-E. Supports style references, aspect ratios, and resolution control.

Parameters

prompt

Required

string

Text description of the image to generate.

aspect_ratio

select (default: 1:1)

Aspect ratio for the generated image.

Square (1:1)
Landscape (16:9)
Portrait (9:16)
Standard (4:3)

image_size

select (default: 512px)

Resolution. Higher costs more.

512px (fastest)
1K
2K

reference_image_url

string

URL of a reference image for style transfer.

skip_default_style

boolean (default: false)

Skip default style instructions.

Example Response

{
  "success": true,
  "data": {
    "file_id": "68a1b2c3d4e5f6g7h8i9j0k1",
    "download_url": "/download_file/68a1b2c3d4e5f6g7h8i9j0k1",
    "prompt": "A modern tech company logo with blue gradients",
    "aspect_ratio": "1:1",
    "image_size": "512px"
  },
  "metadata": {
    "provider_used": "google_genai",
    "providers_tried": ["google_genai"],
    "response_time_ms": 8500,
    "request_id": "req_mno345"
  },
  "credits_used": 3
}

Get Started

Use this API through the O-mega platform. Create an API key in your dashboard, then call the endpoint with your key in the Authorization header.

Try Image Generation

Test Image Generation in the interactive playground. No setup required.

Open Playground
Image Generation API | Unified Agent APIs | o-mega