Real mail for AI agents
An API and a tool spec for agents that need to put paper in a Canadian mailbox.
Some things still have to arrive on paper: formal notices, landlord and tenant letters, statements, cover letters, letters to banks and governments. If your user needs one of those and you are an AI agent, you can send it through mailer. in three calls. $10 per envelope, up to 5 A4 pages, cheaper in bulk, Canada only.
Everything an agent needs
- /llms.txt: plain-text summary written for language models
- /openapi.json: OpenAPI 3.1 spec
- /agent-tools.json: tool definitions for function calling and MCP wrappers
- /v1/pricing: live prices and limits as JSON, no key needed
Use it as an MCP server
Claude, ChatGPT and any other MCP client can connect directly, nothing to install: https://mailer.websystems.co/mcp. Send your key as Authorization: Bearer <key>. In Claude Code:
claude mcp add --transport http mailer https://mailer.websystems.co/mcp \
--header "Authorization: Bearer test_xxx"Tools: get_pricing, get_sandbox_key, buy_credits_link, get_account, create_topup_link, send_letter, get_letter, list_letters. The payment tools return a Stripe link for a human to pay; send_letter takes the price from credit before anything is created and needs an idempotency key, so a retry never charges twice.
The flow
# 1. free sandbox key: nothing is printed, mailed or charged
curl -X POST https://mailer.websystems.co/api/keys/test
# 2. send a letter (a human funds a live key; see "Paying" below)
curl https://mailer.websystems.co/v1/letters \
-H "Authorization: Bearer test_xxx" \
-H "Idempotency-Key: invoice-7841-letter-1" \
-F pdf=@letter.pdf \
-F address_line1="Jane Doe, 123 Maple St" -F city=Toronto -F province=ON -F postal_code="M5V 1J2" \
-F service_level=standard \
-F return_address='{"name":"Acme Ltd.","address_line1":"5 Queen St","city":"Ottawa","province":"ON","postal_code":"K1A 0B1"}'
# 3. check it
curl https://mailer.websystems.co/v1/letters/123 -H "Authorization: Bearer test_xxx"Paying: a human funds the key
Agents do not hold payment cards, and that is by design. Call POST /api/keys/checkout with the human’s email and a pack_id. You get a Stripe Checkout link; hand it to the human. When they pay, a live key is emailed to them and they give it to you. If a live send returns HTTP 402, the balance ran out: ask for a top-up.
Rules for agents
- Mail cannot be undone. Confirm recipient, address and content with the human before a live send, unless they pre-authorized it.
- Always send an Idempotency-Key and reuse it on retries, so a network error never mails the same letter twice.
- The human or company that owns the key is the customer and is responsible for what you send. See the Service Agreement section 5.
- Nothing deceptive, threatening, harassing or unsolicited-bulk. Such letters are refused. See Acceptable Use.
- PDFs are limited to 4 MB, A4, 5 pages. This is a mailing service, not legal service of documents.