AI writing assistant.
Configure AI writing help for partners from System settings or your server environment.
The AI writing assistant is optional. Your installation sends requests through its own provider account. Partners can use the assistant to draft and revise text in supported dashboard fields, then review the result before publishing it.
Open the AI settings
- Sign in as a Super Administrator.
- Open Settings.
- Select AI assistant.
The top card reports one of three states:
- Ready: the assistant is enabled and the app has a key, model, and provider endpoint.
- Needs setup: the switch is on, but one or more required values are missing.
- Disabled: partner fields do not show AI actions.
This check reads local configuration. It does not contact the provider or prove that the key, model, or endpoint works.
Dashboard controls
| Setting | What it controls |
|---|---|
| Enable AI writing assistant | Shows AI actions on fields that support them. The field must also opt in, and a provider key must resolve. |
| Model | The model id sent to the configured provider. This is free text so OpenAI-compatible providers can use their own names. |
| Temperature | Controls output variation from 0 through 2. Lower values tend to produce steadier wording. |
| Maximum output tokens | Sets an optional response-length limit. Leave it blank to use the server default. |
| API key | Keeps, replaces, or clears the encrypted database key. The app never shows a saved key again. |
Save once after making changes. Partner form controls use the new resolved settings on the next request.
Reset and fallback behavior
Dashboard values override server environment values. The resolution order is:
- A saved dashboard value
- The matching
.envvalue - The built-in default
Use a field's Reset action to delete its dashboard override. A blank Maximum output tokens field does the same. Both cases return that setting to its .env or built-in value.
The API key has explicit actions:
- Keep current key leaves the stored key untouched.
- Replace key requires a new value and saves it with encryption.
- Clear saved key deletes the database row. If
.envcontainsOPENAI_API_KEY, the app uses that key again.
Server-only settings
The dashboard does not edit these values:
| Variable or config value | Purpose |
|---|---|
OPENAI_BASE_URL |
Chat-completions endpoint for OpenAI or another compatible provider |
OPENAI_ORGANIZATION |
Optional OpenAI organization header |
prompts.system |
System instruction sent with each request |
prompts.prompts |
Built-in writing actions and templates |
You can also keep every editable value in .env:
OPENAI_ENABLED=true
OPENAI_API_KEY="your-provider-key"
OPENAI_MODEL="your-model-id"
OPENAI_BASE_URL="https://api.openai.com/v1"
After changing .env on a cached production install, clear the configuration cache:
php artisan config:clear
Compatible providers and models
Reward Loyalty calls an OpenAI-compatible chat-completions endpoint. The configured model must accept the request parameters the app already sends, including temperature and max_tokens when set.
OpenAI, DeepSeek, and self-hosted compatible servers can work through the same settings. Enter the exact model id from your provider. For deepseek-chat and deepseek-reasoner, the app keeps its existing DeepSeek response-format handling.
The app does not maintain a model catalogue. A Ready badge confirms presence, so the first real writing action remains the practical compatibility check.
Data sent to the provider
Each writing request sends:
- The system prompt configured by the installation operator
- The text the signed-in partner asks the assistant to revise
- The signed-in partner's email address in the chat-completions
userfield
The provider receives this data at OPENAI_BASE_URL. Choose a provider and retention policy that fit your privacy duties. Tell partners which provider you use, and do not put secrets or sensitive customer data into a writing field.
Reward Loyalty strips HTML from the returned text. A person still needs to check accuracy, tone, and claims before publication.
API-key security and recovery
When you save an API key from the dashboard, Reward Loyalty encrypts it with the installation's APP_KEY. The app never puts the resolved key into page HTML, old form input, validation output, application logs, activity-log values, or exports.
A database backup includes the encrypted row. Store APP_KEY apart from the database backup and protect both.
If you lose or rotate APP_KEY, Reward Loyalty cannot decrypt the old row. The app skips that row so boot can continue and falls back to .env when possible. Recover by entering a new key in Settings → AI assistant, or set OPENAI_API_KEY in .env and clear the unusable database override.
Troubleshooting
| Symptom | What to check |
|---|---|
| AI actions do not appear | Confirm the assistant is enabled, a key resolves, and the specific field supports AI. Reload the form after saving. |
| Status says Needs setup | Check the four readiness items: enabled, key, model, and endpoint. |
| Authentication error | Replace the saved key or clear it to test the .env key. Check the provider account outside Reward Loyalty. |
| Model not found | Copy the exact model id from the provider and save it in Model. |
| Unsupported parameter | Use a chat-completions model that accepts the existing temperature and max_tokens request fields. |
| Connection refused | Check OPENAI_BASE_URL, DNS, firewall rules, and the local server process when self-hosting. |
The AI settings page has no Test connection button. It avoids spending tokens or sending data during setup and never makes a provider call on page load.
Related topics
- System settings: Installation-wide settings and precedence
- Languages & translations: Dashboard language support
- Partners overview: Partner dashboard features