Skip to content

AI-Powered Features

AI CMS Pro includes advanced artificial intelligence capabilities powered by OpenAI to enhance content creation, automate tasks, and improve user experience.


Overview

The AI features in AI CMS Pro leverage OpenAI's GPT models to provide intelligent assistance throughout the content management workflow. These features are designed to save time, improve content quality, and streamline your workflow.


Prerequisites

OpenAI API Key

To use AI features, you need an OpenAI API key:

  1. Get an API Key:

    • Visit OpenAI Platform
    • Sign up or log in to your account
    • Create a new API key
    • Copy the key (starts with sk-)
  2. Configure in Admin Panel:

    • Navigate to Admin Panel > Settings > General > Configurations
    • Scroll to OpenAI Settings section
    • Enter your OpenAI API key
    • Click Save
  3. Or Configure in .env file:

    env
    OPENAI_API_KEY=sk-your-api-key-here

Important

Your API key is stored securely and will be used for all AI features. Keep your API key confidential and never share it publicly.


Available AI Features

1. Grammar & Spelling Check

Location: Rich Text Editor (TinyMCE)

Description: Automatically check and correct grammar and spelling errors in your content.

How to Use:

  1. Open any rich text editor (Blog Posts, Pages, etc.)
  2. Select the text you want to check
  3. Click the AI Tools button in the toolbar
  4. Select Check Grammar & Spelling
  5. Review and apply suggested corrections

Use Cases:

  • Blog post editing
  • Page content review
  • Email template checking
  • Knowledge base articles

2. Text Rewriting

Location: Rich Text Editor (TinyMCE)

Description: Rewrite text to improve clarity, tone, or style while maintaining the original meaning.

How to Use:

  1. Select the text you want to rewrite
  2. Click AI Tools in the editor toolbar
  3. Select Rewrite Text
  4. Choose your preferred style:
    • Professional
    • Casual
    • Formal
    • Concise
    • Detailed
  5. Review and apply the rewritten text

Use Cases:

  • Improving content clarity
  • Adjusting tone for different audiences
  • Making content more engaging
  • Simplifying complex text

3. Content Generation

Location: Rich Text Editor (TinyMCE)

Description: Generate new content based on prompts or topics.

How to Use:

  1. Click AI Tools in the editor
  2. Select Generate Content
  3. Enter your topic or prompt
  4. Specify:
    • Content length
    • Writing style
    • Target audience
  5. Review and insert the generated content

Use Cases:

  • Blog post drafts
  • Product descriptions
  • FAQ answers
  • Knowledge base articles
  • Email content

4. Language Translation

Location: Command Line (Artisan)

Description: Automatically translate language files for internationalization.

How to Use:

bash
# Translate all languages using OpenAI
php artisan translations:translate

# Translate specific language
php artisan translations:translate --lang=fr

# Use different provider
php artisan translations:translate --provider=openai
php artisan translations:translate --provider=deepl

# Adjust batch size
php artisan translations:translate --batch=100

# Dry run (test without saving)
php artisan translations:translate --lang=fr --dry-run

Supported Languages:

  • English (en) - Source
  • Turkish (tr)
  • German (de)
  • Chinese (cn)
  • Bengali (bd)
  • Arabic (sa)
  • Hindi (hi)
  • Dutch (nl)
  • Italian (it)
  • Spanish (es)
  • Swedish (se)
  • Portuguese (pt)
  • Romanian (ro)
  • French (fr)

AI Model Configuration

Default Model

AI CMS Pro uses GPT-4o-mini by default, which provides:

  • Cost-effective pricing ($0.15 per 1M input tokens, $0.60 per 1M output tokens)
  • Fast response times
  • High-quality results
  • Reliable performance

Model Location

The model is configured in app/Services/AIService.php:

php
protected function getModel(): string
{
    return 'gpt-4o-mini';
}

Model Selection

You can modify the model in AIService.php if you need different capabilities. However, GPT-4o-mini is recommended for most use cases due to its balance of cost and quality.


