Use the AI Suggestion extension with Tiptap Content AI Cloud

The fastest way to get started with the AI Suggestion extension is to let the suggestions be generated with the Tiptap Content AI Cloud API. This works out of the box, you only need to provide the authentication credentials to the extension.

Set Up Tiptap AI for Your Team

This extension relies on using our Content AI backend service. You'll need a valid Entry, Business or Enterprise subscription. Just head over to our pricing page to learn more.

  1. You'll need to provide an OpenAI API token yourself, which we're using in order to send requests to the OpenAI API. Your token is stored well encrypted and is only used on a per-request basis. Add the OpenAI API Key to your team.
  2. Generate a JWT (HS256 algorithm) with our provided secret to authenticate the extension against our service. Get your JWT secret.
  3. Copy your App ID and JWT Token, you'll use them to configure your application.

Add Your Authentication Credentials to the Extension

Import the extension and configure it with your Tiptap Content AI app id and token.

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({
      // Your Tiptap Content AI app id
      appId: 'APP_ID_HERE',
      // This needs to be your generated JWT and MUST NOT be the OpenAI API key!
      token: 'TOKEN_HERE',
      // Other configuration options...
    }),
  ],
})

Now, when the editor loads, the suggestions will be fetched from the Tiptap Content AI API.