---
title: "Install the AI Generation extension"
description: "Set up Tiptap AI Generation in your editor, including configuring OpenAI keys and JWT authentication for secure AI integration."
canonical_url: "https://tiptap.dev/docs/content-ai/capabilities/generation/install"
---

# Install the AI Generation extension

Set up Tiptap AI Generation in your editor, including configuring OpenAI keys and JWT authentication for secure AI integration.

- **1. Activate trial or subscribe**

  Start a [free trial](https://cloud.tiptap.dev/v2?trial=true) or [subscribe to the Start 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/content-ai/capabilities/generation/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/guides/pro-extensions.md).

This installation guide relies on using the [Tiptap Content AI backend service](https://cloud.tiptap.dev/v2/cloud/ai), if you want to configure it with your own custom LLM you need to follow [this guide](https://tiptap.dev/docs/content-ai/capabilities/generation/custom-llms.md) instead.

## Start your Content AI app

1. **Activate a plan:** Begin a [free trial or choose a subscription](https://cloud.tiptap.dev/v2/billing).
2. **Configure your AI app.** Add your OpenAI API key to your [Content AI app](https://cloud.tiptap.dev/v2/cloud/ai).
3. **Set up authentication**: Generate a JWT (HS256 algorithm) with our provided secret to authenticate the extension against our service. [Get your JWT secret.](https://cloud.tiptap.dev/v2/cloud/ai)

## Access the private registry

The AI Generation extension is published in Tiptap’s private npm registry. Integrate the extension by following the [private registry guide](https://tiptap.dev/docs/guides/pro-extensions.md). If you already authenticated your Tiptap account you can go straight to [#Install](#install).

## Install

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

The integration into your editor instance is done like every other Tiptap extension. This is an example on how it could look like:

```js
import { Editor } from '@tiptap/core'
import StarterKit from '@tiptap/starter-kit'
import Ai from '@tiptap-pro/extension-ai'

const editor = new Editor({
  extensions: [
    StarterKit,
    Ai.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',
      autocompletion: true,
      // … other options (see below)
    }),
    // … more extensions
  ],
})
```

At this point you're good to go to use OpenAI in your Tiptap editor. Have a look at the [configuration options](https://tiptap.dev/docs/content-ai/capabilities/generation/configure.md) to customize your experience.

## Privacy and data handling

Learn how Tiptap processes AI requests and handles your content data in our [privacy documentation](https://tiptap.dev/docs/content-ai/resources/privacy.md). This covers data retention, security practices, and compliance information for using Content AI features.
