AgentMail is the fastest way to give a Codex agent its own email inbox. It can send email, receive replies, and manage full conversation threads from a dedicated inbox it owns.
AgentMail works with OpenAI Codex out of the box. Install the SDK, set your API key, and your Codex agent has a dedicated inbox in under a minute.
pip install agentmail
# or
npm install agentmailexport AGENTMAIL_API_KEY="am_us_your_key_here"from agentmail import AgentMail
client = AgentMail(api_key=os.getenv("AGENTMAIL_API_KEY"))Your Codex agent gets its own inbox with its own email address. It never sends from your personal email or shares your credentials.
Create inboxes, send messages, read replies, and manage threads - all through a clean SDK that works with any Python or Node.js environment.
Set up webhooks to get notified instantly when new emails arrive. Your agent can react immediately, not after a polling interval.
import os
from agentmail import AgentMail
client = AgentMail(api_key=os.getenv("AGENTMAIL_API_KEY"))
# Create a dedicated inbox for your agent
inbox = client.inboxes.create()
print(f"Agent inbox: {inbox.inbox_id}")
# Send an email
client.inboxes.messages.send(
inbox_id=inbox.inbox_id,
to="user@example.com",
subject="Hello from your Codex agent",
text="This email was sent by a Codex agent via AgentMail.",
)
# Check for replies
messages = client.inboxes.messages.list(inbox_id=inbox.inbox_id)
for msg in (messages.messages or []):
print(f"{msg.from_address}: {msg.subject}")Common questions about AgentMail and Codex.
Free tier. No credit card required. Inboxes ready in under a second.
Start for free© 2026 AgentMail, Inc. All rights reserved.