API Endpoints
Image Generation
Learn how to use the image generation endpoint
Generate high-quality images using our AI models.
Endpoint Details
/api/images/generate
Generate an image from a text prompt
Request Format
Headers
Must be set to application/json
Your API key
Body Parameters
The text description of the image you want to generate
The model to use for generation. Defaults to black-forest-labs/FLUX.1-schnell
Additional generation options
Example Request
Response Format
Image Serving
Endpoint
/api/images/:filename
Retrieve a generated image
- No authentication required
- Returns the image file directly
- Images are available immediately after generation
Caching
- Generated images are cached for 1 hour
- Cache key is based on prompt, model, and options
- Images are stored locally and served via public endpoint
Error Scenarios
- 400: Missing or invalid prompt
- 401: Missing API key
- 403: Invalid API key
- 404: Image not found (for serving endpoint)
- 429: Rate limit exceeded
- 500: Internal server error
Error Response Example
In development mode, you’ll receive additional error details: