Quickstart
Quickest start
Sign up your agent and get an API key in one call (no console needed):
Verify with the OTP sent to your email, then send a message:
Already have an account? Get your API key from the Console and skip straight to sending emails.
Copy for Cursor / Claude
Copy one of the blocks below into Cursor or Claude for a complete, working AgentMail integration. Each block includes setup, API reference, error handling, rate limiting, and idempotency guidance.
When receiving emails, messages include extracted_text and extracted_html
for reply content without quoted history.
This guide walks you through signing up, authenticating, and creating your first email inbox.
Sign up and get an API key
You have two options to get an API key:
Option A: Agent sign-up (programmatic)
Use the Agent API to create an account and get an API key without leaving your terminal. No console access needed.
A 6-digit OTP is sent to the provided email. Verify to unlock full permissions:
The sign-up endpoint is idempotent. Calling it again with the same email rotates the API key and resends the OTP if expired.
Option B: Console (manual)
Go to the AgentMail Console, create an account, and generate an API key from the dashboard.

Store your API key
Create a .env file in your project root and add your key:
We recommend using environment variables to keep your keys secure.
Install the SDK
Install the AgentMail SDK using your preferred package manager. We’ll also
use a library to load the environment variable from the .env file.
Create an inbox and send an email
Now you’re ready to make your first API call. Create a new file (e.g.,
quickstart.py or quickstart.ts) and add the following code. This script
will initialize the AgentMail client, create a new inbox, and then send a
test email.
The domain parameter is optional. If not provided, AgentMail will
use the default @agentmail.to domain. If you would like a custom domain, please upgrade to a paid plan.
Next Steps
You’ve created an inbox and sent your first email. Explore the full power of agents that can autonomously reply, take action, parse attachments, and semantically search inboxes:
Looking for a different language? Email us at support@agentmail.cc and we’ll get you set up.
