Summarize this article
Table of contents
Get insights delivered straight into your inbox every week!

AgentMail API: Setup, Pricing, and How It Works?

If you’re considering the AgentMail API, you’re probably trying to solve one clear problem: letting AI agents handle email without relying on human inbox tools.

That usually means moving beyond simple “send email” functionality. Agents need to create inboxes, read replies, stay inside threads, and manage conversation history, all through code, without manual steps.

But before integrating it, it’s important to understand what it actually provides, how setup works, what pricing looks like, and where its model makes sense.

In this guide, I’ll break down how the AgentMail API works, what you’re really setting up, and what to consider before using it in your agent system.

Key Takeaways

  • AgentMail is best when AI agents need to own inboxes, send and reply to emails, and manage conversations fully through an API.

  • AgentMail fits agent-only workflows and is not designed for human-led email usage.

  • When email needs include human senders, shared inboxes, or direct deliverability control, AgentMail can feel restrictive.

  • Infraforge is a best infrastructure focused alternative that provides domains, mailboxes, IPs, DNS, and deliverability, without tying inboxes to agents.

  • Infraforge supports both human teams and AI agents, allowing them to send emails using the same setup.
Try Infraforge. Set up and control email infrastructure for humans and AI agents.

What Is AgentMail? 

AgentMail is an email infrastructure that gives AI agents their own inboxes and lets them handle email through an API.

AgentMail- email infrastructure for AI agents
This image shows the AgentMail- email infrastructure for AI agents

You create inboxes with code, one per agent. Each inbox becomes the email identity that the agent uses to send and receive messages.

When an email comes in, the agent can read it, understand it, and reply back through the API.

There is no UI involved and no human action needed at any point.

There is also no login flow to manage. No OAuth. No MFA.

Email access works the same way the rest of your agent system works, fully programmatic.

How to Set Up AgentMail API

You can set up the AgentMail API in a few simple steps.

Follow the steps below to create your first inbox and send your first email.

Step 1: Access the AgentMail Console

  1. Open the AgentMail Console in your browser.

  2. Log in to your account.

  3. If you do not have an account, sign up from the same page.

Once logged in, you can manage API keys and inboxes from the console.

Step 2: Create an API Key

  1. Go to the API Keys section in the console.
creating API key in AgentMail API keys section
This image shows the creating API key in AgentMail API keys section
  1. Click Create New API Key.

  2. Give the API key a clear name.

  3. Copy the API key after it is created.

  4. Save the key in a safe place.

  5. Create a .env file in your project and add the API key there.

This key is used to authenticate all API requests.

Step 3: Install the AgentMail SDK

  1. Open your terminal.

If you're using Python, 

Run the following command: pip install agentmail python-dotenv

  1. This installs the AgentMail SDK and the tool to load environment variables.

Step 4: Create Your First Inbox

  1. Create a new file, for example quickstart.py.

  2. Load the API key from the .env file.
Loading API key in Agentmail 
This image shows the Loading API key in Agentmail 
  1. Initialize the AgentMail client.
Initializing client in Agentmail
This image shows the Initializing client in Agentmail
  1. Call the API to create an inbox.

Creating inbox in Agentmail
This image shows the Creating inbox in Agentmail

The inbox becomes the email identity for your agent.

If no domain is provided, AgentMail uses the default @agentmail.to domain.

Step 5: Send Your First Email

  1. Use the API to send an email.
sending email through Agentmail
This image shows the sending email through Agentmail
  1. Provide:


    • the inbox ID

    • the recipient email address

    • the subject

    • the message text

The email is sent from the agent’s inbox.

Step 6: Run the Code

  1. Run the script from your terminal.

  2. Check the output in the console.

If successful, the inbox details will appear and the email will be sent.

Your AgentMail API setup is now complete.

Your agent can send emails using the inbox you just created.

AgentMail Pricing 

AgentMail offers pricing based on how many inboxes you run and how much email your agents send.

AgentMail pricing
This image shows the AgentMail pricing

Free Plan – $0/month

This plan is for trying AgentMail without any commitment.

You get 3 inboxes, 3,000 emails per month, and 3 GB storage.

Developer Plan – $20/month

This plan fits individual developers building real agent workflows.

It includes 10 inboxes, 10,000 emails per month, 10 GB storage, and 10 custom domains, with email support.

Startup Plan – $200/month

This plan is meant for teams running agents at scale.

You get 150 inboxes, 150,000 emails per month, 150 GB storage, 150 custom domains, plus dedicated IPs and Slack support.

Enterprise Plan – Custom pricing

This plan is for large or complex setups.

It includes custom volume limits, white-labeling, BYO cloud deployment, and OIDC/SAML SSO, along with everything in the Startup plan.

What AgentMail Automates 

Once AgentMail is set up, you do not need to build or manage the email system yourself.

These core parts are already handled.

Core Email Building Blocks

Inboxes

AgentMail creates inboxes for your agents.

Each inbox works like a real email address that can send and receive emails.

You do not set up mail servers or manage inbox configuration.

Messages

AgentMail handles sending and receiving emails.

When your agent sends an email through the API, AgentMail delivers it.

Replies come back to the same inbox automatically.

Threads

AgentMail keeps emails grouped into threads.

Replies stay connected to the original conversation, so agents always see the full context.

Drafts

Agents can create drafts before sending emails.

This allows messages to be prepared first and sent later when needed.

Labels

AgentMail supports labels for messages and threads.

Agents can use labels like unreplied and replied to manage work without building custom tracking logic.

