Integration
Python SDK
Fully typed Python client for all Dead Simple Email endpoints. Sync and async, with framework integrations built in.
Installation
pip install deadsimple
Quick Start
Create a client, make an inbox, and send your first email in four lines:
from deadsimple import DeadSimple client = DeadSimple(api_key="dse_your_api_key") inbox = client.inboxes.create(display_name="My Agent") client.messages.send( inbox_id=inbox.inbox_id, to="user@example.com", subject="Hello from my agent", text_body="This email was sent by an AI agent.", )
Async Client
For async frameworks like FastAPI, use the async client. Every method from the sync client has an async equivalent:
from deadsimple import AsyncDeadSimple client = AsyncDeadSimple(api_key="dse_your_api_key") inbox = await client.inboxes.create(display_name="Async Agent") messages = await client.messages.list(inbox_id=inbox.inbox_id)
Resources
Every API endpoint is available as a typed method on the client:
| Resource | Methods |
|---|---|
client.inboxes |
create, list, get, delete, bulk_create, bulk_delete |
client.messages |
send, list, get, reply, forward |
client.threads |
list, get |
client.webhooks |
create, list, delete |
client.domains |
add, list, verify, delete |
client.usage |
get |
Framework Integrations
Install optional extras to get pre-built tool definitions for popular AI agent frameworks:
# LangChain toolkit pip install deadsimple[langchain] # CrewAI tools pip install deadsimple[crewai] # OpenAI Agents SDK pip install deadsimple[openai-agents] # MCP server pip install deadsimple[mcp] # All framework integrations pip install deadsimple[all]
Each extra adds framework-specific tool definitions. See the individual integration pages for details:
Bulk Operations
Create or delete many inboxes in a single API call:
# Create 10 inboxes at once inboxes = client.inboxes.bulk_create( count=10, display_name_prefix="Agent", ) for inbox in inboxes: print(f"{inbox.email} ready") # Clean up when done ids = [inbox.inbox_id for inbox in inboxes] client.inboxes.bulk_delete(inbox_ids=ids)
CLI Included
The Python SDK includes the dse command-line tool. Once installed, you can manage inboxes, send email, and check usage from your terminal:
export DSE_API_KEY=dse_your_api_key dse inboxes list dse send --inbox inb_xxx --to user@example.com --subject "Hello" --body "Hi there" dse usage
See the full CLI documentation for all available commands.
Configuration
The client accepts the API key directly, or reads it from the DSE_API_KEY environment variable:
import os from deadsimple import DeadSimple # Explicit key client = DeadSimple(api_key="dse_your_api_key") # Or from environment (reads DSE_API_KEY automatically) client = DeadSimple()