> ## Documentation Index
> Fetch the complete documentation index at: https://docs.brew.new/llms.txt
> Use this file to discover all available pages before exploring further.

# API Catalog

> Run Brew's API capabilities from the dashboard at brew.new/api. Browse the 11 APIs, fill in parameters, run a live call against your brand, then copy the exact request as cURL, TypeScript, the TypeScript SDK, or Python, or hand the implementation prompt to your AI agent.

## Overview

The **API** tab in the Brew dashboard is a live catalog of the capabilities
you can call from your own product. Open it at
[brew.new/api](https://brew.new/api).

Each entry runs against your real brand with a real API key, so what you
see in the catalog is exactly what your code will get back. Once a call
does what you want, copy it out in the shape you need: a raw request, a
snippet in your language, or a prompt you paste into an AI agent.

Use it to:

* Try a capability before writing any code, with your brand's own designs
  and contacts.
* Get a working request with your parameters already filled in.
* Hand an agent (Claude, Cursor, whatever you use) a briefed prompt with
  the endpoint, auth pattern, request fields, and docs link.

## What's in the Catalog

The catalog covers the eleven capabilities that make sense to run
interactively: generation, media, and pre-send checks. It is not the whole
API. Sending, automations, triggers, analytics, and contact and audience
management are all on the v1 surface but not in the catalog, since a
one-click run of a live send is not something you want in a browser tab.
For those, see the
[API Introduction](/api-reference/api/api-introduction).

Eleven APIs across three groups. The cost shown on each row is the same
metering the API applies: **usage-based** ops charge actual model usage,
**fixed** ops charge a flat published cost, and free ops charge nothing.
See [Credits](/api-reference/api/credits) for how metering works.

### Create

Generate and edit on-brand email designs.

| API            | What it does                                                       | Endpoint                     | Cost        |
| -------------- | ------------------------------------------------------------------ | ---------------------------- | ----------- |
| Generate Email | Create a new on-brand email design from a plain-language prompt.   | `POST /v1/emails`            | Usage-based |
| Edit Email     | Revise an existing email design with a plain-language instruction. | `PATCH /v1/emails/{emailId}` | Usage-based |
| Figma to Email | Turn a Figma frame into a pixel-faithful, sendable email design.   | `POST /v1/emails/figma`      | Free        |

### Media

Production-ready email imagery: render, animate, compress, resize.

| API            | What it does                                                 | Endpoint                                               | Cost       |
| -------------- | ------------------------------------------------------------ | ------------------------------------------------------ | ---------- |
| HTML to PNG    | Render any HTML string to a hosted PNG image.                | `POST /v1/content/html-to-png`                         | 1 credit   |
| Image to GIF   | Animate a still image into a looping GIF.                    | `POST /v1/content/gif`                                 | 10 credits |
| Optimize Image | Compress a hosted image for email without changing its size. | `POST /v1/content/transform` (`operation: "optimize"`) | 1 credit   |
| Resize Image   | Resize a hosted image to exact pixel dimensions.             | `POST /v1/content/transform` (`operation: "resize"`)   | 2 credits  |

### Quality

Pre-send checks: validation, accessibility, rendering, placement.

| API                 | What it does                                                          | Endpoint                                          | Cost                  |
| ------------------- | --------------------------------------------------------------------- | ------------------------------------------------- | --------------------- |
| Validate Contacts   | Check which email addresses are safe to send to.                      | `POST /v1/contacts/validate`                      | 2 credits per address |
| Accessibility Audit | Audit an email design against WCAG before it ships.                   | `POST /v1/emails/{emailId}/accessibility-audit`   | 5 credits             |
| Email Inbox Preview | Screenshot your email in real clients: Gmail, Outlook, Apple Mail.    | `POST /v1/emails/{emailId}/client-previews`       | 10 credits            |
| Inbox Placement     | Find out where your email actually lands: inbox, promotions, or spam. | `POST /v1/emails/{emailId}/inbox-placement-tests` | 10 credits            |

<Note>
  The costs above are what the catalog displays today. The authoritative
  number for any given call is the `X-Credit-Cost` response header, and
  the full machine-readable table is at `GET /v1/help` →
  `credits.operations`.
</Note>

## Running an API

Click any row to open its detail view. The layout is the same for every
API:

<Steps>
  <Step title="Fill in the required input">
    The main input sits at the top, marked with a red asterisk. On
    **Generate Email** that's the prompt: *"A product-launch email for our
    new espresso grinder, lead with the hero shot, two feature blocks, one
    CTA to pre-order."*
  </Step>

  <Step title="Adjust the optional parameters">
    The **Parameters** rail on the right holds everything optional. Each
    field maps one-to-one to a field in the request body, and editing one
    rewrites the request snippet below in real time.
  </Step>

  <Step title="Run it">
    Hit the run button. The result appears under the input, and the
    **Latest** / **History** tabs let you flip between this run and
    previous ones.
  </Step>

  <Step title="Copy the call out">
    Take the **API request** snippet in your language of choice, or the
    **Implementation prompt** if you want an agent to write the
    integration.
  </Step>
</Steps>

A run from the catalog is a real API call. It charges credits and, for
write operations, saves to your brand exactly as a call from your backend
would.

### Parameters

The Parameters rail is per-API. On **Generate Email** it holds three:

| Parameter        | Request field      | What it does                                                                                                                                                                                                                                        |
| ---------------- | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Category         | `category`         | Tailors the design treatment. Pick the closest match: welcome, newsletter, promotional, product-launch, product-update, cart-abandonment, event-invitation, event-reminder, feedback-request, re-engagement, referral, business, internal, general. |
| Content URLs     | `contentUrls`      | Up to 8 page URLs to ground the copy in real content: product pages, blog posts, docs.                                                                                                                                                              |
| Reference design | `referenceEmailId` | Reuse the look and feel of an existing design.                                                                                                                                                                                                      |

**Reference design** opens a picker of every email in your account, with
search and a full preview of the highlighted design, plus a **Start from
scratch** option that seeds a blank design from the default template.
It's the same reference-email mechanic as
[the editor](/create-emails/emails), so you can point at a design you
already like instead of describing it.

### The API Request Snippet

The snippet updates as you change parameters, and the language dropdown
switches it between four shapes:

| Option           | What you get                                                                                   |
| ---------------- | ---------------------------------------------------------------------------------------------- |
| cURL             | A raw HTTP request you can paste into a terminal.                                              |
| TypeScript (SDK) | A call through [`@brew.new/sdk`](/sdks/overview), typed, with retries and idempotency handled. |
| TypeScript       | `fetch` against the endpoint directly, no dependency.                                          |
| Python           | A plain HTTP request.                                                                          |

Below the snippet is the key picker. It selects which of your brand's API
keys the in-app run authenticates with, and **Manage keys** jumps to
[brew.new/settings/api](https://brew.new/settings/api). The key you pick
applies to the run only: copied snippets always carry the
`brew_your_api_key` placeholder, so nothing you paste into a doc, a
ticket, or a chat window leaks a live credential.

<Warning>
  Keep API keys on your server. Substitute the placeholder from an
  environment variable, never a hardcoded string in browser code. See
  [Authentication](/api-reference/api/authentication).
</Warning>

## The Implementation Prompt

Under the request snippet, every API carries a copyable **Implementation
prompt**: a briefing written for a coding agent. It contains the goal,
the endpoint, the docs link, the cost, the auth pattern (read the key
from `BREW_API_KEY`, keys are brand-scoped), the TypeScript SDK
equivalent, the [MCP](/api-reference/mcp/overview) tool that does the
same job, every request field with its type and constraints, an example
request body, and a closing instruction to ask you about SDK versus raw
HTTP before writing code.

Copy it into Claude Code, Cursor, or any agent with repo access and you
get a working integration without the agent guessing at the surface. The
header buttons cover the same ground in fewer clicks:

* **Docs** opens the endpoint reference for that API.
* **Try in Chat** hands the capability to the Brew chat agent.
* **Open in Claude** sends the implementation prompt straight to Claude,
  with a dropdown for the other agents you can target.

For the fuller agent story, including connecting Brew over MCP so an
agent can call these capabilities directly instead of writing HTTP, see
[Use Brew With AI Agents](/integrations/ai-agents/use-brew-with-ai-agents).

## What to Read Next

<CardGroup cols="2">
  <Card title="API Introduction" icon="book-open" href="/api-reference/api/api-introduction">
    How the whole surface fits together: auth, brand scoping, sends,
    analytics, automations.
  </Card>

  <Card title="MCP Server" icon="plug" href="/api-reference/mcp/overview">
    Let an agent call Brew directly, no integration code required.
  </Card>
</CardGroup>

## Need help?

Our team is ready to support you at every step of your journey with Brew. Choose the option that works best for you:

<Tabs>
  <Tab title="Self-Service Tools">
    <CardGroup cols="2">
      <Card title="Search Documentation" icon="magnifying-glass" color="#c44925">
        Type in the "Ask any question" search bar at the top left to instantly find relevant documentation pages.
      </Card>

      <Card title="ChatGPT/Claude Integration" icon="robot" color="#c44925">
        Click "Open in ChatGPT" at the top right of any page to analyze documentation with ChatGPT or Claude for deeper insights.
      </Card>
    </CardGroup>
  </Tab>

  <Tab title="Talk to Our Team">
    <CardGroup cols="2">
      <Card title="Schedule a Call" icon="calendar" color="#c44925" href="https://calendar.google.com/calendar/u/0/appointments/schedules/AcZssZ1iYoRUG1J792XQpbuQLjSRRDupr7MwraFK-HQRCtTYdBmrQi8nZu2qXfzKQigb8gbKJK3KN3-R">
        Book time with our founders for personalized guidance on strategy, best practices, or complex implementation questions.
      </Card>

      <Card title="Call Us Directly" icon="phone" color="#c44925">
        Need immediate assistance? Reach us at **+1-(332)-203-2145** for urgent issues or time-sensitive questions.
      </Card>

      <Card title="Slack Channel" icon="slack" color="#c44925">
        Our preferred support channel. You'll receive an invite after signup for direct founder support and fast responses.
      </Card>

      <Card title="Email Support" icon="envelope" color="#c44925" href="mailto:support@brew.new">
        Contact us at **[support@brew.new](mailto:support@brew.new)** for detailed inquiries or if you prefer not to use Slack.
      </Card>
    </CardGroup>
  </Tab>
</Tabs>
