Prerequisites
- OpenMail account with API key
- An inbox already created (see API integration — Step 1)
Tools to implement
| Tool | What it does |
|---|---|
send_email | Send an email (or reply in a thread) |
check_inbox | List unread threads |
read_thread | Get all messages in a thread and mark it as read |
LangChain (Python)
Wire the agent
Vercel AI SDK (TypeScript)
Wire the agent
Generic (fetch)
For any framework that supports function calling — define these as your tool implementations.Inbound email
The tools above let your agent poll for new mail withcheck_inbox. For real-time delivery, connect a WebSocket listener or configure a webhook — both push message.received events as they arrive.
See the API integration guide — Step 4 for full WebSocket and webhook code examples with Node.js and Python.
Related
API integration
Create inboxes, inject env vars, and handle inbound for multi-tenant apps.
API reference
Full endpoint documentation.
WebSockets
Real-time event streaming — no public URL needed.
Attachments
Sending and receiving files.