AgentKey Python SDK (agentkey-sdk)
Official Python SDK for AgentKey — The Identity & Communication OS for Autonomous AI Agents.
Give your AI agents their own dedicated email addresses, zero-token OTP verification code extraction, verifiable cryptographic passports, and outbound messaging.
📦 Installation
pip install agentkey-sdk
🚀 Quickstart
from agentkey import AgentKey
# Initialize with your API key from https://www.agentkey.in/dashboard/keys
client = AgentKey(
api_key="ai_live_YOUR_KEY",
base_url="https://www.agentkey.in"
)
# 1. Create a dedicated task email inbox for your agent
inbox = client.inboxes.create(client_id="signup-task-42")
print("Agent Address:", inbox.email_address)
# Output: signup-task-42@agentkey.in
# 2. Wait for incoming verification codes (zero-token extraction)
# Blocks until a 4-8 digit OTP code arrives (204 on timeout)
otp = client.inboxes.wait_for_otp(inbox.id, timeout=60)
print("Extracted 2FA Code:", otp)
# 3. Send an outbound email from the agent
client.messages.send(
inbox_id=inbox.id,
to="recipient@example.com",
subject="Task Complete",
text="Your autonomous agent has completed the task."
)
⚡ Zero-Token Edge Extraction
Standard LLM setups waste thousands of context tokens parsing long HTML emails just to find a 4-digit login PIN. AgentKey executes deterministic extraction at the wire edge before messages hit storage:
# Wait for sign-in or magic links:
magic_link = client.inboxes.wait_for_magic_link(inbox.id, timeout=30)
print("Magic Link:", magic_link)
# List recent messages:
messages = client.messages.list(inbox_id=inbox.id)
for msg in messages:
print(msg.sender, msg.subject, msg.extracted_data)
🤖 Framework Integrations
Native tool adapters are included for leading agent frameworks:
LangChain / LangGraph
from agentkey import AgentKey, tools
client = AgentKey(api_key="ai_live_YOUR_KEY", base_url="https://www.agentkey.in")
agent_tools = tools.langchain_tools(client)
Anthropic Claude API
from agentkey import AgentKey, tools
import anthropic
client = AgentKey(api_key="ai_live_YOUR_KEY", base_url="https://www.agentkey.in")
claude = anthropic.Anthropic()
reply = claude.messages.create(
model="claude-3-7-sonnet-20250219",
max_tokens=1024,
tools=tools.anthropic_tools(),
messages=[{"role": "user", "content": "Create an inbox and check for codes."}],
)
🛡️ Model Context Protocol (MCP) Server
AgentKey provides a hosted zero-installation MCP server for Claude Code and Cursor:
claude mcp add --transport http agentkey https://www.agentkey.in/mcp \
--header "Authorization: Bearer ai_live_YOUR_KEY"
📚 Documentation & Dashboard
- Platform Dashboard: https://www.agentkey.in/dashboard
- API Documentation: https://www.agentkey.in/docs
- OAuth & OIDC Discovery: https://www.agentkey.in/.well-known/openid-configuration
📄 License
MIT License. See LICENSE for details.
Metadata
Release files for agentkey-sdk 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| agentkey_sdk-0.1.0.tar.gz | 13.9 kB | Without provenance | Details for agentkey_sdk-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| agentkey_sdk-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for agentkey_sdk-0.1.0-py3-none-any.whl |
Total release size: 27.3 kB
Release files / agentkey_sdk-0.1.0.tar.gz
| Download URL | agentkey_sdk-0.1.0.tar.gz |
|---|---|
| Size | 13.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f735c57f1c0047936521fa14008f3ee9ffb735246470ed74316c536d353e43c8
|
|
BLAKE2b-256 checksum How to use checksums |
9694fa9074a1ea78d72ef70029d2ed2c5e77453511d265afcd414fb8afb65c6c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.9
|
Release files / agentkey_sdk-0.1.0-py3-none-any.whl
| Download URL | agentkey_sdk-0.1.0-py3-none-any.whl |
|---|---|
| Size | 13.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6700a231cd01f1a9b07efb5d2c135ce4a16ad7c6b2ea52767bb1ec8b065b82fd
|
|
BLAKE2b-256 checksum How to use checksums |
6d57c50e0a61e4cb9ae6191134324ba369e8f941af0ad35118f8b5766fb1d39a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.9
|
Security for agentkey-sdk 0.1.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.