OpenAI Integration
Connect core CRM AI features to OpenAI, configure standard models and controlled fine-tuning, and understand the exact privacy, model and job behaviour.
Find model settings and output controls
Review the real configuration screen and verify the authorised connection with the written guide.
Open connected topic →
Open guide →GuideOpenAI Integration module overview
OpenAI Integration module overviewConnect the CRM AI-provider registry to OpenAI, configure the standard model and optionally use a CRM-trained fine-tuned model.Admin Area → Setup → Settings → AI → OpenAI
Open guide →GuideInstall and activate OpenAI Integration v1.0.0
Install and activate OpenAI Integration v1.0.0Activate the bundled provider module and verify that its settings child appears under the CRM AI settings group.Admin Area → Setup → Modules → OpenAI Integration → Activate
Open guide →GuideVerify the CRM and PHP requirements for OpenAI Integration
Verify the CRM and PHP requirements for OpenAI IntegrationCheck the supplied version requirements before activation or upgrade.Server diagnostics and Admin Area → Setup → Modules → OpenAI Integration
Open guide →GuideOpen the OpenAI settings workspace
Open the OpenAI settings workspaceUse the real settings path rather than looking for a standalone OpenAI menu.Admin Area → Setup → Settings → AI → OpenAI
Open guide →GuideEnter the OpenAI API key
Enter the OpenAI API keyStore the provider credential used to construct the OpenAI client.Admin Area → Setup → Settings → AI → OpenAI
Open guide →GuideChoose the standard OpenAI model
Choose the standard OpenAI modelSelect the model used when fine-tuning is disabled or no fine-tuned model is selected.Admin Area → Setup → Settings → AI → OpenAI
Open guide →GuideSet the OpenAI maximum token value
Set the OpenAI maximum token valueControl the max_tokens value sent with each chat request.Admin Area → Setup → Settings → AI → OpenAI
Open guide →GuideConfigure the CRM AI system prompt
Configure the CRM AI system promptSet the parent CRM AI system instruction that OpenAI uses as the developer message and fine-tuning system message.Admin Area → Setup → Settings → AI
Open guide →GuideSave and verify OpenAI provider settings
Save and verify OpenAI provider settingsConfirm that the API key, model and maximum-token values persist and the provider is registered.Admin Area → Setup → Settings → AI → OpenAI
Open guide →GuideUse the OpenAI module action links
Use the OpenAI module action linksOpen either the provider-specific settings or the parent AI settings from the module list.Admin Area → Setup → Modules → OpenAI Integration → action links
Open guide →GuideUnderstand the OpenAI provider registry key
Understand the OpenAI provider registry keyKnow how the module becomes available to core CRM AI features.Code-backed reference → openai.php → openai_module_init
Open guide →GuideExtend the standard model list with the openai_models filter
Extend the standard model list with the openai_models filterAdd supported model entries without editing the provider class.Development integration → hook openai_models
Open guide →GuideDeactivate OpenAI Integration safely
Deactivate OpenAI Integration safelyDisable the provider module without assuming its stored options are deleted.Admin Area → Setup → Modules → OpenAI Integration → Deactivate
Open guide →GuideTroubleshoot a missing OpenAI settings section
Troubleshoot a missing OpenAI settings sectionCheck module activation, CRM version and parent AI settings registration when the child section is absent.Admin Area → Setup → Settings → AI → OpenAI
Open guide →WorkflowOpen connected topic →
Open guide →GuideUse OpenAI through a core CRM AI action
Use OpenAI through a core CRM AI actionRun a supported core AI action after configuring the provider.Open a CRM editor or AI-enabled feature → choose the configured AI action
Open guide →GuideUnderstand standard versus fine-tuned model selection
Understand standard versus fine-tuned model selectionKnow which model is used for each request.Admin Area → Setup → Settings → AI → OpenAI
Open guide →GuideUnderstand the OpenAI chat message roles
Understand the OpenAI chat message rolesReview the exact messages sent by the provider.Code-backed reference → OpenAiProvider::chat
Open guide →GuideUnderstand stored OpenAI chat responses
Understand stored OpenAI chat responsesAccount for the store=true option in every normal chat request.Code-backed reference → OpenAiProvider::chat
Open guide →GuideUnderstand maximum-token handling in chat requests
Understand maximum-token handling in chat requestsConfirm how the configured numeric value is applied.Code-backed reference → OpenAiProvider constructor and chat
Open guide →GuideUnderstand response-choice handling
Understand response-choice handlingKnow which part of the provider response is returned to the CRM.Code-backed reference → OpenAiProvider::chat
Open guide →GuideUnderstand HTML code-fence stripping
Understand HTML code-fence strippingReview how a response wrapped in an html code fence is cleaned.Code-backed reference → OpenAiProvider::chat
Open guide →GuideEnhance CRM editor text with OpenAI
Enhance CRM editor text with OpenAIUse the host AI enhancement action to request a more polite, formal or friendly result.Open an AI-enabled CRM TinyMCE editor → select text → AI enhancement action
Open guide →GuideUnderstand HTML-to-Markdown conversion before enhancement
Understand HTML-to-Markdown conversion before enhancementKnow how existing formatted content is prepared for the enhancement prompt.Code-backed reference → OpenAiProvider text-enhancement flow
Open guide →GuideUnderstand TinyMCE-compatible enhancement output
Understand TinyMCE-compatible enhancement outputReview the expected output format and paragraph-wrapper handling.Open an AI-enabled TinyMCE editor → AI enhancement action
Open guide →GuideExtend AI text enhancement with the before_ai_tickets_enhance_text filter
Extend AI text enhancement with the before_ai_tickets_enhance_text filterAlter the source text through the registered filter before it is sent.Development integration → hook before_ai_tickets_enhance_text
Open guide →GuideTroubleshoot an empty or malformed AI response
Troubleshoot an empty or malformed AI responseCheck credentials, model access, limits and first-choice content when no usable text is returned.Open the host CRM AI action and review application logs
Open guide →WorkflowOpen connected topic →
Open guide →GuideOpen the OpenAI fine-tuning workspace
Open the OpenAI fine-tuning workspaceAccess training-source counts, job status and model controls from the OpenAI settings page.Admin Area → Setup → Settings → AI → OpenAI → Advanced Features → OpenAI Fine Tuning
Open guide →GuideUnderstand fine-tuning permissions
Understand fine-tuning permissionsSeparate read access from job, model and option changes.Admin Area → Setup → Settings → AI → OpenAI → Advanced Features → OpenAI Fine Tuning
Open guide →GuideChoose a fine-tuning base model
Choose a fine-tuning base modelSelect the supported base model used for the next fine-tuning job.Admin Area → Setup → Settings → AI → OpenAI → Advanced Features → OpenAI Fine Tuning
Open guide →GuidePrepare eligible knowledge-base articles for fine-tuning
Prepare eligible knowledge-base articles for fine-tuningPublish active public articles that the training collector can read.Admin Area → Support/Knowledge Base → Articles, then OpenAI Fine Tuning
Open guide →GuidePrepare predefined replies for fine-tuning
Prepare predefined replies for fine-tuningCreate approved reusable replies that the training collector can include.Admin Area → Setup/Support → Predefined Replies, then OpenAI Fine Tuning
Open guide →GuideMeet the minimum fine-tuning source requirement
Meet the minimum fine-tuning source requirementProvide enough eligible content for the Start Fine Tuning action.Admin Area → OpenAI Fine Tuning → Training Data Sources
Open guide →GuideReview knowledge-base and predefined-reply source counts
Review knowledge-base and predefined-reply source countsUse the displayed counts before starting a job.Admin Area → Setup → Settings → AI → OpenAI → Advanced Features → OpenAI Fine Tuning
Open guide →GuideUnderstand the default fine-tuning training prompt
Understand the default fine-tuning training promptKnow how each source item is converted into a user/assistant example.Code-backed reference → OpenAiProvider::formatTrainingData
Open guide →GuideExtend eligible knowledge-base sources with the openai_fine_tuning_knowledge_base filter
Extend eligible knowledge-base sources with the openai_fine_tuning_knowledge_base filterAdjust the collected public article array through the supported hook.Development integration → hook openai_fine_tuning_knowledge_base
Open guide →GuideExtend predefined-reply sources with the openai_fine_tuning_predefined_replies filter
Extend predefined-reply sources with the openai_fine_tuning_predefined_replies filterAdjust the predefined-reply training array through the supported hook.Development integration → hook openai_fine_tuning_predefined_replies
Open guide →GuideAlter formatted training examples with the openai_fine_tuning_training_data filter
Alter formatted training examples with the openai_fine_tuning_training_data filterModify the final message arrays before JSONL encoding.Development integration → hook openai_fine_tuning_training_data
Open guide →GuideTroubleshoot insufficient fine-tuning data
Troubleshoot insufficient fine-tuning dataResolve the start-job rejection when neither source reaches the required count.Admin Area → Setup → Settings → AI → OpenAI → Advanced Features → OpenAI Fine Tuning
Open guide →WorkflowOpen connected topic →
Open guide →GuideStart an OpenAI fine-tuning job
Start an OpenAI fine-tuning jobCreate and upload training JSONL and submit a job with the selected base model.Admin Area → Setup → Settings → AI → OpenAI → Advanced Features → OpenAI Fine Tuning
Open guide →GuideUnderstand previous pcrm-model cleanup before a new job
Understand previous pcrm-model cleanup before a new jobKnow why module-owned fine-tuned models may be deleted when training starts.Code-backed reference → OpenAiProvider::createFineTuningJob
Open guide →GuideUnderstand OpenAI training JSONL generation
Understand OpenAI training JSONL generationReview the exact line-oriented format sent to the provider.Code-backed reference → OpenAiProvider::formatTrainingData
Open guide →GuideUnderstand the temporary training-file path and cleanup
Understand the temporary training-file path and cleanupReview local temporary-file handling during job creation.Server temporary directory → pcrm_training_{timestamp}.jsonl
Open guide →GuideUnderstand the OpenAI training-file upload
Understand the OpenAI training-file uploadKnow the purpose and file identifier used for the provider upload.Code-backed reference → OpenAI files upload
Open guide →GuideUnderstand the fine-tuning job suffix
Understand the fine-tuning job suffixIdentify module-created jobs and models.Code-backed reference → OpenAI fineTuning createJob
Open guide →GuideReview saved fine-tuning job and file identifiers
Review saved fine-tuning job and file identifiersFind the options used for later status and cleanup operations.Admin Area → Setup → Settings → AI → OpenAI → Advanced Features → OpenAI Fine Tuning
Open guide →GuideRefresh the last fine-tuning job status
Refresh the last fine-tuning job statusRetrieve current provider status from the workspace.Admin Area → Setup → Settings → AI → OpenAI → Advanced Features → OpenAI Fine Tuning → Refresh Status
Open guide →GuideUnderstand fine-tuning job statuses and timestamps
Understand fine-tuning job statuses and timestampsInterpret status, created time, finished time and error information returned by the provider.Admin Area → Setup → Settings → AI → OpenAI → Advanced Features → OpenAI Fine Tuning
Open guide →GuideUnderstand automatic model selection after successful training
Understand automatic model selection after successful trainingKnow when the returned model becomes selected and enabled.Admin Area → Setup → Settings → AI → OpenAI → Advanced Features → OpenAI Fine Tuning
Open guide →GuideReview fine-tuning errors in CRM activity logs
Review fine-tuning errors in CRM activity logsFind provider or file/job errors captured by the module.Admin Area → Utilities/Activity Log and server logs
Open guide →GuideStart a replacement fine-tuning job safely
Start a replacement fine-tuning job safelyReview the destructive pcrm-model cleanup and source quality before retraining.Admin Area → Setup → Settings → AI → OpenAI → Advanced Features → OpenAI Fine Tuning
Open guide →WorkflowOpen connected topic →
Open guide →GuideReview available fine-tuned OpenAI models
Review available fine-tuned OpenAI modelsRead the model ID, creation time, owner, active marker and available actions.Admin Area → Setup → Settings → AI → OpenAI → Advanced Features → OpenAI Fine Tuning
Open guide →GuideUnderstand pcrm-owned model identification
Understand pcrm-owned model identificationKnow which models the module treats as its own.Admin Area → Setup → Settings → AI → OpenAI → Advanced Features → OpenAI Fine Tuning
Open guide →GuideSet a fine-tuned model as active
Set a fine-tuned model as activeChoose the exact model ID used when fine-tuning is enabled.Admin Area → Setup → Settings → AI → OpenAI → Advanced Features → OpenAI Fine Tuning → Fine Tuned Models → Set as Active
Open guide →GuideEnable or disable use of fine tuning
Enable or disable use of fine tuningToggle whether normal chat chooses the selected fine-tuned model.Admin Area → Setup → Settings → AI → OpenAI → Advanced Features → OpenAI Fine Tuning → Enable Fine Tuning
Open guide →GuideDelete a pcrm-owned fine-tuned model
Delete a pcrm-owned fine-tuned modelRemove a module-owned provider model from the list.Admin Area → Setup → Settings → AI → OpenAI → Advanced Features → OpenAI Fine Tuning → Fine Tuned Models → Delete
Open guide →GuideUnderstand why an external fine-tuned model cannot be deleted here
Understand why an external fine-tuned model cannot be deleted hereRecognise the ownership guard in the model table.Admin Area → Setup → Settings → AI → OpenAI → Advanced Features → OpenAI Fine Tuning
Open guide →GuideUnderstand recommended and checkpoint model labels
Understand recommended and checkpoint model labelsInterpret the model-table badges accurately.Admin Area → Setup → Settings → AI → OpenAI → Advanced Features → OpenAI Fine Tuning
Open guide →GuideUnderstand fine-tuned model list ordering
Understand fine-tuned model list orderingKnow why some models appear before others.Admin Area → Setup → Settings → AI → OpenAI → Advanced Features → OpenAI Fine Tuning
Open guide →GuideExtend fine-tuning base models with the openai_fine_tuning_models filter
Extend fine-tuning base models with the openai_fine_tuning_models filterAdd an allowed base-model option without editing the provider.Development integration → hook openai_fine_tuning_models
Open guide →GuideTroubleshoot a missing or unusable fine-tuned model
Troubleshoot a missing or unusable fine-tuned modelCheck job status, ownership, selected ID and enable toggle.Admin Area → Setup → Settings → AI → OpenAI → Advanced Features → OpenAI Fine Tuning
Open guide →WorkflowOpen connected topic →
Open guide →GuideProtect the OpenAI API key
Protect the OpenAI API keyApply least privilege and secret-handling controls to the stored credential.Admin Area → Setup → Settings → AI → OpenAI
Open guide →GuideAssess personal-data transfer to OpenAI
Assess personal-data transfer to OpenAIReview lawful basis, minimisation and provider terms before using CRM data in prompts.Data protection review → CRM AI features
Open guide →GuideReview AI-generated content before use
Review AI-generated content before usePrevent unverified output from becoming an official CRM communication or decision.Any CRM feature using OpenAI → review generated result
Open guide →GuideMonitor OpenAI cost and usage externally
Monitor OpenAI cost and usage externallyUse provider-side controls because this module has no usage dashboard.OpenAI provider account → Usage/Billing
Open guide →GuideUnderstand the absence of OpenAI module cron and webhooks
Understand the absence of OpenAI module cron and webhooksDo not expect background polling or inbound provider events from this module.Code-backed reference → supplied OpenAI module hooks/controllers
Open guide →GuideUnderstand the absence of API-key rotation controls
Understand the absence of API-key rotation controlsPlan credential lifecycle outside the module.OpenAI provider account and Admin Area → Setup → Settings → AI → OpenAI
Open guide →GuideReview OpenAI activity and PHP logs
Review OpenAI activity and PHP logsUse the available evidence when provider calls fail.Admin Area → Utilities/Activity Log and server PHP logs
Open guide →GuideTroubleshoot OpenAI authentication or model-access errors
Troubleshoot OpenAI authentication or model-access errorsVerify key validity, account access and the selected model.Admin Area → Setup → Settings → AI → OpenAI
Open guide →GuideTroubleshoot OpenAI rate-limit, quota or token errors
Troubleshoot OpenAI rate-limit, quota or token errorsReduce request frequency/size or correct provider account limits.Admin Area → Setup → Settings → AI → OpenAI
Open guide →GuideRun the OpenAI Integration production verification checklist
Run the OpenAI Integration production verification checklistVerify settings, controlled output, fine-tuning access and privacy controls before release.Admin Area → Setup → Settings → AI → OpenAI
Open guide →