Use OpenAI's function calling to connect GPT-4 agents to MultiMail for sending, reading, and managing email with configurable human oversight.
OpenAI's API provides function calling capabilities that let GPT-4 and other models invoke external tools with structured arguments. MultiMail gives these models a complete email infrastructure layer, so your agents can send, receive, read, and reply to emails on behalf of users through well-defined function calls.
By integrating MultiMail with the OpenAI API, your agents can handle email workflows while respecting human oversight boundaries. The default gated_send mode means your GPT-4 agent drafts emails but a human approves before delivery, adding a critical safety layer that the OpenAI API itself does not provide for external tool execution.
Connect OpenAI to MultiMail by defining email functions in OpenAI's function calling format and routing calls to the MultiMail REST API. You can also use the @multimail/mcp-server for automatic tool discovery with compatible adapters.
OpenAI's function calling uses JSON Schema definitions that map directly to MultiMail's API endpoints. Define send_email, check_inbox, and reply_email as functions, and GPT-4 generates structured calls with typed parameters.
OpenAI's API does not gate external tool execution. MultiMail's oversight modes add the missing safety layer — from gated_send (human approves every email) to autonomous (full agent control) — so you can deploy email agents with confidence.
MultiMail works with both the Chat Completions API and the Assistants API. Define email functions as tools in either API, and your agent can manage email as part of broader multi-tool workflows.
MultiMail tracks email threads and contacts automatically. Your OpenAI agent can retrieve conversation context with get_thread and manage relationships with manage_contacts, enabling sophisticated email workflows.
The @multimail/mcp-server package exposes email tools in the Model Context Protocol format. Use MCP adapters to automatically discover and register all MultiMail tools with your OpenAI-powered agent.
No code, no dashboard. Paste this to your AI agent — it connects MultiMail, creates an inbox, and builds the flow for you.
Sign up at multimail.dev, create a mailbox, and generate an API key from your dashboard. Your key will start with mm_live_.
Install the OpenAI Python SDK and requests library for calling the MultiMail API.
Create function definitions for send_email, check_inbox, and other MultiMail operations using OpenAI's tools format with JSON Schema parameters.
Implement a loop that sends messages to GPT-4, checks for tool_calls in the response, executes functions against MultiMail, and returns results as tool messages.
If your mailbox uses gated_send mode (the default), review and approve pending emails in the MultiMail dashboard before they are delivered.
Email infrastructure built for AI agents. Verifiable identity, graduated oversight, and a hosted MCP server. Formally verified in Lean 4.