- Unified node supporting Create, Edit, and Remix operations - Dynamic input system based on operation type - Comprehensive error handling and credit tracking - Verbose logging for debugging and monitoring - Clean public release with documentation and examples
6.1 KiB
6.1 KiB
Reve API Research and Specifications
Overview
Reve API provides image generation, editing, and remixing capabilities through three main endpoints. This document consolidates the available information about the API structure, authentication, and operation parameters.
Base API Information
- Base URL:
https://api.reve.com - Authentication: Bearer token via Authorization header
- Content Type:
application/json - Response Format: JSON with base64 encoded images
Authentication
API Key Management
- Header Format:
Authorization: Bearer {api_key} - Environment Variable:
REVE_API_KEY - Scope: All endpoints require authentication
Error Responses
- 401 Unauthorized: Invalid or missing API key
- 403 Forbidden: Insufficient permissions
- 429 Too Many Requests: Rate limiting exceeded
API Endpoints
1. Create Endpoint
Purpose: Generate images from text prompts
POST /api/create
Parameters:
prompt(required): Text description of desired imageaspect_ratio(optional): Image dimensions (16:9, 9:16, 3:2, 2:3, 4:3, 3:4, 1:1)version(optional): Model version (latest, reve-create@20250915)output_format(optional): Image format (png, jpeg, webp, json)
Cost: 18 credits per generation
2. Edit Endpoint
Purpose: Modify existing images with text instructions
POST /api/edit
Parameters:
prompt(required): Text instruction for editingreference_image(required): Base64 encoded source imageversion(optional): Model version (latest, reve-edit@20250915)output_format(optional): Image format (png, jpeg, webp, json)
Cost: 30 credits per edit
3. Remix Endpoint
Purpose: Combine multiple images with text guidance
POST /api/remix
Parameters:
prompt(required): Text description with XML tags for image referencesreference_images(required): Array of 1-4 base64 encoded imagesaspect_ratio(optional): Output image dimensionsversion(optional): Model version (latest, reve-remix@20250915)output_format(optional): Image format (png, jpeg, webp, json)
Cost: 30 credits per remix
XML Tag Format: Use <img1>, <img2>, etc. in prompt to reference images
Response Format
Success Response
{
"image": "base64_encoded_image_data",
"request_id": "unique_request_identifier",
"credits_used": 18,
"credits_remaining": 982,
"metadata": {
"operation": "create|edit|remix",
"parameters": {...},
"processing_time": 2.5,
"model_version": "reve-create@20250915"
}
}
Error Response
{
"error": {
"code": "CONTENT_POLICY_VIOLATION",
"message": "Content violates policy guidelines",
"details": "Specific violation description"
},
"request_id": "unique_request_identifier"
}
Error Codes
Client Errors (4xx)
400 BAD_REQUEST: Invalid parameters or malformed request401 UNAUTHORIZED: Invalid or missing API key403 FORBIDDEN: Insufficient permissions or credits404 NOT_FOUND: Endpoint not found429 TOO_MANY_REQUESTS: Rate limit exceeded
Server Errors (5xx)
500 INTERNAL_SERVER_ERROR: Server processing error502 BAD_GATEWAY: Upstream service error503 SERVICE_UNAVAILABLE: Service temporarily unavailable
Rate Limiting
- Default Limits: Not explicitly documented
- Headers: Check
X-RateLimit-*headers in responses - Retry Strategy: Exponential backoff recommended
Content Policy
Prohibited Content
- Violence, gore, or harmful content
- Adult or sexual content
- Copyrighted material without permission
- Hate speech or discriminatory content
Detection
- Automatic content filtering on all operations
- Returns
CONTENT_POLICY_VIOLATIONerror code - No credits charged for policy violations
Image Specifications
Input Requirements
- Format: Base64 encoded (PNG, JPEG, WebP)
- Size Limits:
- Edit: Single image, max 10MB
- Remix: 1-4 images, max 5MB each
- Resolution: Recommended 512x512 to 2048x2048
Output Specifications
- Format: PNG, JPEG, WebP, or JSON metadata
- Quality: High resolution, production ready
- Encoding: Base64 in JSON response
Model Versions
Available Versions
latest: Always points to newest stable versionreve-create@20250915: Specific create model versionreve-edit@20250915: Specific edit model versionreve-remix@20250915: Specific remix model version
Version Selection
- Default:
latestfor all operations - Explicit: Specify exact version for reproducibility
- Compatibility: Older versions may be deprecated
Integration Notes
Best Practices
- Error Handling: Implement comprehensive error handling for all response codes
- Retry Logic: Use exponential backoff for rate limiting and server errors
- Credit Monitoring: Track credit usage to prevent service interruption
- Image Optimization: Compress images before base64 encoding to reduce payload size
- Caching: Cache successful responses when appropriate
Performance Considerations
- Request Size: Minimize base64 payload size
- Concurrent Requests: Respect rate limits
- Timeout Handling: Set appropriate timeouts (30-60 seconds)
- Memory Management: Handle large image data efficiently
Security Considerations
API Key Protection
- Store API keys securely (environment variables, secure storage)
- Never expose keys in client-side code
- Rotate keys regularly
- Monitor for unauthorized usage
Data Privacy
- Images are processed server-side
- No guarantee of data retention policies
- Consider data sensitivity before uploading
Testing and Development
Sandbox Environment
- No explicit sandbox mentioned in documentation
- Use low-cost operations for testing
- Monitor credit usage during development
Debugging
- Use
request_idfor support requests - Log API responses for troubleshooting
- Monitor error patterns and rates
Note: This documentation is based on available project specifications and common API patterns. Some details may need verification against the actual Reve API documentation when accessible.