Image Generation API

Bring your ideas to life with state-of-the-art AI image models.

Quick Start

Send a POST request to the image generation endpoint:

POST https://nexus.drexus.xyz/v1/generate-image

Endpoint: Generate Image

Request Body Parameters

Parameter Type Required Description
prompt string Yes A detailed text description of the image to generate.
model string No The AI model to use. Defaults to flux.
width integer No Image width in pixels. Defaults to 512.
height integer No Image height in pixels. Defaults to 512.

Code Example

example.js
fetch('https://nexus.drexus.xyz/v1/generate-image', {
    method: 'POST',
    headers: {
        'Authorization': 'Bearer YOUR_API_KEY',
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({
        prompt: 'Astronaut riding a horse on Mars, photorealistic',
        model: 'flux-pro',
        width: 1024,
        height: 1024
    })
})
.then(res => res.json())
.then(data => console.log(data.imageUrl));

Response Format

response.json
{
  "success": true,
  "model": "flux-pro",
  "prompt": "Astronaut riding a horse on Mars, photorealistic",
  "size": "1024x1024",
  "imageUrl": "/data/generated-images/pollinations-123.png",
  "expiresIn": "2 hours",
  "user": { /* ... user details ... */ }
}

Available Models

Model ID Description Best For
fluxHigh-quality general purpose model.General creativity
flux-realismTuned for photo-realistic images.Photography style
flux-animeSpecialized for anime and manga styles.Anime characters
flux-3dGenerates images with a 3D rendered look.3D visualizations
flux-proProfessional variant for high detail.Complex scenes
any-darkModel optimized for dark themes and moods.Gothic, dark fantasy
turboVery fast generation model for quick results.Rapid prototyping
pimp-diffusionHighly stylized and artistic model.Artistic effects
magister-diffusionMaster-level diffusion for professional art.Fine art styles
dolly-miniA lightweight, fast model.Quick, simple images
stable-diffusionThe classic Stable Diffusion model.General purpose
stable-diffusion-animationTuned for creating animation frames.Animation sequences
photo3dCreates realistic photos with a 3D feel.3D-like photos
willitAn experimental and unpredictable model.Creative exploration
lucid-sonic-dreamsAbstract, audio-visual synthesis model.Surreal art

Limits & Errors

Rate Limits

  • 1000 requests per day (shared across all APIs)
  • Up to 2048x2048 resolution
  • Full access to all models

Common Error Codes

  • 400 - Bad Request (e.g., missing prompt)
  • 401 - Unauthorized (invalid API key)
  • 429 - Too Many Requests (daily limit exceeded)
  • 500 - Internal Server Error (generation failed)