AI agent examples
Practical examples for the most common AI agent frameworks. Each example shows the before (direct provider call) and after (via Sluice). The point: adding Sluice to an existing agent requires minimal changes.
Sluice accepts email via the REST API or SMTP. The REST API examples below use simple HTTP calls — no SDK needed. For SMTP integration, see Connect your AI agent.
LangChain (Python)
Before — direct email provider:
After — via Sluice:
n8n
Configure an HTTP Request node to call the Sluice REST API:
| Setting | Value |
|---|---|
| Method | POST |
| URL | https://app.sluice.email/api/v1/emails |
| Authentication | Header Auth |
| Header Name | Authorization |
| Header Value | Bearer sl_live_... |
| Body Content Type | JSON |
JSON body:
This replaces the SMTP Send Email node — no SMTP credentials needed.
OpenAI function calling
Define the tool schema for your agent:
Tool implementation:
Generic Python
Generic TypeScript / Node.js
SMTP integration
All of the above examples use the REST API. If your agent already sends email via SMTP, you can also connect through Sluice's SMTP endpoint — just update your host, port, and credentials. See Connect your AI agent for SMTP examples in Python, Node.js, Go, and Ruby.