Endpoints
Generate AI Image
Description
This endpoint generates high-quality AI images using various models with different capabilities and price points. It supports multiple models with customizable parameters for each.
Endpoint
Headers
- Content-Type:
application/json
- Authorization: Bearer
<API_KEY>
(required)
Request Body
Supported Models and Their Parameters
FLUX.1-schnell (3 credits per image)
FLUX.1-dev (25 credits per image)
FLUX.1-pro and FLUX.1.1-pro (50 credits per image)
recraft-v3 (50 credits per image)
Available size options:
- “1024x1024"
- "1365x1024"
- "1024x1365"
- "1536x1024"
- "1024x1536"
- "1820x1024"
- "1024x1820"
- "1024x2048"
- "2048x1024"
- "1434x1024"
- "1024x1434"
- "1024x1280"
- "1280x1024"
- "1024x1707"
- "1707x1024”
Available style options:
- “any"
- "realistic_image"
- "digital_illustration"
- "digital_illustration/pixel_art"
- "digital_illustration/hand_drawn"
- "digital_illustration/grain"
- "digital_illustration/infantile_sketch"
- "digital_illustration/2d_art_poster"
- "digital_illustration/handmade_3d"
- "digital_illustration/hand_drawn_outline"
- "digital_illustration/engraving_color"
- "digital_illustration/2d_art_poster_2"
- "realistic_image/b_and_w"
- "realistic_image/hard_flash"
- "realistic_image/hdr"
- "realistic_image/natural_light"
- "realistic_image/studio_portrait"
- "realistic_image/enterprise"
- "realistic_image/motion_blur”
Responses
Success (200)
Returns the generated image URLs and usage 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
- Credit costs per image vary by model:
- FLUX.1-schnell: 3 credits
- FLUX.1-dev: 25 credits
- FLUX.1-pro: 50 credits
- FLUX.1.1-pro: 50 credits
- recraft-v3: 50 credits
- Total credit usage is calculated as: model cost × number of images generated
- Generated images are temporarily stored and accessible via the returned URLs
- Safety checks are enabled by default to prevent NSFW content generation
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.