AI Integration
AI Integration Setup Guide
This guide walks you through setting up AI integration in Novus CMS with your preferred provider. We'll cover the most common providers in detail.
Prerequisites
Before setting up AI integration, ensure you have:
- Novus CMS installed and configured
- Admin access to your Novus installation
- Knowledge of which AI provider you want to use
- Budget for API usage (most providers charge based on token usage)
Step 1: Choose an AI Provider
Novus supports multiple AI providers through the Laravel Prism package. Consider factors like:
- Price per token/request
- Model capabilities and quality
- Available features
- Response speed
- Regional availability
OpenAI - Default provider
OpenAI is the default provider and generally offers good performance, but you may prefer other providers based on your specific needs.
Step 2: Obtain API Credentials
For OpenAI (Default)
- Create an account at OpenAI Platform
- Navigate to the API Keys section
- Click "Create new secret key"
- Give the key a name (e.g., "Novus CMS")
- Copy the API key immediately (you won't be able to see it again)
For Anthropic
- Create an account at Anthropic Console
- Navigate to the API Keys section
- Create a new API key
- Copy the API key
For Google Gemini
- Create an account at Google AI Studio
- Navigate to the API Keys section
- Create a new API key
- Copy the API key
For Other Providers
Follow similar steps on the respective provider websites to obtain your API key.
Step 3: Configure Environment Variables
Add the following variables to your .env
file:
# Enable AI features
NOVUS_AI_ENABLED=true
# Select provider (openai, anthropic, mistral, gemini, groq, ollama, xai, deepseek, voyageai)
NOVUS_AI_PROVIDER=openai
# API key for your chosen provider
OPENAI_API_KEY=your_api_key_here
# Optional: Specify model
NOVUS_AI_MODEL=gpt-4o
Security !
Keep your API keys secure. Never commit them to version control or share them publicly.
For providers other than OpenAI, use the corresponding API key variable:
# For Anthropic
NOVUS_AI_PROVIDER=anthropic
ANTHROPIC_API_KEY=your_anthropic_api_key_here
# For Google Gemini
NOVUS_AI_PROVIDER=gemini
GEMINI_API_KEY=your_gemini_api_key_here
Step 4: Configure Provider Settings
If needed, you can further customize your provider configuration in config/novus.php
:
'ai' => [
'provider_details' => [
'url' => env('OPENAI_URL', 'https://api.openai.com/v1'),
'api_key' => env('OPENAI_API_KEY', env('NOVUS_AI_API_KEY', '')),
'organization' => env('OPENAI_ORGANIZATION', null),
'project' => env('OPENAI_PROJECT', null),
],
// Other settings...
],
Step 5: Test Your Integration
- Log in to your Novus admin panel
- Create or edit a post
- Look for AI feature buttons in the editor toolbar
- Try generating SEO metadata to verify the integration works
Troubleshooting
"AI service is not enabled" Error
- Check that
NOVUS_AI_ENABLED=true
is in your.env
file - Run
php artisan config:clear
to ensure the change is recognized - Verify the configuration in
config/novus.php
Authentication Errors
- Double-check your API key is correct and not expired
- Ensure you're using the correct provider name
- Verify your account has sufficient credits with the provider
Next Steps
Once you've set up the basic integration, explore:
- AI Configuration Options for advanced settings
- Customizing prompt templates for your specific content needs
- Monitoring and optimizing API usage