---
title: AI email editor
description: Draft an email from a prompt or a web page, rewrite part of it, and check it before you send, in the dashboard, through the API and from an agent.
seo:
  title: AI email editor
---

The AI editor helps you write and check emails. It does three things, each one a single request to the model, and none of them sends anything.

- **Write** drafts a whole email from an instruction, a web page, or both.
- **Rewrite** changes the blocks you selected, in the dashboard.
- **Check** reads an email before it goes out and lists what to fix.

## In the dashboard

Open a [template](/docs/concepts/templates) or a [broadcast](/docs/concepts/broadcasts) in the block editor and choose **AI** in the toolbar.

- **Write.** Describe the email, or give the address of a public page such as a blog post, a changelog entry or a product page. The assistant takes the facts, the voice and the button color from the page (your team's accent color wins when it has one) and writes a subject, a preview text and the blocks. It replaces the whole email; Undo brings your version back. You can leave the subject and preview text alone.
- **Rewrite.** Select some text, pick a quick instruction (shorter, friendlier, more formal, fix spelling and grammar, translate) or write your own, and the selected blocks are replaced. Selections that contain columns, sections, HTML or repeat blocks cannot be rewritten; the dialog says so.
- **Check.** Lists the problems found, from most to least serious. Links are checked for how they are written and are never opened.

The model never writes HTML or styles. It answers with a small set of blocks (heading, paragraph, button, image, divider, list, quote), and BillionSend turns those into editor blocks. A link, image or merge field the model was not allowed to use is dropped.

## With the API

Two calls, for scripts and agents. Neither creates anything: take the `html` from a draft and pass it to `POST /templates`.

```bash
curl https://api.billionsend.com/templates/ai/draft \
  -H "Authorization: Bearer $BILLIONSEND_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "Announce our November update", "url": "https://example.com/changelog/november"}'
```

The answer has `subject`, `preview_text`, `html` (a complete 600 px email with inline styles, merge fields as `{{{NAME}}}`), `text`, the `brand` color that was used and where it came from, the `source_page` that was read, and `usage`. A template made from this HTML is an HTML template; the dashboard opens it in code mode.

```bash
curl https://api.billionsend.com/templates/ai/review \
  -H "Authorization: Bearer $BILLIONSEND_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"subject": "Our November update", "preview_text": "", "html": "<p>Hi</p>"}'
```

The answer is a list of `findings`, each with a `code`, a `level` (`error`, `warning` or `info`), `where` (`subject`, `preview_text`, `body` or `link`), the `message`, the `excerpt` it is about and a `suggestion` when there is one. `ai` says whether the model read the email too (`ok`) or only the fixed checks ran (`unavailable`, or `capped` when the day's budget is spent).

Both calls need a full-access API key that covers the whole team: a sending-only key, or one limited to a domain or an inbox, is refused. The [MCP server](/docs/mcp) has the same two as `draft_template_with_ai` (scope `templates:write`) and `review_email_with_ai` (scope `templates:read`). Rewriting is only in the dashboard: an agent already has the whole email in front of it.

## What the check looks at

The fixed checks always run: placeholder text (`lorem ipsum`, `TODO`, `[NAME]`), empty or `#` links, plain `http://` links, images with no description (`alt`), a subject in capitals or with repeated exclamation marks, and example domains such as `example.com`. The model adds typos and grammar, a subject and preview text that do not fit each other or the body, a vague subject, spam-like wording, link text that promises something other than where the link goes, an uneven tone and an unclear point. The checks the broadcast page already shows (empty subject, missing unsubscribe link, size) stay there.

## Limits

Each request that reaches the model counts as one call for the team, per UTC day:

| Plan | Calls a day |
| --- | --- |
| Free | 5 |
| Starter | 50 |
| Pro | 200 |
| Scale | 500 |

A request that fails before the model is called, because the page could not be read or the input is too large, costs nothing, and neither does one where the model could not be reached or its answer could not be used. When the day's calls are spent a draft or rewrite answers `429` with `ai_editor_daily_cap`, and a check still returns the fixed findings.

Inputs are limited: an instruction is at most 2,000 characters, and a rewrite selection, an email's text for a check and the text read from a page are at most 12,000 characters each (the API takes up to 1 MiB of HTML for a check and counts its visible text). A page is read once, over https, as static HTML up to 2 MiB; scripts are not run, and pages on private addresses are refused.

Everything the model reads, your email and the page alike, is treated as data: instructions written inside it are ignored. The model that answers is the one that powers [inbox agents](/docs/inbox-agent).
