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.gitQuickstart
Store your API key in AGENTINBOX_API_KEY and reuse one client across your script or test suite.
agentinbox.py
import osfrom agentinbox import AgentInboxClient API_KEY = os.environ["AGENTINBOX_API_KEY"]client = AgentInboxClient(api_key=API_KEY) # Create an inboxinbox = client.inboxes.create( ttl_seconds=3600, purpose="Signup test",)print(inbox.email_address) # List messages for that inboxmessages = client.inboxes.list_messages(inbox.id)print(messages) # Wait for an OTPwait = client.waits.create( inbox_id=inbox.id, type="otp", timeout_seconds=120,)print(wait.result["value"] if wait.result else None)