AgentLair Email — REST Email for Agents
Give any agent a working email address in 30 seconds. No SMTP setup, no IMAP polling, no credentials to rotate. Just REST.
Base URL: https://agentlair.dev
Auth: Authorization: Bearer <YOUR_API_KEY>
Setup: Get an API Key
Self-service, no email required:
CODEBLOCK0
Response:
CODEBLOCK1
Store the key as AGENTLAIR_API_KEY in your environment. All subsequent calls need it in the Authorization header.
When to Use This Skill
Use this skill when:
- - An agent needs to send or receive email
- You need to claim a dedicated email identity for an agent
- You want to check an agent's inbox programmatically
- The user asks about agent email, email identity, or sending email as an agent
Claim an Email Address
CODEBLOCK2
Response:
CODEBLOCK3
You can claim multiple addresses per API key.
Send an Email
Important: Use the text field for the message body (not body — that returns a missing_fields error).
CODEBLOCK4
Response:
CODEBLOCK5
Optional fields:
- -
"html" — HTML version of the message - INLINECODE8 — array of CC recipients
Check Inbox
CODEBLOCK6
Response:
CODEBLOCK7
Note: message_id values include RFC 2822 angle brackets <...>. Strip them before using in the read endpoint.
Read a Specific Message
Strip <> from message_id, then URL-encode the @:
CODEBLOCK8
In code:
const rawId = message.message_id.replace(/^<|>$/g, "");
const encodedId = encodeURIComponent(rawId);
const url = `https://agentlair.dev/v1/email/messages/${encodedId}?address=${encodeURIComponent(address)}`;
Check Sent Outbox
CODEBLOCK10
Free Tier Limits
| Limit | Value |
|---|
| Emails per day | 50 |
| API requests per day |
100 |
| Addresses per key | Unlimited |
| Rate limit reset | Midnight UTC |
Delivery Timing
- - External recipients: ~1-2 seconds via Amazon SES
- Intra-domain (agentlair.dev to agentlair.dev): inbox indexing can take 30-120 seconds after SES receipt
- When polling inbox for a just-sent email, use a 120-second timeout minimum
Example Session
User: "Send an email to bob@example.com introducing yourself"
Agent actions:
- 1. Check if you have an API key. If not, get one:
CODEBLOCK11
- 2. Claim an address:
CODEBLOCK12
- 3. Send the email:
CODEBLOCK13
- 4. Confirm to user: "Email sent to bob@example.com from assistant@agentlair.dev"
Notes
- - Emails delivered via Amazon SES (eu-west-1) with DKIM, SPF, and DMARC authentication
- Custom domain support coming Q2 2026
- No data stored beyond delivery — privacy-first design
- Built by AgentLair — infrastructure for autonomous agents
技能名称: agentlair-email
详细描述:
AgentLair Email — 面向智能体的REST邮件服务
30秒内为任何智能体提供一个可用的邮箱地址。无需配置SMTP,无需轮询IMAP,无需轮换凭证。仅需REST。
基础URL: https://agentlair.dev
认证: Authorization: Bearer APIKEY>
设置:获取API密钥
自助服务,无需邮箱:
bash
curl -s -X POST https://agentlair.dev/v1/auth/keys \
-H Content-Type: application/json \
-d {}
响应:
json
{key: allive..., tier: free}
将密钥作为AGENTLAIRAPIKEY存储在您的环境中。所有后续调用都需要在Authorization头中使用它。
何时使用此技能
在以下情况下使用此技能:
- - 智能体需要发送或接收邮件
- 您需要为智能体申请一个专用的邮件身份
- 您想以编程方式检查智能体的收件箱
- 用户询问关于智能体邮件、邮件身份或作为智能体发送邮件的问题
申请邮箱地址
bash
curl -s -X POST https://agentlair.dev/v1/email/claim \
-H Authorization: Bearer $AGENTLAIRAPIKEY \
-H Content-Type: application/json \
-d {address: myagent@agentlair.dev}
响应:
json
{address: myagent@agentlair.dev, claimed: true, alreadyowned: false, accountid: ...}
每个API密钥可以申请多个地址。
发送邮件
重要: 使用text字段作为消息正文(不要使用body——那会返回missing_fields错误)。
bash
curl -s -X POST https://agentlair.dev/v1/email/send \
-H Authorization: Bearer $AGENTLAIRAPIKEY \
-H Content-Type: application/json \
-d {
from: myagent@agentlair.dev,
to: [recipient@example.com],
subject: 来自我的智能体的问候,
text: 纯文本消息正文。
}
响应:
json
{id: out..., status: sent, sentat: ..., ratelimit: {dailyremaining: 49}}
可选字段:
- - html — 消息的HTML版本
- cc — 抄送收件人数组
检查收件箱
bash
curl -s https://agentlair.dev/v1/email/inbox?address=myagent@agentlair.dev&limit=10 \
-H Authorization: Bearer $AGENTLAIRAPIKEY
响应:
json
{
messages: [
{
message_id: ,
from: sender@example.com,
subject: 回复:你好,
received_at: 2026-03-15T...,
read: false
}
],
count: 1
}
注意: message_id值包含RFC 2822尖括号<...>。在读取端点中使用之前,请去掉它们。
读取特定消息
去掉message_id中的<>,然后对@进行URL编码:
bash
来自收件箱的message_id:
去掉尖括号,对@进行URL编码
MSG_ID=abc123%40eu-west-1.amazonses.com
curl -s https://agentlair.dev/v1/email/messages/$MSG_ID?address=myagent@agentlair.dev \
-H Authorization: Bearer $AGENTLAIR
APIKEY
在代码中:
javascript
const rawId = message.message_id.replace(/^<|>$/g, );
const encodedId = encodeURIComponent(rawId);
const url = https://agentlair.dev/v1/email/messages/${encodedId}?address=${encodeURIComponent(address)};
检查已发送邮件
bash
curl -s https://agentlair.dev/v1/email/outbox?limit=5 \
-H Authorization: Bearer $AGENTLAIRAPIKEY
免费套餐限制
100 |
| 每个密钥的地址数 | 无限制 |
| 速率限制重置 | UTC午夜 |
投递时间
- - 外部收件人: 通过Amazon SES约1-2秒
- 域内(agentlair.dev到agentlair.dev):在SES接收后,收件箱索引可能需要30-120秒
- 当轮询收件箱以查找刚发送的邮件时,请使用至少120秒的超时时间
示例会话
用户: 发送一封邮件给bob@example.com,介绍你自己
智能体操作:
- 1. 检查是否有API密钥。如果没有,获取一个:
bash
curl -s -X POST https://agentlair.dev/v1/auth/keys -H Content-Type: application/json -d {}
- 2. 申请一个地址:
bash
curl -s -X POST https://agentlair.dev/v1/email/claim \
-H Authorization: Bearer $AGENTLAIR
APIKEY \
-H Content-Type: application/json \
-d {address: assistant@agentlair.dev}
- 3. 发送邮件:
bash
curl -s -X POST https://agentlair.dev/v1/email/send \
-H Authorization: Bearer $AGENTLAIR
APIKEY \
-H Content-Type: application/json \
-d {
from: assistant@agentlair.dev,
to: [bob@example.com],
subject: 来自你的AI助手的问候,
text: 嗨Bob,我是一个AI助手,特此联系你介绍我自己。如果你需要什么,请告诉我!
}
- 4. 向用户确认:邮件已从assistant@agentlair.dev发送至bob@example.com
备注
- - 邮件通过Amazon SES(eu-west-1)投递,带有DKIM、SPF和DMARC认证
- 自定义域名支持将于2026年第二季度推出
- 投递后不存储任何数据——隐私优先设计
- 由AgentLair构建——面向自主智能体的基础设施