Sponsored by Deepsite.site

Aifinpay

Created By
AiFinPaya month ago
Stripe for AI agents. Pay any HTTP API in stablecoins or native tokens on Polygon and Solana mainnet with one MCP call. Non-custodial, on-chain settlement, atomic 99/1 partner split. Five tools: payable_fetch, agent_address, agent_quote, pay_with_split, quote_split.
Overview

AiFinPay — Payment Rail for AI Agents

npm @aifinpay/agent npm @aifinpay/mcp PyPI aifinpay-agent License: MIT Site MCP

Stripe for autonomous AI agents. One line of code — agent.pay(url) — and your agent settles a real on-chain payment on Polygon or Solana mainnet, then receives the gated response. Non-custodial. Live since 2026. Polygon facilitator compatible.

# Python
pip install aifinpay-agent --pre

# Node / TypeScript
npm install @aifinpay/agent@alpha

# MCP server (Claude Desktop, Cursor, Windsurf, Continue)
npx @aifinpay/mcp

One-click MCP for Claude Desktop / Cursor

Drop this block into your client config — claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/claude_desktop_config.json) or Cursor's ~/.cursor/mcp.json:

{
  "mcpServers": {
    "aifinpay": {
      "command": "npx",
      "args": ["@aifinpay/mcp"]
    }
  }
}

Restart the client. Your model now has five payment tools (payable_fetch, agent_address, agent_quote, pay_with_split, quote_split) and can autonomously settle any x402-gated API.

Full client matrix (Claude Desktop, Cursor, Windsurf, Continue, LobeChat, Cline) lives in MCP_CONFIG.md.

Packages

PackagePathInstallLatest
aifinpay-agent (Python)./pythonpip install aifinpay-agent --pre0.2.0a2 (alpha)
@aifinpay/agent (Node / TypeScript)./nodenpm install @aifinpay/agent@alpha0.3.0-alpha.0 (alpha)
@aifinpay/mcp (MCP server)./mcpnpx @aifinpay/mcp0.1.0-alpha.2 (alpha)
Go SDKgo get github.com/AiFinPay/sdk/gosoon
Rust SDKcargo add aifinpay-sdksoon

What this is

agent.pay(url) — one line of Python or TypeScript that pays any x402-protected URL on behalf of an autonomous AI agent. The SDK auto-detects the facilitator flavor (AiFinPay native, Coinbase x402, …), signs an Ed25519 challenge, retries the request, and returns the response.

Same agent, drop into Claude Desktop's MCP config and the LLM gets five tools (payable_fetch, agent_address, agent_quote, pay_with_split, quote_split) for autonomous payment loops.

Quick start

Python

from aifinpay import Agent
agent = Agent.new()
print("Fund this address with MATIC:", agent.address)
print("Save this secret:", agent.secret_b58)

# Pay any x402-protected URL
resp = agent.pay("https://api.example.com/v1/data")

# Direct fee-on-top split — merchant gets 100% of merchant_amount;
# AiFinPay 1% on top.
invoice = agent.pay_with_split_invoice(
    chain="polygon",
    merchant_wallet="0xMerchant...",
    merchant_amount=10**18,
    order_id="search-1",
)

Node.js / TypeScript

import { Agent } from "@aifinpay/agent";

const agent = Agent.new();
console.log("Fund this address:", agent.address);

const res = await agent.pay("https://api.example.com/v1/data");

const invoice = await agent.payWithSplitInvoice({
  chain: "polygon",
  merchantWallet: "0xMerchant...",
  merchantAmount: 10n ** 18n,
  orderId: "search-1",
});

MCP (Claude Desktop)

{
  "mcpServers": {
    "aifinpay": {
      "command": "npx",
      "args": ["@aifinpay/mcp"],
      "env": {
        "AIFINPAY_AGENT_SECRET": "<base58 secret>",
        "AIFINPAY_MAX_USD": "0.50"
      }
    }
  }
}

Restart Claude Desktop. The model now has five payment tools — payable_fetch(url) lets it autonomously call any x402-gated API.

How it works

sequenceDiagram
    Agent->>Server: GET /api/...
    Server-->>Agent: 402 + manifest + nonce
    Agent->>Agent: sign SHA256("AiFinPay-x402:{nonce}:{pubkey}")
    Agent->>Server: GET /api/... + 3 auth headers
    Server-->>Agent: 200 + payload

For a partner who wants to accept AiFinPay payments, the simplest integration is a single HTTP call to aifinpay.company/api/seat/<pubkey> inside their existing API — no wallet, no chain library, no KYC. See examples/echo-x402-server for a working ~70-line reference.

