通过REST API为您的代理分配真实邮箱地址。注册@agentlair.dev邮箱,发送和接收邮件——无需SMTP、IMAP或配置任何凭证。
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>
Self-service, no email required:
bash
curl -s -X POST https://agentlair.dev/v1/auth/keys \
-H "Content-Type: application/json" \
-d '{}'
Response:
json
{"key": "al_live_...", "tier": "free"}
Store the key as AGENTLAIR_API_KEY in your environment. All subsequent calls need it in the Authorization header.
Use this skill when:
bash
curl -s -X POST https://agentlair.dev/v1/email/claim \
-H "Authorization: Bearer $AGENTLAIR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"address": "myagent@agentlair.dev"}'
Response:
json
{"address": "myagent@agentlair.dev", "claimed": true, "already_owned": false, "account_id": "..."}
You can claim multiple addresses per API key.
Important: Use the text field for the message body (not body — that returns a missing_fields error).
bash
curl -s -X POST https://agentlair.dev/v1/email/send \
-H "Authorization: Bearer $AGENTLAIR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"from": "myagent@agentlair.dev",
"to": ["recipient@example.com"],
"subject": "Hello from my agent",
"text": "Plain text message body."
}'
Response:
json
{"id": "out_...", "status": "sent", "sent_at": "...", "rate_limit": {"daily_remaining": 49}}
Optional fields:
"html" — HTML version of the message"cc" — array of CC recipientsbash
curl -s "https://agentlair.dev/v1/email/inbox?address=myagent@agentlair.dev&limit=10" \
-H "Authorization: Bearer $AGENTLAIR_API_KEY"
Response:
json
{
"messages": [
{
"message_id": "<abc123@host>",
"from": "sender@example.com",
"subject": "Re: Hello",
"received_at": "2026-03-15T...",
"read": false
}
],
"count": 1
}
Note: message_id values include RFC 2822 angle brackets <...>. Strip them before using in the read endpoint.
Strip <> from message_id, then URL-encode the @:
bash
# message_id from inbox: <abc123@eu-west-1.amazonses.com>
# Strip angle brackets, URL-encode @
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_API_KEY"
In code:
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 $AGENTLAIR_API_KEY"
LimitValueEmails per day50API requests per day100Addresses per keyUnlimitedRate limit resetMidnight UTC
User: "Send an email to bob@example.com introducing yourself"
Agent actions:
bash
curl -s -X POST https://agentlair.dev/v1/auth/keys -H "Content-Type: application/json" -d '{}'
bash
curl -s -X POST https://agentlair.dev/v1/email/claim \
-H "Authorization: Bearer $AGENTLAIR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"address": "assistant@agentlair.dev"}'
bash
curl -s -X POST https://agentlair.dev/v1/email/send \
-H "Authorization: Bearer $AGENTLAIR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"from": "assistant@agentlair.dev",
"to": ["bob@example.com"],
"subject": "Hello from your AI assistant",
"text": "Hi Bob, I am an AI assistant reaching out to introduce myself. Let me know if you need anything!"
}'