Skip to navigation

Vercel

Install AgentMail from the Vercel Marketplace and call it from your Vercel functions

Overview

AgentMail is a native integration on the Vercel Marketplace. Installing it from Vercel provisions an AgentMail organization for your team without a separate signup, puts the usage on your Vercel invoice, and lets you open the AgentMail console from the Vercel dashboard.

Installing the integration injects AGENTMAIL_API_KEY into the connected projects. It is a normal AgentMail API key, so your Vercel functions authenticate with it like any other AgentMail client.

Install

  1. In the Vercel dashboard open Integrations, then Marketplace, find AgentMail and click Install. From a terminal, vercel integration add agentmail does the same.
  2. Pick a plan and name the resource. One resource is one AgentMail organization; connect it to every project that should share its inboxes.
  3. Run vercel env pull .env.local in each connected project to get the injected variables locally.

Plan changes and billing live in the Vercel dashboard under the resource. Open in AgentMail on the resource page signs you into the AgentMail console for that organization.

Use the provisioned API key

AGENTMAIL_API_KEY is injected into every connected project when you install the integration, and vercel env pull .env.local brings it to your machine. Use it like any other AgentMail key:

import { AgentMailClient } from "agentmail";
const client = new AgentMailClient({ apiKey: process.env.AGENTMAIL_API_KEY });
const inbox = await client.inboxes.create({ clientId: "support-agent" });

Because it is a long-lived secret, treat it as one: mark the resource Production only in its Vercel settings if preview and development deployments do not need it.

Everything else about AgentMail is the same on Vercel: see the inboxes and webhooks references, and the Vercel AI SDK example for sending email from an agent tool.