---
title: "AI Generation editor commands"
description: "Integrate AI into your Tiptap Editor to access preconfigured commands for text manipulation and image generation."
canonical_url: "https://tiptap.dev/docs/content-ai/capabilities/generation/text-generation/built-in-commands"
---

# AI Generation editor commands

Integrate AI into your Tiptap Editor to access preconfigured commands for text manipulation and image generation.

- **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 guides](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).

The AI Generation extension for Tiptap Editor includes a set of preconfigured commands that you can integrate into your rich text editor. These commands allow you to adjust text tone, complete text, generate images, and more, enhancing your editor's functionality.

To see how these commands are used, check out the examples on the [overview](https://tiptap.dev/docs/content-ai/capabilities/generation/overview.md) page.

| Command                                                                                                                                                   | Description                                                                                                                                                    |
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`aiAdjustTone(tone: Tone, options: TextOptions)`](#aiadjusttone)                                                                                         | Adjusts the tone of voice of the selected text to the specified [TONE](#aitone).                                                                               |
| [`aiBloggify(options: TextOptions)`](#most-text-commands)                                                                                                 | Rewrite the text into a blog format                                                                                                                            |
| [`aiComplete(options: TextOptions)`](#most-text-commands)                                                                                                 | Completes the selected text                                                                                                                                    |
| [`aiDeEmojify(options: TextOptions)`](#most-text-commands)                                                                                                | Removes emojis from the selected text                                                                                                                          |
| [`aiEmojify(options: TextOptions)`](#most-text-commands)                                                                                                  | Adds emojis ✨ to your text                                                                                                                                     |
| [`aiExtend(options: TextOptions)`](#most-text-commands)                                                                                                   | Extends your text                                                                                                                                              |
| [`aiFixSpellingAndGrammar(options: TextOptions)`](#most-text-commands)                                                                                    | Fixes spelling & grammar                                                                                                                                       |
| [`aiKeypoints(options: TextOptions)`](#most-text-commands)                                                                                                | Summarizes your text to a list of key points                                                                                                                   |
| [`aiRephrase(options: TextOptions)`](#most-text-commands)                                                                                                 | Rephrases the selected text                                                                                                                                    |
| [`aiRestructure(options: TextOptions)`](#most-text-commands)                                                                                              | Restructures the selected text to use rich text formatting                                                                                                     |
| [`aiShorten(options: TextOptions)`](#most-text-commands)                                                                                                  | Shortens the selected text                                                                                                                                     |
| [`aiSimplify(options: TextOptions)`](#most-text-commands)                                                                                                 | Rephrases your text in simplified words                                                                                                                        |
| [`aiSummarize(options: TextOptions)`](#most-text-commands)                                                                                                | Summarizes your text                                                                                                                                           |
| [`aiTextPrompt(options: TextOptions)`](#most-text-commands)                                                                                               | Runs your custom prompt                                                                                                                                        |
| [`aiTldr(options: TextOptions)`](#most-text-commands)                                                                                                     | Creates a "Too Long; Didn't Read" version text                                                                                                                 |
| [`aiTranslate(language: Language, options: TextOptions)`](#aitranslate)                                                                                   | Translates the selected text into the specified language                                                                                                       |
| **Utility**                                                                                                                                               |                                                                                                                                                                |
| [`aiAccept(options: AcceptOptions)`](https://tiptap.dev/docs/content-ai/capabilities/generation/text-generation/manage-responses.md#aiaccept)             | [Accept the generated response](https://tiptap.dev/docs/content-ai/capabilities/generation/text-generation/manage-responses.md), and insert it into the editor |
| [`aiReject(options: RejectOptions)`](https://tiptap.dev/docs/content-ai/capabilities/generation/text-generation/manage-responses.md#aireject)             | [Reject the generated Response](https://tiptap.dev/docs/content-ai/capabilities/generation/text-generation/manage-responses.md), resetting ai.storage state    |
| [`aiRegenerate(options: RegenerateOptions)`](https://tiptap.dev/docs/content-ai/capabilities/generation/text-generation/manage-responses.md#airegenerate) | [Regenerate a response](https://tiptap.dev/docs/content-ai/capabilities/generation/text-generation/manage-responses.md) using the same parameters              |

### Most text commands

Most of the text commands accept the same options and their usage is similar. The following example demonstrates how to use the `aiBloggify` command:

```js
editor.chain().focus().aiBloggify(options: TextOptions)
```

### aiAdjustTone

```js
// Tone: 'default' | 'academic' | 'business' | 'casual' | 'childfriendly' | 'confident' | 'conversational' | 'creative' | 'emotional' | 'excited' | 'formal' | 'friendly' | 'funny' | 'humorous' | 'informative' | 'inspirational' | 'memeify' | 'narrative' | 'objective' | 'persuasive' | 'poetic' | string
editor.chain().focus().aiAdjustTone(tone: Tone, options: TextOptions).run()
```

### aiTranslate

Translates the selected text content into the given output language.

It accepts two letter ISO 639-1 language codes.

```js
// Language: 'en' | 'de' | 'nl' | ...
editor.chain().focus().aiTranslate(language: Language, options: TextOptions).run()
```

## Text command options

On every command which supports `TextOptions`, you’re able to specify the following options:

| Setting          | Type                                                                   | Default                                       | Definition                                                                                                                                                                                                                 |
| ---------------- | ---------------------------------------------------------------------- | --------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `modelName`      | see [Supported text models](#supported-text-models)                    | `gpt-5-mini` (`gpt-4.1` if `streaming: true`) | The model used at OpenAI                                                                                                                                                                                                   |
| `format`         | `'rich-text' \| 'plain-text'`                                          | `plain-text`                                  | Determines the [format](https://tiptap.dev/docs/content-ai/capabilities/generation/text-generation/format.md) of how the model should respond                                                                              |
| `stream`         | `boolean`                                                              | `false`                                       | Should the command stream characters to the editor? It’s like the **typewriter** behavior in ChatGPT. **This requires the newest extension version!**                                                                      |
| `insertAt`       | `undefined \| number \| {from: number; to: number}`                    | `undefined`                                   | Where to insert the response into the editor, if `undefined` the response will be inserted at the current selection. If a number, the response will be inserted at that position. If an object it will replace that range. |
| `language`       | `string` (e.g. `en`, `de`)                                             | `null`                                        | Although we do our best to prompt OpenAI for a response in the language of the input, sometimes it’s better to define it yourself.                                                                                         |
| `tone`           | `string`                                                               | `null`                                        | A [voice of tone](#ai-adjust-tone) the response should be transformed to                                                                                                                                                   |
| `textLength`     | `number`                                                               | `undefined`                                   | The number of `textLengthUnit`s the AI should respond with (e.g. the `3` in "3 paragraphs")                                                                                                                                |
| `textLengthUnit` | `'paragraphs' \| 'words' \| 'characters'`                              | `undefined`                                   | The unit of `textLength`s the AI should respond with (e.g. the `paragraphs` in "3 paragraphs")                                                                                                                             |
| `collapseToEnd`  | `boolean`                                                              | `true`                                        | Whether the cursor should be set to the end after the operation or the insertion should get selected.                                                                                                                      |
| `context`        | `Array<{ type: 'text', text: string} \| { type: 'url', url: string }>` | `[]`                                          | [Context](https://tiptap.dev/docs/content-ai/capabilities/generation/text-generation/provide-context.md) to provide the model for generating a Response.                                                                   |
| `text`           | `string`                                                               | `undefined`                                   | An optional message to have the model respond to                                                                                                                                                                           |
| `insert`         | `boolean`                                                              | `true`                                        | Allows disabling inserting content directly into the editor                                                                                                                                                                |
| `append`         | `boolean`                                                              | `true`                                        | If `true`, the response will be appended to the end of the current selection. If `false`, the response will replace the current selection.                                                                                 |
| `regenerate`     | `boolean`                                                              | `false`                                       | Whether the command regenerates the response that was previously generated. If set to true, the `initialContent` property will not be updated.                                                                             |

*Unfortunately the combination of **tone** and **language** sometimes leads to responses which are not in the desired language.*

### Supported text models

We currently support the following OpenAI chat models:

- `gpt-5`
- `gpt-5-2025-08-07`
- `gpt-5-mini`
- `gpt-5-mini-2025-08-07`
- `gpt-5-nano`
- `gpt-5-nano-2025-08-07`
- `gpt-5-chat`
- `gpt-5-chat-2025-08-07`
- `gpt-5.4-mini`
- `gpt-5.4-nano`
- `gpt-4.1`
- `gpt-4.1-2025-04-14`
- `gpt-4.1-mini`
- `gpt-4.1-mini-2025-04-14`
- `gpt-4.1-nano`
- `gpt-4.1-nano-2025-04-14`
- `chatgpt-4o-latest`
- `gpt-4o-mini`
- `gpt-4o-mini-2024-07-18`
- `gpt-4o`
- `gpt-4o-2024-11-20`
- `gpt-4o-2024-08-06`
- `gpt-4o-2024-05-13`
- `gpt-4-turbo`
- `gpt-4-turbo-2024-04-09`
- `gpt-4-turbo-preview`
- `gpt-4`
- `gpt-4-0125-preview`
- `gpt-4-1106-preview`
- `gpt-4-0613`
- `gpt-4-0314`
- `gpt-4-32k`
- `gpt-4-32k-0613`
- `gpt-3.5-turbo-0125`
- `gpt-3.5-turbo`
- `gpt-3.5-turbo-1106`
- `gpt-3.5-turbo-16k`

## Choose the right Model

When configuring the Tiptap AI extension, consider the specific needs of your application:

- **For Cost-Effective Operations:** Opt for GPT-3 or DALL-E 2 if the primary concern is budget and the tasks do not demand the most advanced capabilities.
- **For Advanced Requirements:** Choose GPT-4o or DALL-E 3 when your application requires the highest level of language understanding or image generation quality, and budget is less of a constraint.

The Tiptap AI extension's flexible configuration allows you to tailor the AI integration to match your specific requirements and budgetary considerations.

*Note: The pricing details are not provided here due to variability and the need for up-to-date information. It's recommended to refer to the official OpenAI pricing page for the latest figures.*
