---
title: "Install the AI Suggestion extension"
description: "Integrate the AI Suggestion extension into your application with this setup guide. More in the docs."
---

> [Tiptap Editor 3.0 is out. Start here](https://tiptap.dev/docs/resources/whats-new.md)

# Install the AI Suggestion extension

Integrate the AI Suggestion extension into your application with this setup guide. More in the docs.

Tags: Available in Team plan, Beta

## Requirements

**1. Activate trial or subscribe**

Start a [free trial](https://cloud.tiptap.dev/v2?trial=true) or [subscribe to the Team plan](https://cloud.tiptap.dev/v2/billing) in your account.

**2. Integrate an AI provider**

Configure OpenAI in your [AI settings](https://cloud.tiptap.dev/v2/cloud/ai) or review the [Custom LLM guide](https://tiptap.dev/docs/v2/content-ai/capabilities/suggestion/custom-llms.md).

**3. Install from private registry**

To install the frontend extensions, authenticate to Tiptap’s private npm registry by following the [setup guide](https://tiptap.dev/docs/v2/guides/pro-extensions.md).

This setup guide will help you integrate the AI Suggestion Extension from scratch into your application.

## Install
The AI Suggestion extension is published in Tiptap’s private npm registry. Integrate the extension by following the [private registry guide](https://tiptap.dev/docs/v2/guides/pro-extensions.md).

Once you're ready you can install it like any other Tiptap Pro extension.

```bash
npm install @tiptap-pro/extension-ai-suggestion
```

## Import the extension in your editor

Add the `AiSuggestion` to the list of extensions.

```ts
import { Editor } from '@tiptap/core'
import StarterKit from '@tiptap/starter-kit'
import AiSuggestion from '@tiptap-pro/extension-ai-suggestion'

// Initialize the editor
const editor = new Editor({
  extensions: [
    StarterKit,
    AiSuggestion.configure({
      // Define suggestion rules
      rules: [
        {
          id: '1',
          title: 'Spell Check',
          prompt: 'Identify and correct any spelling mistakes',
          color: '#DC143C',
          backgroundColor: 'FFE6E6',
        },
      ],
      // Configure Content AI Cloud (see next section)
      appId: 'APP_ID_HERE',
      token: 'TOKEN_HERE',
      // … other options
    }),
    // … more extensions
  ],
  // Recommended: disable spellcheck to avoid conflicts
  editorProps: {
    attributes: {
      spellcheck: false,
    },
  },
})
```

## Decide how suggestions are generated

The next step is to configure a way to generate the suggestions that will be displayed in the editor.

The easiest way to get started with the AI Suggestion extension is to use Tiptap Content AI Cloud. Our API will generate suggestions from your rules and content. Follow this setup guide: [Use Tiptap Content AI Cloud](https://tiptap.dev/docs/v2/content-ai/capabilities/suggestion/use-with-content-ai-cloud.md).

You can also use your own backend and LLMs to generate proofreading suggestions. You can find a guide here: [Integrate your own backend and LLMs](https://tiptap.dev/docs/v2/content-ai/capabilities/suggestion/custom-llms.md).

## Customize the User Interface

Finally, you’ll need to configure the editor styles so that the suggestions are displayed in the UI.

By default, the AI Suggestions have CSS classes and color attributes to help you style them. Use these CSS styles to show a colored underline below the suggestions.

```css
.tiptap-ai-suggestion {
  border-bottom: 2px solid var(--tiptap-ai-suggestion-color);
  margin-bottom: -2px;
}

.tiptap-ai-suggestion--selected {
  background-color: var(--tiptap-ai-suggestion-background-color);
  transition: background-color 0.5s;
}
```

You can customize the suggestions' appearance even more by providing custom decorations. To show a tooltip or a popover when you select a suggestion, [follow this guide](https://tiptap.dev/docs/v2/content-ai/capabilities/suggestion/features/display-suggestions.md#show-a-popover-when-you-select-a-suggestion).
