Images API

Generate standalone images from text prompts with customizable styles, sizes, and quality settings.

POST /image/create

Create a new image generation request.

Request Body

Parameter Type Required Description
prompt string Yes Detailed description of the image to generate (10-2,000 characters)
model string No Model tier: basic, standard (default), or advanced
style string No Visual style (see options below). Default: photograph
size string No landscape (default), square, portrait, or auto
quality string No low, medium, or high (default)
format string No png (default), jpeg, or webp
background string No auto (default), transparent, or opaque
webhook_url string No URL to receive completion notification

Style Options

Style Description
photograph Professional photography look
illustration Clean vector-style graphics
digital_art Vibrant digital artwork
3d_render 3D rendered graphics
painting Traditional art styles
sketch Hand-drawn sketch style
infographic Data visualization layout
technical_diagram Technical diagram style

Size Options

Size Dimensions Use For
landscape 1536x1024 Featured images, banners
square 1024x1024 Social media, thumbnails
portrait 1024x1536 Mobile content, stories
auto 1536x1024 Default fallback

Example Request

curl -X POST https://api.genrex.io/v1/image/create \
  -H "Authorization: Bearer grx_sk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A futuristic city skyline at sunset with flying cars and neon lights reflecting on glass buildings",
    "style": "digital_art",
    "size": "landscape",
    "quality": "high",
    "format": "png"
  }'

Example Response

{
  "success": true,
  "id": "7c9e6679-7425-40de-944b-e07fc1f90ae7"
}
GET /image/status/{'{uuid}'}

Check image status and retrieve URL when completed.

Example Response (Completed)

{
  "success": true,
  "id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
  "status": "completed",
  "data": {
    "url": "https://genrex.io/images/standalone/1706713200_a8f3b2c1d4e5/futuristic-city.png"
  }
}

Prompt Guidelines

Write detailed prompts for best results:

  • Be specific about subjects, colors, and positioning
  • Describe composition and layout
  • Specify technical details for diagrams
  • Avoid text in images - AI models struggle with text rendering
Good prompt

"Arduino UNO microcontroller connected to a red LED and 220-ohm resistor on a white breadboard. Jumper wires showing connections. Top-down view, clean technical diagram style."

Bad prompt

"Arduino with LED"