To add the {pluginname} plugin to the editor, add both `{plugincode}` to the `plugins` option in the editor configuration and the `ai_request` function to the editor configuration.
To add the {pluginname} plugin to the editor, follow these steps:
For example, interfacing with the OpenAI Completions API:
- Add `{plugincode}` to the `plugins` option in the editor configuration.
- Add the `ai_request` function to the editor configuration.
include::partial$misc/admon-ai-proxy.adoc[]
For example:
[source,js]
----
// Providing access credentials within the integration is not recommended for production use.
// We recommend setting up a proxy server to authenticate requests and provide access.
const api_key = '<INSERT_API_KEY_HERE>';
tinymce.init({
selector: 'textarea', // Change this value according to your HTML
selector: 'textarea', // change this value according to your HTML