Skip to main content

Overview

imagen_4 is a high-quality image generation model with superior detail and aesthetics.
  • Type: Image Generation
  • Processing: Synchronous
  • Resolution: Multiple aspect ratios
  • Price: $0.016 per image

Parameters

model
string
required
imagen_4
prompt
string
required
Description of the image to generate (max 2000 characters)
negative_prompt
string
What to avoid in the image (max 1000 characters)
width
integer
Image width in pixels (256-2048, default: 1024)
height
integer
Image height in pixels (256-2048, default: 1024)
num_outputs
integer
Number of images to generate (1-4, default: 1)
orientation
string
Image orientation: portrait or landscape

Example

curl -X POST https://api.eggapi.ai/v1/generate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "imagen_4",
    "prompt": "A serene Japanese garden with cherry blossoms",
    "negative_prompt": "blurry, low quality",
    "width": 1024,
    "height": 1024,
    "num_outputs": 1
  }'

Response

{
  "data": {
    "id": "gen_abc123def456",
    "model": "imagen_4",
    "urls": ["https://cdn.eggapi.ai/outputs/abc123.png"],
    "cost": "$0.0160"
  },
  "error": null
}