The email API built for agents.
Each agent gets its own address, its own reputation and replies scored for prompt injection.
Six lines
Drop in. Get typed replies back.
No SMTP to wire up and no raw MIME to parse. Each agent gets its own address, identity and reply inbox, and replies arrive as typed, scored events.
import { mails } from "@mailsai/sdk";
const hello = mails.agent("hello");
await hello.send({
to: "user@example.com",
subject: "Your password reset code",
body: "Your code is 481920.",
});
hello.onReply((reply) => {
if (reply.quarantined) return;
// use reply.data.extracted_text
});Dashboard
Watch every email
your agents send
Each message shows its status from queued to delivered.
Events stream in as they happen, with their scores, and each conversation reads as one thread.

Sending
Every way to send,
one call each
Schedule a send for later, send a hundred in one request, or attach the invoice.
Each is one call, with the same fields as a single send.
import { createClient } from "@mailsai/sdk";
const mails = createClient();
await mails.send({
from: "hello",
to: "jordan@example.com",
subject: "How did order #10473 arrive?",
body: "Just reply to this email.",
scheduled_at: "2026-10-12T09:00:00Z",
});Idempotency keys on every send meant a dropped connection never emailed a customer twice. We stopped thinking about it.
Idempotency keys
Retry without sending twice. The same Idempotency-Key within 24 hours returns the first response, and a reused key with a new body is refused.
import { createClient } from "@mailsai/sdk";
const mails = createClient();
// Safe to retry: one email goes out.
await mails.send({
from: "hello",
to: "jordan@example.com",
subject: "Your order #10473 has shipped",
body: "Expect it in 2–3 days.",
idempotency_key: "order-10473-shipped",
});Trust
Know where you stand,
before you ship
What is running, how your keys are kept, and where your questions go.
How mail is routed is on the architecture page.
Status in the open
The status page lists each part of the service, how it is watched, and how we handle an incident.
Keys kept safely
API keys are stored only as SHA-256 hashes and shown once. Each key carries scopes, and every webhook is signed.
Support by email
Questions about your integration go to support@mails.ai or through the contact page.
Guides
Go deeper: guides
for agent builders
How the whole stack fits together is in the email for AI agents guide.
Best email API for AI agents 2026
A full provider comparison: pricing, inbound parsing, MCP support and architecture.
Architecture and provider guide
How a real agent email flow works, and what to look for in a provider.
Transactional email for agents
Codes, sign-in links and notifications: the transactional side of agent email.
Inbound email for agents
Receive, parse and classify inbound email with structured webhook events.
Send from a Python agent
A Python SDK quickstart, with Flask and FastAPI examples.
Send from a Node.js agent
A TypeScript SDK quickstart for an agent running on Node.js.
Email API for AI agents
Six-line send-and-receive examples in TypeScript and Python, with FAQ.
Frequently asked questions
What is an email API for AI agents?
How is Mails.ai different from a traditional email API like SendGrid or Resend?
Which programming languages does the email API support?
Does the email API include prompt-injection protection?
What does an email API for AI agents cost?
Can I use my own domain with the email API?
Give your first agent an inbox
Free covers 3,000 emails and 3,000 inbound replies a month, with no card. Upgrade when your agents get busy.
Get your API key

