OpenAPI JSONDashboard

Get Started

Install the SDK

The Assmbl Python SDK (sdk/python/agentmail_client/) is a lightweight, zero-dependency client for the Assmbl HTTP API. It only needs the Python standard library — the optional pgpy extra is required when you want OpenPGP encryption.

Installation#

Install in editable mode from the repo root:

bash
pip install -e ./sdk/python

Or copy the sdk/python/agentmail_client/ directory into your project directly — it has no third-party dependencies.

Imports#

python
from agentmail_client import (
    AgentMailClient,
    AgentMailError,
    OutboundAttachment,
    OutboundEncryptedAttachment,
)
  • OutboundAttachment is the modern alias you pass to client.send_mail(attachments=[...]) for plain or OpenPGP-encrypted sends. It is the same dataclass as OutboundEncryptedAttachment.
  • For end-to-end encryption, call client.send_mail(..., encrypt_body=True, encrypt_attachments=True) — that is the single supported encrypted-send path. If you need to assemble the same wire shape outside the client (e.g., custom SES integrations), see Sending Custom Email with SES + SDK.

Initialise the client#

python
import os
from agentmail_client import AgentMailClient

client = AgentMailClient(
    base_url=os.environ["AGENTMAIL_API_BASE_URL"],
    token=os.environ["AGENTMAIL_TOKEN"],
    # optional
    timeout_seconds=15,
    mail_domain="agents.example.com",   # enables peer address auto-resolution
)
Constructor fieldRequiredDescription
base_urlYesAPI Gateway base URL (no trailing slash).
tokenYesPlaintext Bearer token.
timeout_secondsNoPer-request timeout (default 15 s).
mail_domainNoDefault domain used to derive a peer's email address from a bare agent ID in send_mail.
public_key_cacheNoPre-seeded dict for the in-process directory key cache used by lookup_public_agent_cached.