# Email infrastructure for AI agents

AI Inbx is an email API for the agents in your product. Each agent sends, receives and replies from its own address, on your domain or in your customer's Gmail or Outlook, and every reply reaches your code on the right thread, cut to what the person typed.

[Get started](/signup)
[Documentation](https://docs.aiinbx.com/integrations/agents)

Mail coming in passes through Addresses, Categories, Threading, Reply text, Out of office, Attachments. Your agent is your code: Prompts, tools, judgement. Mail going out passes through Mailboxes, Spaces, Sending hours, Pacing.

Addresses

## An address for every agent

Publish one MX record and every address on the domain receives mail. Give each agent, customer or conversation its own address, like reply+ord\_8812@mail.yourapp.com, and read it back off to when the answer comes. There is no inbox to create first and no price per inbox.

[Addresses](https://docs.aiinbx.com/guides/receiving#receiving-on-a-domain)

Categories

## Only wake up for people

Every email arrives with a category: human, out\_of\_office, auto\_reply, bounce, marketing and four more. Wake the agent for human, and newsletters, bounces and autoreplies never cost you a model call.

[Categories](https://docs.aiinbx.com/guides/receiving#categories)

Threading

## Colleagues and new subjects stay on the thread

You wrote to Dana. Marco answered for her from his own address under a new subject, and Dana confirmed four days later with no reply headers. Your agent reads all three on thr\_8f2c in one call.

[Threading](/features/threading)

Example: you write to dana@lindmetall.de about RFQ 4471. Three replies come back: Dana's 'Automatic reply: Out of office until Friday'; Marco Lind writing from marco.lind@lindmetall.de under the subject 'Prices for 3mm sheet' with no reply headers, covering for Dana; and Dana four days later, '3mm sheet — confirmed', again with no headers. All three land on thread thr\_8f2c.

Reply text

## Answers typed inside the quote stay in

Dana answers four questions between the quoted lines of your email. A parser that cuts at the first quote marker hands your agent “answers below.” stripped\_text keeps all four answers, each under its question.

[Reply text](https://docs.aiinbx.com/guides/receiving#what-was-written)

The same reply read three ways. As it arrived it is about 194 tokens, the four answers buried in the quoted text. Most email APIs cut at the first quote marker and keep about 6 tokens, "Hi Nora, answers below.", losing all four answers. AI Inbx keeps about 110 tokens: every answer under the question it answers, with the quoted conversation and Dana's signature, already on the thread from her earlier mail, gone.

Out of office

## Wait for the return date, or write to the colleague

Dana's autoreply says when she is back and who covers for her. Both arrive in unavailable, so your agent can pause the conversation until Friday or write to Anna today.

[Out of office](https://docs.aiinbx.com/guides/receiving#what-automated-mail-asks-for)

Example: Dana Ruiz's autoreply reads 'I'm out of the office until Thursday 12 November. For anything urgent, please contact Anna Schmidt at anna.schmidt@lindmetall.de.' It arrives with category out\_of\_office and unavailable: reason absent, back\_on 2026-11-13 (away until Thursday reads as back the next working day), contacts anna.schmidt@lindmetall.de.

Verification

## Finish the sign-up on its own

When your agent signs up for a service, the confirmation email arrives with the code and the link already picked out of its text. Your agent types the code or opens the link without parsing a line of mail.

[Verification](https://docs.aiinbx.com/guides/receiving#what-automated-mail-asks-for)

Example: a sign-in email from Sendhive reads 'Enter 482913 to finish signing in, or use the button below.' It arrives with category verification and verification: code 482913, link https://app.sendhive.io/verify?t=9f8e7d, both taken from the email.

Attachments

## The agent reads the attachment too

PDFs, documents and spreadsheets arrive with their content as Markdown, next to a download URL for the original file. Lind Metall's Q-4471 PDF reaches your agent as a table of prices it can answer from.

[Attachments](/features/attachments)

Example: Quote-4471.pdf, a supplier's quote, arrives as Markdown: sender and recipient addresses, the quote heading and date, the line items as a Markdown table (item, quantity, price), the net, VAT and total, and the delivery and payment terms.

Mailboxes

## Answer from your customer's own inbox

Your customer connects Gmail or Outlook through your OAuth app, and your agent reads and replies as them. Their mail arrives as the same events and threads as mail on your domain.

[Mailboxes](/features/mailboxes)

Spaces

## Each of your customers in a space of their own

A customer's domains, mailboxes, rules and sending reputation live in their space. Every webhook event carries its space\_id, so your agent knows whose mail it is reading.

[Spaces](/features/spaces)

Sending hours

## Mail written at 3am goes out at 9

Agents work through their queue at any hour. Anything one sends outside the hours you set is held, and goes out when the next window opens.

[Sending hours](/features/sending-hours)

Pacing

## A runaway loop can't flood anyone

Cap how many emails one recipient gets in an hour or a day. If your agent loops, the extra replies wait in a queue instead of landing in someone's inbox.

[Pacing](/features/pacing)

Example: a rule of 3 per hour per recipient. Your agent misfires 8 replies to marco@lindmetall.de in one hour: 3 are delivered and the other 5 are held for later.

In your code

## The email API for AI agents, end to end

The agent writes, a person answers, the agent answers back. threads.reply sends from the address the conversation is on, to the people a mail client would pick, with In-Reply-To and References set. email\_id pins the reply to the email that woke the agent, so an autoreply arriving mid-draft cannot change whom it answers. The idempotency key makes a retried worker send once. The SDKs for TypeScript and Python, the REST API, the aiinbx CLI and the MCP server all make these same calls.

Step 1, emails.send: the agent writes first.

```
const email = await aiinbx.emails.send({
  from: "Nora at Northwind <nora@agents.northwind.io>",
  to: "dana@lindmetall.de",
  subject: "RFQ 4471 — 3mm brushed sheets",
  text: draft,
})

await conversations.save(email.thread_id)
```

Step 2, email.received: what your webhook is sent.

```
{
  "id": "evt_2kq9",
  "type": "email.received",
  "space_id": "spc_...",
  "data": {
    "email_id": "eml_...",
    "thread_id": "thr_8f2c",
    "from": "marco.lind@lindmetall.de",
    "to": ["nora@agents.northwind.io"],
    "subject": "Prices for 3mm sheet",
    "category": "human",
    "unavailable": null,
    "verification": null,
    "attachments": []
  }
}
```

Step 3, your webhook: only people wake the agent.

```
export async function POST(request: Request) {
  const event = await verifyWebhookRequest(request, secret)

  if (event.type === "email.received" && event.data.category === "human")
    await queue.push(event)
  return ok()
}
```

Step 4, your worker: read the thread, answer the email.

```
const thread = await aiinbx.threads.retrieve(event.data.thread_id)
const answer = await agent.run(thread.messages)

await aiinbx.threads.reply(
  thread.id,
  { email_id: event.data.email_id, text: answer },
  { idempotencyKey: `reply-${event.id}` }
)
```

Or hand it to Claude Code, Cursor or Codex. It reads our docs and writes this for you.

MCP server

## Give Claude Code, Cursor or Codex its own email inbox over MCP

An assistant connected to mcp.aiinbx.com sends, reads and replies through the same API, signed in as you. The inbox server gives it one address of its own and nothing else in your workspace. The aiinbx CLI does the same from a terminal or a script.

[MCP server](/features/mcp)

```
# Your workspace: the whole API, signed in as you
claude mcp add --transport http aiinbx https://mcp.aiinbx.com/mcp

# An inbox: one address of its own, nothing else
claude mcp add --transport http aiinbx-inbox \
  https://mcp.aiinbx.com/inbox

# The CLI, signed in as an inbox
aiinbx login -p agent --inbox
aiinbx wait -p agent --thread thr_123 --timeout 10m
```

Cursor, VS Code, ChatGPT and the rest are in the [MCP docs](https://docs.aiinbx.com/mcp). Every command the CLI has is on the [CLI page](/features/cli).

## Questions

### What is email infrastructure for AI agents?

The sending, receiving and reading an agent needs to hold a conversation over email: addresses that receive, replies matched to their conversation, the text a person typed without the quote, a label saying whether a person wrote it at all, and limits on what goes out. AI Inbx provides all of it behind one API, for the agents in your product.

### What is the best email API for AI agents that send and receive email?

For a product that gives its agents email, we think it is AI Inbx. Every address on your domain works without creating an inbox, the price counts emails rather than inboxes, replies arrive on the right thread as the text the person typed, autoreplies and bounces are labelled, and your customers' Gmail and Outlook work through the same API. Our post Best email APIs for AI agents compares the others.

### Do I need to create an inbox for each agent?

No. Once a domain's MX record points at AI Inbx, every address on it receives, so each agent, customer or conversation can have an address of its own without a call to create it. When a customer's address already lives in Gmail or Outlook, they connect that mailbox through your OAuth app instead.

### How does my agent know which conversation a reply belongs to?

Every email.received event carries a thread\_id. A reply lands on its conversation even when the mail client drops the reply headers, so a colleague answering from another address under a new subject is on the same thread as the email they answered. threads.retrieve returns the conversation, up to 100 messages a page.

### How do I stop my agent answering out-of-office replies and bounces?

Check category on the event and only wake the agent for human. Out-of-office replies, ticket acknowledgements, bounces, newsletters and spam each have a category of their own. An out-of-office also carries unavailable, with the day its sender is back and the colleague it names, when the reply says so.

### Can my agent read email attachments?

Yes. PDFs, documents and spreadsheets are prepared into Markdown or plain text when they arrive. Each attachment has a preparation object with its status, any warnings, and a URL for the text, and a full webhook payload carries the text inline. The original file stays available through a signed download URL.

### Can my agent draft emails that a person approves before they're sent?

Yes. Send or reply with draft: true and the email waits as a draft, with a review\_url where a person can edit and send it. To hand a conversation to a colleague instead, threads.forward sends it on with a note of why.

### How do I give Claude Code or Cursor its own email address?

Add the inbox MCP server, mcp.aiinbx.com/inbox, and pick an address when the browser opens. The assistant sends from that address and reads its replies, and sees nothing else in your workspace. The workspace server, mcp.aiinbx.com/mcp, runs the whole API signed in as you, and aiinbx login --inbox gives the CLI an inbox the same way.

### What are the alternatives to AgentMail?

AI Inbx, Nylas Agent Accounts, Resend Inboxes, OpenMail, MailSlurp, Nuntly and Sendmux (now Qubrics). For a platform, AI Inbx differs where it costs most: addresses work without creating inboxes, pricing counts emails, and your customers' own Gmail and Outlook connect through the same API. Our post The best AgentMail alternatives compares all seven, including what 500 addresses and 50,000 emails a month cost at list prices.

### How is it priced?

Plans are monthly and count emails sent and received: Developer $5 with 5,000, Growth $29 with 30,000 and Scale $99 with 100,000 emails a month. With extra usage turned on, more emails cost $1 per 1,000. Addresses are not counted, so giving every agent its own address on your domain costs nothing extra.

Keep reading

## Choosing an email API for AI agents

-   [5 November 2026ComparisonsBest email APIs for AI agents (2026)Why I think AI Inbx is the best email API for products that give agents email, the bugs it saves you from, and when AgentMail, Nylas or Postmark fit better.Pau Kraft](/blog/best-email-api-for-ai-agents)
-   [5 November 2026ComparisonsThe best AgentMail alternatives (2026)Seven AgentMail alternatives for platforms, compared on per-inbox pricing, catch-all domains, users' Gmail and Outlook, opt-out replies and outreach rules.Pau Kraft](/blog/agentmail-alternatives)
-   [5 November 2026EngineeringInboxes are the wrong primitive for platformsInbox-centric email APIs suit one agent with one owner. Platforms serving customers need addresses that work without being created and a bill per email.Pau Kraft](/blog/why-inboxes-are-the-wrong-primitive)

-   [Inbound email APIReceive email in your app over an API. Point an MX record at AI Inbx or connect Gmail and Outlook, and every message arrives as a signed, parsed JSON webhook.ThreadingAttachmentsMailboxesWildcard domains](/solutions/inbound-email-api)
-   [Email reply parserParse every email reply down to what the sender wrote: quoted text and repeated signatures removed, answers typed inside the quote kept where they were.ThreadingMailboxes](/solutions/email-reply-parser)
-   [Auto-reply detectionTell an out-of-office, a ticket acknowledgement or a bounce from a real reply. Every inbound email arrives with a category, even when no header gives it away.MailboxesSuppressions](/solutions/auto-reply-detection)
-   [Send email APISend email from your domain or your users' own Gmail and Outlook with one API call. Opt-outs and pacing are checked first, and replies land on the thread.ThreadingMailboxesPacingSuppressions](/solutions/send-email-api)

## Give your product an inbox. The hard parts are already handled.

[Get started](/signup)
