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 |
|---|---|---|
| flux | High-quality general purpose model. | General creativity |
| flux-realism | Tuned for photo-realistic images. | Photography style |
| flux-anime | Specialized for anime and manga styles. | Anime characters |
| flux-3d | Generates images with a 3D rendered look. | 3D visualizations |
| flux-pro | Professional variant for high detail. | Complex scenes |
| any-dark | Model optimized for dark themes and moods. | Gothic, dark fantasy |
| turbo | Very fast generation model for quick results. | Rapid prototyping |
| pimp-diffusion | Highly stylized and artistic model. | Artistic effects |
| magister-diffusion | Master-level diffusion for professional art. | Fine art styles |
| dolly-mini | A lightweight, fast model. | Quick, simple images |
| stable-diffusion | The classic Stable Diffusion model. | General purpose |
| stable-diffusion-animation | Tuned for creating animation frames. | Animation sequences |
| photo3d | Creates realistic photos with a 3D feel. | 3D-like photos |
| willit | An experimental and unpredictable model. | Creative exploration |
| lucid-sonic-dreams | Abstract, 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)