API Integration

API Endpoints

AI features are accessible via API endpoints:

Base URL: /api/ai

Available Endpoints:

  • POST /api/ai/check-grammar - Check grammar and spelling
  • POST /api/ai/rewrite - Rewrite text
  • POST /api/ai/generate - Generate content

Authentication: Requires valid API token

Example Request:

bash
curl -X POST https://yourdomain.com/api/ai/check-grammar \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"text": "Your text here"}'

Cost Management

Understanding Costs

OpenAI charges based on token usage:

  • Input tokens: Text you send to the API
  • Output tokens: Text generated by the API

Cost Optimization Tips

  1. Be Specific: Clear, specific prompts reduce back-and-forth
  2. Batch Operations: Use translation commands for bulk operations
  3. Review Before Applying: Always review AI suggestions before applying
  4. Monitor Usage: Check your OpenAI dashboard regularly

Estimated Costs

Grammar Check (100 words):

  • ~150 input tokens
  • ~50 output tokens
  • Cost: ~$0.00003

Text Rewrite (200 words):

  • ~300 input tokens
  • ~250 output tokens
  • Cost: ~$0.00018

Translation (1000 strings):

  • Varies by language
  • Typically $0.50 - $2.00 per language

Best Practices

1. Content Quality

  • Always review AI-generated content
  • Edit and refine AI suggestions
  • Maintain your brand voice
  • Fact-check important information

2. Security

  • Never share your API key
  • Use environment variables for configuration
  • Monitor API usage regularly
  • Set usage limits if needed

3. Performance

  • Use AI features for drafts, not final content
  • Combine AI assistance with manual editing
  • Test different prompts for better results
  • Save frequently when using AI tools

4. Workflow Integration

  • Use grammar check before publishing
  • Generate drafts with AI, then refine manually
  • Use translation for initial localization
  • Leverage rewriting for A/B testing

Troubleshooting

API Key Not Working

Problem: AI features show "API key not configured" error

Solutions:

  1. Verify API key in Settings > General > Configurations
  2. Check .env file has OPENAI_API_KEY set
  3. Ensure API key starts with sk-
  4. Verify API key is active in OpenAI dashboard
  5. Clear application cache: php artisan cache:clear

Slow Response Times

Problem: AI features take too long to respond

Solutions:

  1. Check your server's internet connection
  2. Verify OpenAI API status
  3. Reduce text length for processing
  4. Check server PHP timeout settings

High Costs

Problem: Unexpected high API costs

Solutions:

  1. Monitor usage in OpenAI dashboard
  2. Review and optimize prompts
  3. Use batch operations efficiently
  4. Consider setting usage limits

Translation Errors

Problem: Translation command fails

Solutions:

  1. Verify API key is configured
  2. Check language code is valid
  3. Ensure source language file exists
  4. Review error messages in console
  5. Try smaller batch sizes

Advanced Configuration

Custom Model Selection

To use a different OpenAI model, edit app/Services/AIService.php:

php
protected function getModel(): string
{
    // Options:
    // 'gpt-4o-mini' - Recommended (cheapest, fast)
    // 'gpt-3.5-turbo' - Alternative
    // 'gpt-4' - More capable but expensive
    
    return 'gpt-4o-mini';
}

Custom Prompts

You can customize AI prompts by modifying the service methods in AIService.php to better match your needs.


Support & Resources

Documentation

Getting Help


Summary

AI CMS Pro's AI features provide powerful assistance for content creation and management. By following best practices and understanding the costs, you can leverage these features to significantly improve your workflow and content quality.

Key Takeaways:

  • ✅ Configure OpenAI API key in Settings
  • ✅ Review all AI-generated content
  • ✅ Monitor API usage and costs
  • ✅ Use AI as a tool, not a replacement for human editing
  • ✅ Follow security best practices

Last Updated: 1/22/2026

Released under the MIT License.