Integration Guides
Connect Microtoll to your AI agent framework in minutes. One MCP server, all APIs, all frameworks.
CrewAI
Pay-per-use APIs for your CrewAI agents
LangChain / LangGraph
Pay-per-use APIs for your LangChain agents
Cursor
Pay-per-use APIs for Cursor agents
OpenAI Agents SDK
Pay-per-use APIs for OpenAI agents
LlamaIndex
Pay-per-use APIs for your LlamaIndex agents
AutoGen
Pay-per-use APIs for your AutoGen agents
Haystack
Pay-per-use APIs for your Haystack pipelines
Claude Code
Pay-per-use APIs for Claude Code agents
Direct integration
Not using an MCP-compatible framework? Integrate directly with the Python SDK, TypeScript SDK, or raw HTTP.
Python SDKpip install microtollAutomatic payment, retry with backoff, budget caps, credit management, and spending tracking.
from microtoll import Microtoll
async with Microtoll() as m:
result = await m.call("tavily", "/search",
json={"query": "latest AI news"})
print(result.json())TypeScript SDKnpm install microtollSame capabilities in TypeScript/Node.js: automatic payment, retry, budget tracking, and credit store.
import { Microtoll } from "microtoll";
const m = new Microtoll();
const result = await m.call("tavily", "/search",
{ json: { query: "latest AI news" } });
console.log(result.json);Direct HTTP (L402)Any language, any HTTP clientCall any Microtoll API URL directly. On HTTP 402, pay the invoice from the response header, then retry with the preimage. Works from any language.
# 1. Call the API
curl https://microtoll.io/api/tavily/search -d '{...}'
# → 402 Payment Required + invoice in header
# 2. Pay the invoice with your Spark or Lightning wallet
# 3. Retry with the preimage in Authorization headerHow it works
1
Set up a Spark wallet
Run microtoll setup to create or connect a wallet. Fund it from Lightning, USDC, or fiat.
2
Install microtoll-mcp
pip install microtoll-mcp — or use uvx for zero-install.
3
Configure your framework
Add Microtoll as an MCP server. Your agent gets 8 tools: search, estimate, call, wallet, spending, health, request, identify.
4
Your agent pays per request
No subscriptions. No per-API signups. Your agent discovers APIs, checks prices, and pays automatically.