For full autonomy via fee-on-top atomic split (merchant gets 100% of their quoted price, agent pays the fee on top), agents call b2bPayWithSplit() on the AiFinPaySplitter Polygon contract: 0xE34Fc0E6694821c600Fa0955C0F74720ea6d8440 — owned by Gnosis Safe 0xD31d82c4b35DABaA2ad7023C89A78A052D1f3c8e (4-of-N).

Live contract addresses

All verified on Polygonscan.

Polygon (mainnet)
AiFinPayCore0x8Ad9830D…f4BAD
AgentPassport0x66fFe91e…2185
MSECCOToken0x83936231…182B
AiFinPaySplitter0xE34Fc0E6…8440
Gnosis Safe (multisig owner)0xD31d82c4…3c8e

Solana program (Anchor): 5g9zWHF1Vv6GiGpA2ZbJQbSCDZd5hAk9AyvabRJvKFx2.

Framework integrations

Drop-in adapters for popular agent frameworks live under ./examples/. Each is a working, paste-and-run example.

FrameworkExampleWhat it shows
OpenAI Agents SDKexamples/openai-agentTool-style integration: GPT-4 calls a tool that pays an x402 endpoint and returns the response
Claude (MCP)examples/claude-mcpZero-code: just install the MCP server, talk to Claude
LangChainexamples/langchainBaseTool wrapping agent.pay()
CrewAIexamples/crewaiA research crew that buys inference and search calls as it works
Flowiseexamples/flowiseCustom node JSON + import instructions
AutoGPT / AutoGenexamples/autogptHeadless agent loop that funds itself once, then runs unattended
Reference partner serverexamples/echo-x402-server~70-line Node server that accepts AiFinPay payments
Live bridgesexamples/io-net-x402-bridge, exa-x402-bridge, venice-x402-bridgeProduction bridges in front of io.net / Exa / Venice

Verified mainnet payments

Two on-chain proofs that the full stack works end-to-end:

ProviderAssetWhat was boughtTx
Exa SearchPOLFirst SDK call via Exa0xeb13c5ed…59c8700
io.netPOLLlama-3.3-70B inference, $0.0250x7c6ca0ff…129f0a

Repo layout

sdk/
├── python/                  aifinpay-agent (PyPI)
├── node/                    @aifinpay/agent (npm)
├── mcp/                     @aifinpay/mcp (npm)
├── docs/                    QUICKSTART.md, MCP_CONFIG.md, integrations
└── examples/
    ├── openai-agent/        OpenAI Agents SDK tool
    ├── claude-mcp/          Claude Desktop MCP config + walkthrough
    ├── langchain/           LangChain BaseTool wrapper
    ├── crewai/              CrewAI multi-agent crew that pays
    ├── flowise/             Flowise custom node
    ├── autogpt/             Headless self-funding agent loop
    ├── echo-x402-server/    reference partner integration (~70 lines)
    ├── io-net-x402-bridge/  live io.net bridge
    ├── exa-x402-bridge/     live Exa bridge
    └── venice-x402-bridge/  live Venice bridge

Releasing

Each package version-bumps independently. Both registries get prerelease tags so production users only see stable when explicitly opt-in.

# Python
cd python
python -m build
python -m twine upload --repository pypi dist/*

# Node
cd ../node
npm run build
npm publish --tag alpha

# MCP
cd ../mcp
npm install                 # so it can resolve @aifinpay/agent
npm run build
npm publish --tag alpha

Contributing

Issues and PRs welcome. For protocol-level changes, please open an issue first to discuss.

License

MIT — see LICENSE.

Server Config

{
  "mcpServers": {
    "aifinpay": {
      "command": "npx",
      "args": [
        "@aifinpay/mcp"
      ],
      "env": {
        "AIFINPAY_MAX_USD": "0.10",
        "AIFINPAY_CHAIN": "auto"
      }
    }
  }
}
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
ChatWiseThe second fastest AI chatbot™
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Amap Maps高德地图官方 MCP Server
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
WindsurfThe new purpose-built IDE to harness magic
DeepChatYour AI Partner on Desktop
Y GuiA web-based graphical interface for AI chat interactions with support for multiple AI models and MCP (Model Context Protocol) servers.
CursorThe AI Code Editor
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Tavily Mcp
Playwright McpPlaywright MCP server
Serper MCP ServerA Serper MCP Server
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
RedisA Model Context Protocol server that provides access to Redis databases. This server enables LLMs to interact with Redis key-value stores through a set of standardized tools.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。