Connect any open model — Llama, Mistral, Qwen, or your own fine-tune — to a production email API with graduated oversight controls built in.
Hugging Face provides the foundational layer for a large share of production AI stacks: open model weights, inference endpoints, Transformers pipelines, and increasingly, agent tooling through smolagents. When those agents need to touch email — reading a support inbox, drafting a reply, triaging inbound leads — they need infrastructure that enforces safe behavior regardless of which model is generating the output.
MultiMail is a REST API designed for exactly this. It exposes email primitives (send, reply, read, classify, approve) behind a policy layer that runs independently of the model. Whether your pipeline is running a 7B model on a local GPU or hitting a Hugging Face Inference Endpoint, MultiMail applies the same oversight rules: gated sends, human-in-the-loop approval queues, and webhook-driven delivery confirmation.
The integration pattern is straightforward: your Hugging Face pipeline generates text or a structured action, and your application code calls the MultiMail API to execute it. No special SDK required — standard HTTP calls or the Python `requests` library are sufficient. This keeps your model layer decoupled from your email layer, which matters when you're swapping models or running A/B tests across checkpoints.
MultiMail's oversight controls apply at the API layer, not the model layer. A fine-tuned classifier and a 70B instruction model are subject to identical send policies. You don't need to re-implement safety logic when you swap models or update weights.
MultiMail's oversight and identity models are proven correct in Lean 4. For teams using open models — where output behavior is harder to guarantee — having a formally verified authorization boundary on the email side reduces the attack surface significantly.
Start with gated_all to require human approval for every action while you validate your pipeline's behavior. Relax to gated_send or monitored once you have confidence in the model's outputs. The mode is set per mailbox, not per request.
MultiMail fires webhooks on inbound email, delivery status, and approval events. Use these to trigger Hugging Face Inference Endpoint calls or local pipeline runs — the email event becomes the entry point for your agent workflow.
The list-inbox (GET /v1/mailboxes/{mailbox_id}/emails) and read-email (GET /v1/mailboxes/{mailbox_id}/emails/{email_id}) endpoints return clean, structured JSON — sender, subject, body_markdown, thread metadata — that maps directly to classifier inputs. No parsing raw MIME, no attachment handling boilerplate.
MultiMail handles unsubscribe mechanics (CAN-SPAM) and provides audit logs with full attribution (GDPR Article 30 record-keeping). Your Hugging Face pipeline doesn't need to implement compliance logic — the API enforces it.
No code, no dashboard. Paste this to your AI agent — it connects MultiMail, creates an inbox, and builds the flow for you.
Install the Transformers library and the requests library for making MultiMail API calls.
Sign up at multimail.dev, copy your API key from the dashboard (it starts with mm_live_), and create a mailbox. For testing, use the mm_test_ key — it records actions without delivering email. Creating a mailbox requires an admin-scope key.
Pull an email from the inbox and pass its body through a Transformers pipeline to confirm the data flow works end to end before building automation logic.
Register a webhook URL so MultiMail calls your endpoint when new email arrives. Use ngrok or a staging server URL during development. Register the webhook from the dashboard or via API.
Send a test email through the gated_send path and confirm it appears in the pending queue before delivery. This validates that your oversight mode is correctly configured.
Email infrastructure built for AI agents. Verifiable identity, graduated oversight, and a hosted MCP server. Formally verified in Lean 4.