Quickstart: Python
Sign agent requests from LangChain, AutoGen, CrewAI, or any Python async code.
1
Install the SDK
bash
pip install authproof2
Create a client and call signed_fetch
python
from authproof import AuthProofClient
from authproof.adapters import eth_account_wallet
import asyncio, os
wallet = eth_account_wallet(os.environ["AGENT_PRIVATE_KEY"])
client = AuthProofClient(wallet=wallet)
async def main():
response = await client.signed_fetch(
"https://api.example.com/tools/search",
method="POST",
headers={"content-type": "application/json"},
body={"query": "find top wallets"}
)
print(response.json())
asyncio.run(main())The Python SDK is async-first (httpx under the hood). A synchronous wrapper is available via client.signed_fetch_sync().
2
Use a web3.py account instead
python
from web3 import Web3
from authproof.adapters import web3py_wallet
w3 = Web3()
account = w3.eth.account.from_key(os.environ["AGENT_PRIVATE_KEY"])
wallet = web3py_wallet(account)
client = AuthProofClient(wallet=wallet)3
Watch the logs
Every signed request appears in your project dashboard attributed to the agent's wallet address.