Attachments

AgentMail extracts attachments from emails and exposes them through the API.

Agents do not need to parse raw email files.

Pods

Email operations run inside AgentMail’s infrastructure pods.

This helps keep delivery reliable without you managing servers or queues.

Authentication, Deliverability, and Storage

Email Authentication

AgentMail handles SPF, DKIM, and DMARC.

These are required for email authentication and help emails reach inboxes properly.

Email Deliverability

Emails are delivered through a fault-tolerant, global infrastructure.

You do not need to manage retries or delivery failures.

Inbox Identity

Each agent's inbox has its own identity.

There is no human login, OAuth, or MFA involved.

Email Storage

Emails and conversation history are stored long term.

Agents can access past messages whenever needed.

AgentMail takes care of how email works and stays reliable.

You focus on what your agents should do with emails.

Best Email APIs for Cold Outreach

Using AgentMail Inside Real Agentic Systems

In real agentic systems, email usually works as a trigger.

Something comes in, the agent reacts, and something goes out. AgentMail fits right into this flow.

A good example is an auto-reply agent.

Someone sends an email. That email lands in an AgentMail inbox.

AgentMail then lets your system know that a new message has arrived.

The agent reads the email details, like who sent it and what the message says.

Based on that, the agent decides what to do next.

If the agent needs to reply, it sends the response using AgentMail.

The reply stays in the same email thread, so the conversation stays connected.

In this setup:

  • AgentMail handles receiving the email and sending the reply

  • The agent handles understanding the message and choosing the response

Because AgentMail is API-first, this entire loop runs through code.

There is no inbox screen and no manual step in between.

AgentMail provides SDKs for Python and Node.js, which makes it easy to build this flow without dealing with raw email formats.

This also works well with agent frameworks like LangChain, LlamaIndex, and CrewAI.

The framework helps the agent think and decide, and AgentMail is used only when email needs to be handled.

Email API Integration for Sales Teams

When AgentMail Is the Right Fit, and When It’s Not

AgentMail is a good choice when email is something your agents actively work with, not something humans manage.

AgentMail is the right fit if:

  • Your agents need their own inboxes

  • Email replies should happen automatically based on agent logic

  • Conversations must stay inside threads so agents keep context

  • Email should behave like an event the agent reacts to

  • You want email handled through an API-first flow, with no UI steps

In these cases, AgentMail fits naturally because it treats email as part of the agent system, not as a separate tool.

AgentMail may not be the right fit if:

  • You need direct control over mail servers or custom delivery pipelines

  • You want to control the email infrastructure, like IP, inbox management, and rotations

  • Email is mostly used by humans, not agents

  • Your system does not need inbox-level automation or agent-owned identities

In these cases, an agent-focused email layer can feel unnecessary, and teams usually look for infrastructure-level solutions instead.

Infraforge: Email Infrastructure That Works for Humans and AI Agents

Infraforge is a private email infrastructure platform that lets you create, manage, and scale domains, mailboxes, IPs, and deliverability in one place.

Infraforge handles  DNS setup, SPF, DKIM, DMARC, mailbox creation, warmup, and monitoring.

You do not manage mail servers or technical email setup yourself.

Once this infrastructure is ready, emails can be sent in two ways:

  • By humans, such as sales or outreach teams

  • By AI agents, using Infraforge’s API

This makes Infraforge flexible. The same domains and mailboxes can be used by people today and by AI agents tomorrow.

The infrastructure stays the same, while the sender email logic changes.

AI agents can trigger emails, run sequences, or automate outreach by calling Infraforge through its API or through compatible sending tools.

Humans can use the same setup for manual outreach. Both operate on top of the same email system.

Infraforge vs AgentMail - Which One Fits Your Setup?

When people compare Infraforge and AgentMail, they’re usually trying to answer a few simple questions.

This table breaks it down in a practical way.

AgentMail vs Infraforge
Question you’re probably asking AgentMail Infraforge
What am I really buying here? A way for AI agents to own inboxes and handle email by themselves A strong email foundation that humans and AI agents can both use
Who actually sends emails day to day? AI agents Humans, AI agents, or a mix of both
Who “owns” the inbox? The agent owns it The team or system owns it
How does an AI agent send an email? The agent talks directly to the AgentMail API The agent sends email through Infraforge’s API or connected tools
Can my sales team use the same setup? Not really what it’s built for Yes, that’s a common use case
What do I control the most? How the agent sends and replies Domains, IPs, DNS, warmup, and reputation
How much do I see deliverability details? Mostly hidden Very visible and adjustable
Is this meant for cold outreach at scale? No, not specifically Yes, that’s the main focus
Does this work well if humans and AI both send emails? Limited Yes, it’s designed for that
What stays stable as volume grows? Agent logic needs more work The infrastructure is built to scale
Best choice if… Agents completely own email Email performance really matters

Infraforge keeps your email infrastructure strong and consistent, no matter whether emails are sent by people or AI agents.

Conclusion

AgentMail works well when email is handled entirely by AI agents and managed through an API.

It fits systems where agents own inboxes and operate on their own.

However, once human teams also need to send emails, or when domains, IPs, and deliverability require closer control, email starts functioning less like an agent feature and more like shared infrastructure.

In those cases, an infrastructure-focused setup becomes more relevant. Infraforge follows that approach by managing domains, mailboxes, DNS, IPs, and deliverability in one place, while supporting both human teams and AI agents on the same system.

Try Infraforge! Get Cold email optimized infrastructure that works for both human teams and AI agents.