Overview
The Images API allows you to generate images from text prompts, edit existing images, and create variations. All image generation requests flow through RedPill’s privacy-protected gateway.All image generation requests are processed through TEE-protected infrastructure, ensuring your prompts and generated images remain confidential.
Supported Models
RedPill supports image generation models from multiple providers:| Model | Provider | Description | Max Resolution |
|---|---|---|---|
stability/stable-diffusion-3-5-large | Stability AI | Latest SD 3.5 model | 2048x2048 |
stability/stable-diffusion-3-5-medium | Stability AI | Faster SD 3.5 | 1536x1536 |
stability/stable-diffusion-ultra | Stability AI | Ultra-high quality | 2048x2048 |
recraft/recraft-v3 | Recraft AI | Brand-consistent generation | 2048x2048 |
recraft/recraft-v3-svg | Recraft AI | Vector graphics generation | 2048x2048 |
openai/dall-e-3 | OpenAI | DALL-E 3 | 1024x1024 |
segmind/sd3-turbo | Segmind | Fast generation | 1024x1024 |
List Image Models
Get all image models programmatically →
Generate Images
Request Parameters
The image generation model to use (e.g.,
stability/stable-diffusion-3-5-large)A text description of the desired image. Maximum length varies by model (typically 1000-4000 characters).
Number of images to generate. Must be between 1 and 10.
Image resolution. Supported sizes vary by model:
256x256512x5121024x10241536x15362048x2048
Image quality setting:
standard- Faster generationhd- Higher quality (if supported by model)
Response format:
url- Returns URL to hosted image (valid for 1 hour)b64_json- Returns base64-encoded image data
Style preset (model-specific):
vivid- More creative and dramaticnatural- More realistic and natural
Response Fields
Unix timestamp of when the image was generated
Array of generated images
Edit Images
Edit portions of an existing image using a text prompt and mask.Request Parameters
The image editing model to use (e.g.,
openai/dall-e-3)The image to edit. Must be a valid PNG file, less than 4MB, and square.
Mask image indicating areas to edit. Transparent areas (alpha channel = 0) will be edited. Must be PNG, same size as original.
Description of the desired edits
Number of edited images to generate (1-10)
Size of generated images (
256x256, 512x512, or 1024x1024)Create Variations
Generate variations of an existing image.Request Parameters
The image model to use (e.g.,
openai/dall-e-3)Source image for variations. Must be PNG, less than 4MB, and square.
Number of variations to generate (1-10)
Size of generated variations
url- Returns image URLsb64_json- Returns base64-encoded images
Privacy & Security
TEE-Protected Generation
All image generation requests flow through hardware-protected secure enclaves
Confidential Prompts
Your prompts are processed in isolated secure environments
Temporary Storage
Generated images are hosted for 1 hour, then automatically deleted
No Training Data
Your images are never used to train models
Best Practices
Prompt Engineering
Be Specific and Detailed
Be Specific and Detailed
Specify Style and Mood
Specify Style and Mood
Include Technical Details
Include Technical Details
Use Negative Prompts (Model-Specific)
Use Negative Prompts (Model-Specific)
Some models support negative prompts to avoid unwanted elements:
Cost Optimization
1
Start with Lower Resolution
Generate at
512x512 or 1024x1024 first, upscale later if needed2
Use Appropriate Models
- Fast iterations: Use turbo models (e.g.,
segmind/sd3-turbo) - Final quality: Use premium models (e.g.,
stability/stable-diffusion-ultra)
3
Generate Multiple Variations
Use
n: 4 to get multiple options in a single request (more efficient than 4 separate requests)4
Cache Generated Images
Download and store images you want to keep (URLs expire after 1 hour)
Error Handling
Common Errors
| Error Code | Description | Solution |
|---|---|---|
| 400 | Invalid parameters | Check size, model, and prompt parameters |
| 400 | Content policy violation | Revise prompt to comply with content policies |
| 401 | Authentication failed | Verify API key is correct |
| 403 | Insufficient credits | Add credits to your account |
| 413 | Image too large | Reduce image file size (< 4MB) |
| 429 | Rate limit exceeded | Implement exponential backoff |
| 500 | Server error | Retry with exponential backoff |