Skip to main content

LangChain tools for AgentPayment Network — autonomous agent-to-agent payments

Project description

langchain-agentpayment

LangChain tools for AgentPayment Network — autonomous agent-to-agent payments across crypto, card, and ACH.

Installation

pip install langchain-agentpayment

Quick Start

from langchain_agentpayment import AgentPaymentToolkit
from langchain_openai import ChatOpenAI
from langchain.agents import create_tool_calling_agent, AgentExecutor
from langchain_core.prompts import ChatPromptTemplate

# Initialize toolkit
toolkit = AgentPaymentToolkit(api_key="apn_your_key_here")
tools   = toolkit.get_tools()

# Create agent
llm    = ChatOpenAI(model="gpt-4o")
prompt = ChatPromptTemplate.from_messages([
    ("system", "You are an autonomous agent that can send and receive payments."),
    ("human", "{input}"),
    ("placeholder", "{agent_scratchpad}"),
])
agent    = create_tool_calling_agent(llm, tools, prompt)
executor = AgentExecutor(agent=agent, tools=tools, verbose=True)

# Run
executor.invoke({"input": "Create an invoice for agent_abc for $5 for API usage"})
executor.invoke({"input": "Set a billing rule to auto-pay up to $10 from provider_xyz via crypto"})
executor.invoke({"input": "Set a circuit breaker with max $100/day spend limit"})

Available Tools

Tool Description
create_invoice Bill a consumer agent for services rendered
approve_invoice Manually approve and pay a pending invoice
set_billing_rule Auto-approve invoices from a provider
check_invoice_status Check status of an invoice
list_invoices List sent/received invoices
create_recurring_billing Set up recurring billing (Model A or B)
set_circuit_breaker Set daily spend/transaction limits

Pricing

Volume-based, dual-sided:

  • 0–10k requests/month: 1% consumer + 1% provider
  • 10k–20k: 0.9% each side
  • 20k+: 0.8% each side

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langchain_agentpayment-0.1.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

langchain_agentpayment-0.1.0-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file langchain_agentpayment-0.1.0.tar.gz.

File metadata

  • Download URL: langchain_agentpayment-0.1.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for langchain_agentpayment-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ab3deddbdc60f15e1d0839b903b44b429cba2e468444b343703065d5dcf9bca6
MD5 ccfc71939aeaa25527858439de3c4068
BLAKE2b-256 645551f57a68d8d1f7207f1f0b0cba515e537823dd67b5b650f26a067632770a

See more details on using hashes here.

File details

Details for the file langchain_agentpayment-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_agentpayment-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1d46d57d278d732f18e7de2dad4ce8794834d37d9756ccd89734d0b557264e22
MD5 d7798e42beac08807493bdf7c29f827a
BLAKE2b-256 4546a17170a3138c119b9c487054522945eb0f960fa4ed5a7e53ec092996bd4c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page