Skip to main content
AgentiSend AgentiSend

agentisend (Python)

AgentiSend is a Resend alternative: a transactional email API for apps (password resets, receipts, sign-in codes) that takes Resend SDK requests unchanged, with per-key budgets and a kill switch for AI agents that send.

This is its Python SDK. The client is the standard library only — zero required dependencies, Python 3.11+. Django is an optional extra.

Install

pip install agentisend

The source is public at https://github.com/fortuneflick/agentisend-python.

Quickstart

from agentisend import AgentiSend, idempotency_key

client = AgentiSend()  # reads AGENTISEND_API_KEY and AGENTISEND_BASE_URL

sent = client.send_email(
    {"from": "you@yourdomain.com", "to": "them@example.com",
     "subject": "Hello", "text": "First send."},
    idempotency=idempotency_key("welcome-email", "user_123"),
)
print(sent["id"])

email = client.get_email(sent["id"])
print(email["status"])  # queued -> sent -> delivered ...

Django

send_mail and Django's password-reset mail use the email backend. One message is POST /emails. A list passed to send_messages is POST /emails/batch (500 per request). The Idempotency-Key is the message's Message-ID. A refusal raises AgentiSendError (code, message, fix) unless fail_silently is set, in which case send_messages returns how many were accepted.

pip install "agentisend[django]"
# settings.py
EMAIL_BACKEND = "agentisend.django.EmailBackend"
AGENTISEND_API_KEY = "as_your_key"  # or the AGENTISEND_API_KEY environment variable
# AGENTISEND_BASE_URL = "https://api.agentisend.com"
DEFAULT_FROM_EMAIL = "you@yourdomain.com"
from django.core.mail import send_mail

send_mail("Hello", "First send.", "you@yourdomain.com", ["them@example.com"])

Errors name the fix

Every 4xx/5xx raises AgentiSendError carrying code, message, fix, docs_url, status, retry_after_seconds (from Retry-After when present) and request_id. A response that is not the documented envelope raises AgentiSendTransportError.

Surface

emails (send_email, send_email_batch, get_email, list_emails, list_email_events) · api keys (+ rotate_api_key) · domains (+ verify, wait_for_domain) · webhooks (+ replay, dead letters, list_webhook_deliveries, rotate_webhook_secret) · limits (+ per-key kill, kill_all) · trust standing, and the rest of the API.

Parity is pinned by CI: every method and path in the committed openapi.json that an API key may call has a client method, matched on the full path. The few a key is refused (resuming a kill switch, approving a held send, billing, team membership) are a person's, in the console. packages/sdk-python/quickstart.py is run by the test suite against a local AgentiSend server in pnpm test.

Tests

python3 -m unittest discover -s packages/sdk-python/tests

Metadata

Release files for agentisend 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agentisend 0.2.0
File Size Uploaded Provenance Actions
agentisend-0.2.0.tar.gz 34.4 kB Without provenance Details for agentisend-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for agentisend 0.2.0
File Interpreter ABI Platform Actions
agentisend-0.2.0-py3-none-any.whl Python 3 none any Details for agentisend-0.2.0-py3-none-any.whl

Total release size: 61.6 kB

Release files / agentisend-0.2.0.tar.gz

Download URL agentisend-0.2.0.tar.gz
Size 34.4 kB
Tags Source
SHA-256 checksum
How to use checksums
20a44c9bf9145fc7002ee42d96337a0b0ad293a3d4c30c44578b87ce1b379c15
BLAKE2b-256 checksum
How to use checksums
b882c4e4f2bc87a0703488bd35c14a8ea9a552c5b2817dda8ff0657b27e94dc0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Release files / agentisend-0.2.0-py3-none-any.whl

Download URL agentisend-0.2.0-py3-none-any.whl
Size 27.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
60b0318e034f2d7e94a314281fbc2d02aea590032619f7e6f87fda5093e29fc1
BLAKE2b-256 checksum
How to use checksums
51840b64496f38dc01138123eb250a5c8d0a6f6bca3bf0e693b7bd4361f040f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Security for agentisend 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page