Official Python SDK for the AgentEmail API — create and manage email inboxes programmatically.
Project description
agentemail
Official Python SDK for the AgentEmail API.
Create and manage email inboxes programmatically for your AI agents and applications.
Installation
pip install agentemail
Quick Start
from agentemail import AgentemailApi
client = AgentemailApi(api_key="aem_your_api_key_here")
# List your inboxes
inboxes = client.sdk.list_inboxes()
print(inboxes.data)
# Create a new inbox
inbox = client.sdk.create_inbox(name="hello")
print(inbox.name) # "hello"
# Full address: hello@agentemail.co
# List email threads
threads = client.sdk.list_threads(inbox_id=inbox.id)
for thread in threads.data:
print(thread.subject, thread.message_count)
# Get a full thread with all messages
thread = client.sdk.get_thread(inbox_id=inbox.id, thread_id=threads.data[0].id)
for message in thread.messages:
print(message.from_address, message.body_text)
# Check usage vs plan limits
usage = client.sdk.get_usage()
print(f"Inboxes: {usage.inboxes.used}/{usage.inboxes.limit}")
Async Usage
import asyncio
from agentemail import AsyncAgentemailApi
async def main():
client = AsyncAgentemailApi(api_key="aem_your_api_key_here")
inboxes = await client.sdk.list_inboxes()
print(inboxes.data)
asyncio.run(main())
Authentication
Generate an API key from your AgentEmail dashboard.
import os
from agentemail import AgentemailApi
client = AgentemailApi(api_key=os.environ["AGENTEMAIL_API_KEY"])
API Reference
Inboxes
| Method | Description |
|---|---|
client.sdk.list_inboxes() |
List all your inboxes (paginated) |
client.sdk.create_inbox(name=...) |
Create a new inbox |
Emails & Threads
| Method | Description |
|---|---|
client.sdk.list_threads(inbox_id=...) |
List email threads for an inbox |
client.sdk.get_thread(inbox_id=..., thread_id=...) |
Get a thread with all messages |
Usage
| Method | Description |
|---|---|
client.sdk.get_usage() |
Get current usage vs plan limits |
Links
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
agentemail-0.1.0.tar.gz
(29.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agentemail-0.1.0.tar.gz.
File metadata
- Download URL: agentemail-0.1.0.tar.gz
- Upload date:
- Size: 29.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
54dc5526b5ab4f339a6d0a08b5b32c75022aaf802a41505f056a117df34129a9
|
|
| MD5 |
eb808cd7ac23c6edaa0cfa871e614ab8
|
|
| BLAKE2b-256 |
6026cca22f4b91fb7c2ff006b38f3326536a34fb47ef6c9c8de55788efc4000e
|
File details
Details for the file agentemail-0.1.0-py3-none-any.whl.
File metadata
- Download URL: agentemail-0.1.0-py3-none-any.whl
- Upload date:
- Size: 49.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ba4406363ed9933255ba01aa0c936f6a7330422e36693a1a7ea6a8df8825f28
|
|
| MD5 |
27fab580fedabb16e7f12df0cb990980
|
|
| BLAKE2b-256 |
c53d0730ba72ded4cf5d423af0d362635c73cd4ade5e227228387ad13b78ad60
|