Select the text and click the sparkles button on the toolbar or the '+' (plus) button to start interacting with AI.
This plugin is a paid add-on. You need to buy Redactor together with AI Tools plugin if you don't have it yet. Or buy the plugin separately in your account if you already have Redactor.
This shows only a demonstration of how the plugin works, you can find the details of customization and usage in the documentation.
<!DOCTYPE html>
<html>
<head>
<title>Redactor</title>
<meta charset="utf-8">
<!-- css -->
<link rel="stylesheet" href="/your-folder/redactor.css" />
</head>
<body>
<!-- element -->
<textarea id="entry">...</textarea>
<!-- js -->
<script src="/your-folder/redactor.js"></script>
<script src="/your-folder/plugins/ai/ai.js"></script>
<!-- call -->
<script>
Redactor('#entry', {
plugins: ['ai'],
ai: {
text: {
url: '/path-to-server-side/',
endpoint: 'https://api.openai.com/v1/chat/completions',
model: 'gpt-4o',
stream: true
},
image: {
url: '/path-to-server-side/',
endpoint: 'https://api.openai.com/v1/images/generations',
model: 'dall-e-3'
}
}
});
</script>
</body>
</html>