Sign up (with export icon)

AIConfig

Api-interface iconinterface

The configuration for all AI-related functionalities.

Provides configuration properties for both AI features and AI adapters (which connect to the external AI services),

ClassicEditor
	.create( {
		ai: {
			// ...
		}
	} )
	.then( ... )
	.catch( ... );
Copy code

See all editor configuration options.

Properties

  • Chevron-right icon

    The configuration of the AI Assistant feature.

    Read more in AIAssistantConfig.

  • Chevron-right icon

    availableReplyActions : Array<'applySuggestion' | 'insertSuggestion'> | undefined

    Defines what actions are available for the user when interacting with AI responses in AI Chat and AI Quick Actions features.

    Users can perform following two actions:

    • 'applySuggestion' - applies the presented change directly into the editor content.
    • 'insertSuggestion' - applies the presented change as a suggestion, which can be later on accepted or rejected.

    This setting impacts:

    • The action buttons located below an AI reply in the chat feed.
    • The buttons located in the header of each change preview in the chat feed.
    • The buttons located in the balloon which shows the change preview.

    Through this configuration option, you can change how users use the AI replies. For example, if you want to force users to always insert AI-proposed changes as suggestions, omit 'applySuggestion' action.

    Please note other factors that impact the availability of these actions:

    • Buttons related to 'applySuggestion' action are hidden if track changes feature is turned on.
    • Buttons related to 'insertSuggestion' action are hidden if track changes feature is not loaded in the editor.

    Please note, that due to these factors, it is possible to accidentally configure the editor in a way, that no UI elements are presented to the user.

    Defaults to [ 'applySuggestion', 'insertSuggestion' ]

  • Chevron-right icon

    chat : AIChatConfig | undefined

    The configuration of the AI Chat feature.

    Read more in AIChatConfig.

  • Chevron-right icon

    The configuration of the AI user interface provided by the AITabs plugin.

  • Chevron-right icon

    A list of context references that are automatically attached to AI features. Each entry references an administrator-managed context, which is a reusable collection of prompts and files defined through the AI service and identified by its id.

    Note: The headless gateway APIs (AIReviewGateway, AITranslateGateway, and AIDocumentProcessingGateway) are config-independent by design and do not apply this option. Pass their context references explicitly through the contexts run option instead.

    Each entry is a context reference optionally narrowed down to specific features via features. When features is omitted, the entry is attached to every AI feature:

    ClassicEditor
    	.create( {
    		// ... Other configuration options ...
    		ai: {
    			defaultContext: [
    				// Attached to every AI feature.
    				{ id: 'style-guide' },
    
    				// Attached only to the `translate.*` quick actions and to every review command.
    				{
    					id: 'glossary',
    					features: {
    						quickActions: /^translate\./,
    						review: true
    					}
    				}
    			]
    		}
    	} )
    	.then( ... )
    	.catch( ... );
    
    Copy code

    Read more in AIDefaultContext.

  • Chevron-right icon

    Extra HTTP headers that the AI service should attach when it fetches document images that live behind authentication (for example a private CDN or a token-protected asset server) during image analysis.

    The value is a list of entries, each pairing a domain with the headers to attach. A header set is attached when the image URL starts with the entry's domain.

    Because the match is a plain string prefix, always scope each domain to a full origin ending with a slash, for example https://assets.example.com/, so it cannot match a look-alike host such as https://assets.example.com.incorrect.example/.

    It is applied only to the AI Chat message flow and the document processing flow, as these are the only cases where the AI service works with images embedded in the document.

    ClassicEditor.create( {
    	ai: {
    		extraHttpHeaders: [
    			{ domain: 'https://assets.example.com/', headers: { authorization: 'Bearer <token>' } }
    		]
    	}
    } );
    
    Copy code

    Because authorization tokens expire and rotate, the value can also be a function. It is called for every request, so it can return fresh headers each time:

    ClassicEditor.create( {
    	ai: {
    		extraHttpHeaders: () => ( [
    			{ domain: 'https://assets.example.com/', headers: { authorization: `Bearer ${ getFreshToken() }` } }
    		] )
    	}
    } );
    
    Copy code
  • Chevron-right icon

    models : AIModelsConfig | undefined

    The configuration for AI models used across all AI features (Chat and Review).

    ClassicEditor.create( {
    	ai: {
    		models: {
    			defaultModelId: 'gpt-5.4',
    			displayedModels: [ 'gpt', 'claude' ],
    			showModelSelector: true
    		}
    	}
    } )
    .then( ... )
    .catch( ... );
    
    Copy code
  • Chevron-right icon

    The configuration of the AI Quick Actions feature.

    Read more in AIQuickActionsConfig.

  • Chevron-right icon

    The configuration of the AI Review feature.

    Read more in AIReviewModeConfig.

  • Chevron-right icon

    serviceUrl : string | undefined

    The URL of the AI service endpoint.

    This endpoint is used by AI features: AI Chat, AI Quick Actions, and AI Review Mode. It does not affect the AI Assistant feature, which uses its own adapter configuration.

    NOTE: By default, the plugin uses the default AI service endpoint delivered by CKEditor Cloud Services.

    Defaults to 'https://ai.cke-cs.com/v1'

  • Chevron-right icon

    The configuration of the AI Translate feature.