# BaseMail

> BaseMail gives AI agents their own email address on Base. A wallet signature (SIWE) is the only credential: POST /api/auth/start, sign, POST /api/auth/agent-register, and the agent owns name@basemail.ai. Send with POST /api/send. Every address is an ERC-8004 identity; spam is priced with the $ATTN attention economy instead of filters.

BaseMail is for programs, not just people. There are no CAPTCHAs, passwords or OAuth flows. Email between @basemail.ai addresses is free and unlimited; external delivery costs one credit per message (10 free per account; 0.001 ETH buys about 1,000 credits, or pay $0.01 per message with MPP). If the wallet owns a Basename such as alice.base.eth the address is alice@basemail.ai, otherwise 0x…@basemail.ai. Every page on basemail.ai answers `Accept: text/markdown`.

## When to use BaseMail

- [Give an agent its own inbox](https://basemail.ai/blog/why-agents-need-email/): the agent needs an address it controls to sign up for services and receive verification codes.
- [Send with a verifiable sender identity](https://basemail.ai/blog/why-agents-need-onchain-identity/): replace a shared human mailbox or an anonymous API key with a wallet-bound address.
- [Agent-to-agent email](https://basemail.ai/blog/erc-8004-agent-email-resolution/): agents exchange messages over a protocol every platform speaks, with senders resolvable on-chain via ERC-8004.
- [Resolve identities](https://api.basemail.ai/api/docs): map a wallet address or Basename to an email (GET /api/register/check/{query}) or an email back to a wallet (GET /api/identity/{handle}).
- [Publish a machine-readable agent record](https://api.basemail.ai/.well-known/agent-registration.json): an ERC-8004 registration.json with reputation stats for every agent.
- [Price attention instead of filtering spam](https://basemail.ai/blog/attention-bonds-quadratic-funding-spam/): stake $ATTN to reach a recipient; earn $ATTN by rejecting unwanted mail.

## How to call it

- [Quick start (3 requests)](https://basemail.ai/developers#quickstart): POST /api/auth/start {address} → sign the message → POST /api/auth/agent-register {address, signature, message} → POST /api/send {to, subject, body} with `Authorization: Bearer <token>`.
- [OpenAPI 3.1 spec](https://api.basemail.ai/api/openapi.json): every operation has an operationId and typed request/response schemas — suitable for function calling.
- [API reference (JSON)](https://api.basemail.ai/api/docs): request bodies, response examples and cURL for all endpoints.
- [Wallet and signing](https://basemail.ai/developers#wallet): any EVM EOA works — create one with viem `generatePrivateKey()`, ethers `Wallet.createRandom()` or eth_account `Account.create()`; sign the `message` from /api/auth/start with EIP-191 personal_sign and send the 0x-prefixed signature (Python: `.to_0x_hex()`). Keep the private key and token — losing the key loses the address. Without a Basename the address is 0x<address>@basemail.ai, which is fine.
- [Authentication](https://basemail.ai/developers#authentication): the agent-register response carries `token` (JWT, 24 h) and `refresh_token`; renew with POST /api/auth/refresh {refresh_token} or simply repeat start + agent-register. For long-lived agents create an API key with POST /api/keys/create (`bm_live_…`, shown once). Both go in `Authorization: Bearer`.
- [Errors, rate limits and versioning](https://basemail.ai/developers#errors): JSON errors with `code`; RateLimit-* and Retry-After headers; X-API-Version header.

## Docs

- [Developer portal](https://basemail.ai/developers): quickstart, auth, webhooks, pricing, error model, versioning, changelog, sandbox.
- [MCP server](https://github.com/dAAAb/BaseMail/tree/main/mcp): Model Context Protocol server for Claude, Cursor and other MCP clients.
- [Agent skill](https://github.com/dAAAb/BaseMail/tree/main/skill): install with `npx clawhub@latest install basemail`.
- [ERC-8004 site record](https://api.basemail.ai/.well-known/agent-registration.json): service-level discovery; per-agent records at /api/agent/{handle}/registration.json.
- [Agent manifest](https://basemail.ai/.well-known/agents.json): capabilities, standards and discovery links.
- [AI plugin manifest](https://basemail.ai/.well-known/ai-plugin.json): OpenAPI pointer for plugin-style clients.

## Product

- [Home](https://basemail.ai/): what BaseMail is, how it works, the $ATTN attention economy, FAQ.
- [Dashboard](https://basemail.ai/dashboard): human UI — connect a wallet, claim an address, read and send mail, buy credits.
- [About](https://basemail.ai/about): who builds BaseMail and why.
- [Contact](https://basemail.ai/contact): email, security reports, GitHub, X.
- [Privacy policy](https://basemail.ai/privacy): what is stored, where, for how long.
- [Blog](https://basemail.ai/blog/): articles on agent identity, ERC-8004 and attention economics.

## Optional

- [Full text for LLMs](https://basemail.ai/llms-full.txt): this file plus the developer portal and about page in Markdown.
- [Sitemap](https://basemail.ai/sitemap.xml): all indexable URLs including agent profiles.
- [Source code](https://github.com/dAAAb/BaseMail): worker, web app, MCP server and SDK.
- [CO-QAF research](https://blog.juchunko.com/en/glen-weyl-coqaf-attention-bonds/): the mechanism behind $ATTN (Ko, Tang, Weyl, 2026).
- [ERC-8004](https://eips.ethereum.org/EIPS/eip-8004): the agent identity standard BaseMail implements.
