AI Configuration
Configure AI providers and API keys in the admin system
AI Configuration
The AI configuration system allows administrators to set up and manage AI providers, configure API keys, and control AI service availability in the Chameleon platform.
Overview
The AI configuration interface is the central hub for managing all AI providers used by the system. Administrators can add, edit, enable/disable, and delete AI provider configurations. This is essential for the AI generation features to function properly.
Supported AI Providers
Text Generation Providers
- OpenAI: GPT models for text generation
- DeepSeek: Advanced language models
- OpenRouter: Access to multiple AI models
- SiliconFlow: Chinese-optimized AI models
Image Generation Providers
- Kling: AI image and video generation
- Replicate: Various AI models and services
Video Generation Providers
- Kling: AI video generation capabilities
- Seedance: Video creation and editing
Configuration Features
Provider Management
- Add New Providers: Configure additional AI services
- Edit Existing: Modify API keys and settings
- Enable/Disable: Control provider availability
- Delete Providers: Remove unused configurations
API Key Management
- Secure Storage: API keys are encrypted and stored safely
- Show/Hide Keys: Toggle visibility for security
- Key Validation: Verify API key validity
- Special Handling: Different configurations for different providers
Provider Status
- Enabled/Disabled: Control which providers are active
- Status Indicators: Visual status badges
- Configuration Status: Show setup completion status
- Error Handling: Display configuration issues
Special Provider Configurations
Kling AI Configuration
Kling requires special configuration with two separate keys:
- Access Key: Primary authentication key
- Secret Key: Secondary authentication key
- Dual Key Display: Shows both keys separately
- Special UI: Custom interface for dual-key setup
Standard Provider Configuration
Most providers use standard configuration:
- API Key: Single authentication key
- Model Config: Optional JSON configuration
- Enable/Disable: Standard toggle control
- Standard Display: Uniform interface design
Configuration Interface
Provider Cards
Each provider is displayed in a card format showing:
- Provider Name: Clear identification
- Status Badge: Enabled/Disabled indicator
- API Key Display: Masked or visible key
- Action Buttons: Edit and delete options
Configuration Form
When editing a provider:
- API Key Field: Secure password input
- Model Config: JSON configuration input
- Enable Toggle: Switch to enable/disable
- Save/Cancel: Action buttons
Add New Provider
- Provider Selection: Choose from available providers
- Configuration Form: Set up new provider
- Validation: Ensure proper configuration
- Save Configuration: Store new settings
Common Tasks
Add a New AI Provider
- Navigate to
/admin/ai-config - Scroll to "Add Provider" section
- Click on desired provider name
- Enter API key and configuration
- Enable the provider
- Save the configuration
Configure Kling AI
- Select "Kling" from available providers
- Enter Access Key in first field
- Enter Secret Key in second field
- Enable the provider
- Save the configuration
Edit Existing Provider
- Find the provider in the list
- Click "Edit Provider" button
- Modify API key or settings
- Update enable/disable status
- Save changes
Disable a Provider
- Find the provider to disable
- Click "Edit Provider" button
- Toggle the "Enabled" switch off
- Save the configuration
- Provider is now disabled
Security Features
API Key Protection
- Encrypted Storage: Keys are encrypted in database
- Masked Display: Keys are hidden by default
- Show/Hide Toggle: Controlled visibility
- Secure Transmission: HTTPS encryption
Access Control
- Admin Only: Only admin users can access
- Permission Checks: Real-time verification
- Action Logging: All changes are tracked
- Session Security: Secure admin sessions
Configuration Validation
API Key Validation
- Format Checking: Verify key format
- Length Validation: Check key length
- Provider Specific: Different rules per provider
- Error Messages: Clear validation feedback
Configuration Testing
- Connection Testing: Verify API connectivity
- Service Availability: Check provider status
- Error Handling: Graceful failure handling
- Status Updates: Real-time status display
Troubleshooting
Provider Not Working
Problem: AI generation fails with specific provider
Solution:
- Check if provider is enabled
- Verify API key is correct
- Test API key with provider
- Check provider service status
Configuration Not Saving
Problem: Changes not persisting
Solution:
- Check required fields are filled
- Verify API key format
- Ensure admin permissions
- Try refreshing the page
API Key Issues
Problem: Invalid API key errors
Solution:
- Verify key is correct and current
- Check key permissions and limits
- Ensure key is for correct provider
- Test key with provider directly
Best Practices
Provider Management
- Regular Updates: Keep API keys current
- Backup Configurations: Maintain backup copies
- Monitor Usage: Track API usage and limits
- Test Changes: Verify configurations work
Security
- Secure Storage: Never store keys in plain text
- Access Control: Limit admin access
- Regular Rotation: Change keys periodically
- Audit Trail: Keep logs of all changes
Next Steps
- User Management - Manage user accounts
- Credit System - Configure credit rules
- Order Management - Manage payments