Chameleon

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

  1. Navigate to /admin/ai-config
  2. Scroll to "Add Provider" section
  3. Click on desired provider name
  4. Enter API key and configuration
  5. Enable the provider
  6. Save the configuration

Configure Kling AI

  1. Select "Kling" from available providers
  2. Enter Access Key in first field
  3. Enter Secret Key in second field
  4. Enable the provider
  5. Save the configuration

Edit Existing Provider

  1. Find the provider in the list
  2. Click "Edit Provider" button
  3. Modify API key or settings
  4. Update enable/disable status
  5. Save changes

Disable a Provider

  1. Find the provider to disable
  2. Click "Edit Provider" button
  3. Toggle the "Enabled" switch off
  4. Save the configuration
  5. 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:

  1. Check if provider is enabled
  2. Verify API key is correct
  3. Test API key with provider
  4. Check provider service status

Configuration Not Saving

Problem: Changes not persisting

Solution:

  1. Check required fields are filled
  2. Verify API key format
  3. Ensure admin permissions
  4. Try refreshing the page

API Key Issues

Problem: Invalid API key errors

Solution:

  1. Verify key is correct and current
  2. Check key permissions and limits
  3. Ensure key is for correct provider
  4. 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