Python SDK

The AgentInbox Python SDK wraps the REST API with resource helpers for inboxes, messages, waits, extractions, and sessions.

Install from GitHub

The SDK source is available at agentinbox-in/agentinbox-python. Install from GitHub until the PyPI package is published.

Installation

Install
pip install git+https://github.com/agentinbox-in/agentinbox-python.git

Quickstart

Store your API key in AGENTINBOX_API_KEY and reuse one client across your script or test suite.

agentinbox.py
import os
from agentinbox import AgentInboxClient
API_KEY = os.environ["AGENTINBOX_API_KEY"]
client = AgentInboxClient(api_key=API_KEY)
# Create an inbox
inbox = client.inboxes.create(
ttl_seconds=3600,
purpose="Signup test",
)
print(inbox.email_address)
# List messages for that inbox
messages = client.inboxes.list_messages(inbox.id)
print(messages)
# Wait for an OTP
wait = client.waits.create(
inbox_id=inbox.id,
type="otp",
timeout_seconds=120,
)
print(wait.result["value"] if wait.result else None)

Other ways to integrate