Generate Image
Description
This endpoint generates images based on a given prompt using AI. It supports various customization options and returns URLs to the generated images.
Endpoint
Headers
- Content-Type:
application/json
- Authorization: Bearer
<API_KEY>
(required)
Request Body
Model Options
Currently, the supported models and their cost per image:
FLUX.1-schnell
: 3 credits per image generatedFLUX.1-dev
: 25 credits per image generatedFLUX.1-pro
: 50 credits per image generated
Image Size Options
square_hd
square
portrait_4_3
portrait_16_9
landscape_4_3
landscape_16_9
Responses
Success (200)
Returns the generated image information.
- Content-Type: application/json
- X-RateLimit-Limit: The rate limit for the user.
- X-RateLimit-Remaining: The remaining number of requests for the user.
Bad Request (400)
Returned if the request is invalid.
Internal Server Error (500)
Returned if there’s an error during the image generation process.
Example Request
Notes
- The
seed
parameter can be used to generate reproducible results. The same seed and prompt will produce the same image for a given model version. - The
has_nsfw_concepts
field in the response indicates whether any NSFW (Not Safe For Work) content was detected in the generated images. - Images are temporarily stored (for ~24 hours) and accessible via the returned URLs.
Rate Limiting
Rate limit headers (X-RateLimit-Limit
and X-RateLimit-Remaining
) are included in the response to indicate the user’s current rate limit status.