API Documentation
API Overview
Introduction
Aluo AI API provides powerful image processing capabilities including intelligent background removal, AI image generation and editing. Perfect for e-commerce product photography, marketing material design, content creation and more. All APIs are REST-based and support JSON data exchange.
Base URL
Base URL for all API requests: https://aluo.ai/api
Authentication
API supports two authentication methods: 1. **API Key Authentication** (Recommended): Include Authorization: Bearer YOUR_API_KEY in request headers - API Key starts with "sk-" - Get from "API Keys" page in Aluo AI console 2. **Session Authentication**: For logged-in web applications - Pass session info via Cookie - Requires user logged into Aluo AI platform
Credit System
All business APIs consume credits. Different user types have different credit costs: - Free users: Standard credit pricing - Subscribed users (Creator + Pro): Enjoy credit discounts
API Key Management
Getting API Keys
Create and manage your API keys in the Aluo AI console.
Steps:
- Login to Aluo AI platform: https://aluo.ai
- Go to the console page
- Click "API Keys" in the left menu
- Click "Create New Key" button
- Set name and permissions for the key
- Copy the generated key (starts with sk-)
Important Tips
- Keep your API keys secure, don't hardcode in source code
- Use environment variables to store API keys
- Disable or delete unused keys anytime in console
Key Security
Best practices for protecting your API key security.
Steps:
- Store API keys in environment variables, not in code
- Rotate API keys regularly
- Monitor API key usage
- Disable immediately in console if leaked
Intelligent Background Removal
POST /api/remove-bg
Use advanced AI technology to intelligently remove image backgrounds, supporting multiple image formats and returning transparent PNG images. Perfect for product image processing, portrait cutouts and more.
💳 Credit Cost:
Request Parameters
Upload image files using multipart/form-data format.
Steps:
- file (required): Image file, supports PNG, JPG, WebP formats
- Maximum file size: 10MB
- Recommended resolution: Up to 4096x4096 pixels
Use Cases
• E-commerce products: Quickly remove product photo backgrounds, create white background images • Portrait processing: Remove portrait backgrounds for easy composition • Material creation: Remove backgrounds from design materials for better reusability • ID photo processing: Quickly create standard ID photo backgrounds
Response Format
Returns processed image file (binary data) with Content-Type as image/png.
AI Intelligent Image Editing
POST /api/ai-image-edit/generate
Based on input images and text prompts, use AI technology for intelligent image editing and optimization. Supports style conversion, content adjustment, quality enhancement and various editing effects. This is an async task, credits will be deducted after task completion.
💳 Credit Cost:
Request Parameters
prompt (required): Text description of editing instructions inputImage (required): Original image URL or base64 data aspectRatio: Output aspect ratio (16:9, 1:1, 9:16, etc.) outputFormat: Output format (jpeg, png, webp) enableTranslation: Whether to enable prompt translation model: AI model to use (flux-kontext-pro, flux-kontext-max)
Use Cases
• Product optimization: Improve lighting, background, style of product photos • Style conversion: Convert ordinary photos to artistic styles • Content enhancement: Improve image quality, add visual effects • Creative design: Creative visual transformation based on original images
Response Format
Returns task information, need to use status query API to get final results.
GET /api/ai-image-edit/status
Query AI image editing task status and results. Returns edited image URL when completed.
AI Product Image Generation
POST /api/ai-generate-image/generate
Use AI to generate high-quality product images based on text descriptions. Especially suitable for e-commerce product display, marketing material creation and more. Supports multiple sizes and style settings. This is an async task, credits will be deducted after task completion.
💳 Credit Cost:
Request Parameters
prompt (required): Product description text size: Image size (1:1, 3:2, 2:3, etc.) filesUrl: Reference image URL array (optional)
Use Cases
• E-commerce products: Quickly generate professional product images for new products • Marketing materials: Create product promotion and advertising materials • Concept design: Visualize product ideas and design proposals • Sample display: Preview product effects before physical production
Response Format
Returns task information, need to use status query API to get final results.
GET /api/ai-generate-image/status
Query AI product image generation task status and results. Returns generated product image URL when completed.
AI Background Generation
POST /api/ai-generate-background
Instantly generate professional background images based on text descriptions, suitable for product photography, scene design and more. Supports various styles and environmental settings, can quickly create appropriate background environments for products or content. This is a synchronous API that returns results immediately.
💳 Credit Cost:
Request Parameters
prompt (required): Background description text, supports Chinese and English Can describe style, color, material, lighting and other elements Supports scene descriptions like "studio", "natural environment", "indoor scene", etc.
Use Cases
• Product photography: Generate professional shooting backgrounds for products • E-commerce design: Create environmental atmosphere for product display • Content creation: Make suitable backgrounds for articles and posters • Brand visual: Unify brand visual background style
Response Format
Synchronously returns generation results, including background image URL.