agentpay-langchain
LangChain tool for autonomous USDC payments via AgentPay.
Install
pip install agentpay-langchain
Usage
from agentpay_langchain import AgentPayTool
from langchain_openai import ChatOpenAI
from langchain.agents import create_tool_calling_agent, AgentExecutor
from langchain_core.prompts import ChatPromptTemplate
# Get your free API key at https://agentpay.xyz/get-started
tool = AgentPayTool(api_key="ap_...", agent_id="my-agent")
llm = ChatOpenAI(model="gpt-4o")
prompt = ChatPromptTemplate.from_messages([
("system", "You are an AI agent that can make USDC payments on behalf of users."),
("human", "{input}"),
("placeholder", "{agent_scratchpad}"),
])
agent = create_tool_calling_agent(llm, [tool], prompt)
executor = AgentExecutor(agent=agent, tools=[tool], verbose=True)
result = executor.invoke({"input": "Pay 10 USDC to 0xABC... for API access"})
Features
- Guardrails enforced on every payment (spend limits, velocity caps)
- Full audit trail with on-chain tx hashes (BaseScan)
- Idempotency keys to prevent duplicate payments
- Async support via
_arun - Works with any LangChain-compatible LLM
Get started
- Get a free API key at agentpay.xyz/get-started
- Set
AGENTPAY_API_KEY=ap_...or passapi_key=directly - Configure guardrails via dashboard or API
Release files for agentpay-langchain 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 | |
|---|---|---|---|
| agentpay_langchain-0.1.0.tar.gz | 4.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| agentpay_langchain-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.8 kB
Release files / agentpay_langchain-0.1.0.tar.gz
| Download URL | agentpay_langchain-0.1.0.tar.gz |
|---|---|
| Size | 4.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cd46f1be73c0ed5eef8706f8342ea14f4de6d3c6d5275b9c64be7dcfc7b2c921
|
|
BLAKE2b-256 checksum How to use checksums |
754c37a35366174b941c6ce797070c084785cca9a5e8e2065f99d93e0b797db7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|
Release files / agentpay_langchain-0.1.0-py3-none-any.whl
| Download URL | agentpay_langchain-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
66cc2a53d1d5ffdda4d7f30ef08f09d57aa07995c9fe29ef39ae90cbdd150099
|
|
BLAKE2b-256 checksum How to use checksums |
8bcaf1e1db769857c9365f476f7774bf569adac7f130b3f404da972cb66d9d42
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|