AI Assistant
CartUser ships with an OpenAI-powered AI Assistant โ accessible from any admin page via the right-side sliding drawer. Generate product descriptions, rewrite content, translate to any language, or write SEO copy with one click.
What it does
- Generate product descriptions from a few keywords
- Rewrite โ improve, fix grammar, simplify, make detailed, fix mistakes
- Adjust tone โ engaging, formal, casual, friendly, exciting, confident
- Translate to any language (200+ supported)
- Custom prompts โ type your own instructions
- Insert into editor โ one click pushes generated text back into the textarea/Summernote
- Copy to clipboard for use elsewhere
Setup
Step 1 โ Get an OpenAI API key
- Go to platform.openai.com/api-keys.
- Create an account if you don't have one.
- Click Create new secret key.
- Copy the key starting with
sk-. - Add billing info ($5-10 credit is plenty to start).
Step 2 โ Configure in CartUser
- Admin โ Settings โ AI Configuration.
- Paste your OpenAI API key.
- Choose model (see model selection below).
- Set Status to Active.
- Save.
- Refresh any admin page โ AI tab appears on the right edge of the screen.
documentation/screenshots/ai_config.png
AI Configuration page with model selector.
Model selection
Different models = different cost/quality tradeoffs:
| Model | Quality | Speed | Cost (per 1K tokens) | Recommended for |
|---|---|---|---|---|
| GPT-4o Mini (default) | โ โ โ โ | Fast | $0.00015 | Most users โ great balance |
| GPT-4o | โ โ โ โ โ | Fast | $0.0025 | Premium content, longer text |
| GPT-4 Turbo | โ โ โ โ โ | Medium | $0.01 | Long-form articles, complex prompts |
| GPT-4 | โ โ โ โ | Slow | $0.03 | Legacy compatibility |
| GPT-3.5 Turbo | โ โ โ | Fastest | $0.00050 | Bulk operations, low-cost |
| O4-Mini | โ โ โ โ | Slow | $0.003 | Reasoning tasks, careful analysis |
Using the AI Assistant
Open the drawer
Click the purple AI tab on the right edge of any admin page. The drawer slides in from the right.
Generate from scratch
- Type your content (or topic) in the prompt box.
- Click a quick action: Improve, Grammar, Simplify, More Detail.
- AI responds in the chat area.
- Click Insert to put result into the textarea/editor below the AI button. Or click Copy to clipboard.
Generate from existing text
Click the Generate with AI button that appears under any textarea once you've typed 2+ words. The AI loads with your current text pre-filled โ choose Improve/Rewrite/Translate from there.
Translate
- Open drawer โ click Translate.
- Choose target language (any of 200+).
- AI translates current content.
- Click Insert.
Tone adjustment
- Open drawer โ click More Options.
- Scroll to Adjust Tone.
- Pick: Engaging, Formal, Casual, Friendly, Exciting, Confident.
Custom prompts
Type your own instruction at the bottom: "Rewrite this as a tweet under 280 characters" or "Add 5 bullet points highlighting eco-friendly features".
Where the AI button appears
- Globally โ right-side tab on every admin page
- Product create / edit pages โ below description textarea
- Digital product pages โ same as physical
- SEO meta description fields
- Email template editor
- Blog editor
- Anywhere a textarea has 2+ words typed
Cost management
Set usage limits
OpenAI dashboard โ Usage limits โ set monthly hard cap (e.g. $20).
Choose cheaper model for bulk operations
If you're translating 1000 products, switch to GPT-3.5 Turbo (10x cheaper than GPT-4o). Switch back to GPT-4o for premium content.
Typical costs
- One product description (200 words): ~$0.0005 with GPT-4o Mini
- One translation (500 words): ~$0.001
- 100 product descriptions per month: ~$0.05
Troubleshooting
AI tab not showing
- Verify Status = Active in Admin โ Settings โ AI Configuration
- Verify API key starts with
sk- - Clear cache:
php artisan cache:clear - Hard-refresh page (Ctrl+Shift+R)
"Invalid API key" error
Key is wrong or expired. Generate a new one in OpenAI dashboard.
"Quota exceeded" error
Add billing credit at platform.openai.com/account/billing.
"Rate limit exceeded"
Wait 60 seconds, try again. OpenAI free tier has tight rate limits โ upgrade your account if it persists.
Response is generic / not useful
- Add more context to your prompt (product type, target audience, key features)
- Try a stronger model (GPT-4o instead of GPT-4o Mini)
- Use a custom prompt with specific instructions
Privacy
- Your OpenAI API key is stored encrypted in the settings table
- Prompts are sent to OpenAI's API โ they don't store data by default but check OpenAI's privacy policy
- No CartUser data leaves your server unless you explicitly send it via AI prompt
-
Conversation history is stored locally in your database (
ai_conversationstable) โ not sent to OpenAI