---
title: "Use the AI Agent extension with Content AI Cloud"
description: "Learn how to use the AI Agent extension with Tiptap Content AI Cloud."
canonical_url: "https://tiptap.dev/docs/content-ai/capabilities/agent/use-with-content-ai-cloud"
---

# Use the AI Agent extension with Content AI Cloud

Learn how to use the AI Agent extension with Tiptap Content AI Cloud.

- **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 follow the
  [Custom AI agent guide](https://tiptap.dev/docs/content-ai/capabilities/agent/custom-llms.md) to integrate it with other
  AI providers.
- **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).

The fastest way to get started with the AI Agent extension is with Tiptap Cloud. It provides a managed, ready-to-use AI agent that works out of the box.

> **Note:**
>
> This guide relies on using [Tiptap Cloud](https://cloud.tiptap.dev/v2/cloud/ai) as a backend. If
> you want to use it with your own backend, follow the [custom AI agent
> guide](https://tiptap.dev/docs/content-ai/capabilities/agent/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)

## Add your authentication credentials to the extension

Use the `AiAgentProvider` class to connect with Tiptap Cloud. It handles the communication with Tiptap Cloud and manages the AI agent's state.

```tsx
import { Editor } from '@tiptap/core'
import StarterKit from '@tiptap/starter-kit'
import AiAgent, { AiAgentProvider } from '@tiptap-pro/extension-ai-agent'

const provider = new AiAgentProvider({
  // Your Tiptap Content AI app id
  appId: 'APP_ID_HERE',
  // Your generated JWT. It MUST NOT be the OpenAI API key!
  token: 'TOKEN_HERE',
  // ... Other options
})
```

When you use the `AiAgentProvider` to send messages to the AI agent, the Tiptap Cloud API will be called to get the AI agent's response. The AI agent will then generate chat messages and make edits to the document to accomplish the user's task.

## Customize the OpenAI model

You can customize the OpenAI model that is used in Tiptap Cloud by setting the `modelName` option. The AI Agent extension works best with the `gpt-4.1` model, as it provides the best performance for complex document editing tasks. Note that the model needs to support [function calling](https://platform.openai.com/docs/guides/function-calling).

```tsx
const provider = new AiAgentProvider({
  modelName: 'gpt-4.1',
})
```
