LangChain
agentsvc tools for LangChain
The agentsvc packages for Python and JavaScript turn any of our 126 services into LangChain tools with their live input schemas. Each call costs $0.002 to $0.6, paid from a prepaid credit token or from the agent's own wallet via x402 (USDC on Base, Solana, Polygon or Arbitrum). No account, no subscription. Failed calls are never charged.
Python
pip install "agentsvc[langchain]" langgraph langchain-anthropic
from agentsvc import Agentsvc
from agentsvc.langchain import agentsvc_tools
from langgraph.prebuilt import create_react_agent
svc = Agentsvc(credit_token="asvc_cr_...") # or env AGENTSVC_CREDIT_TOKEN
tools = agentsvc_tools(svc, ["web-scrape", "news-search", "agent-memory"])
agent = create_react_agent("anthropic:claude-haiku-5-5", tools)
result = agent.invoke({"messages": [("user", "Summarize https://example.com and remember the title under key 'last_page'")]})
print(result["messages"][-1].content)Every tool has a sync and an async implementation (tool.invoke, tool.ainvoke). Pay from a wallet with pip install "agentsvc[wallet]" and Agentsvc(private_key="0x...", network="eip155:8453").
JavaScript
npm install agentsvc @langchain/core @langchain/langgraph @langchain/anthropic
import { createAgentsvc } from 'agentsvc';
import { agentsvcLangChainTools } from 'agentsvc/langchain';
import { createReactAgent } from '@langchain/langgraph/prebuilt';
import { ChatAnthropic } from '@langchain/anthropic';
const tools = await agentsvcLangChainTools(createAgentsvc({ creditToken: process.env.AGENTSVC_CREDIT_TOKEN }), { category: 'web' });
const agent = createReactAgent({ llm: new ChatAnthropic({ model: 'claude-haiku-5-5' }), tools });Paying
Credit token: buy one at /credits from $0.10 (+10% bonus). Wallet: a separate wallet with a few dollars of USDC on Base, Polygon or Arbitrum; it pays no gas. Without either, svc.sample("web-scrape") returns the free example output of any service.
Pick tools
Pass slugs, a category (web, text, data, finance, utility, visual) or a filter function. Useful sets: reading the web (web-scrape, search-read, answer-with-sources), trading (token-precheck, token-smart-money), agent state (agent-memory, agent-inbox), finding other paid APIs (service-finder). Full list: /services.
Links
- PyPI: agentsvc, npm: agentsvc, source: github.com/agentsvc/agentsvc
- Example: two agents hand work to each other
- CrewAI works the same way:
from agentsvc.crewai import agentsvc_crewai_tools