2s
Pay-per-call AI agent APIs on Base via x402. Multiple tools across patents, law, AI, geo, weather, crypto, and more. Always growing.
README
2s.io SDK
Client SDK + MCP server for 2s.io ā a unified JSON REST API for AI agents, paid per call in USDC on Base via x402.
This repo ships SDKs for every major agent-development language plus an MCP server for any MCP-aware host:
| Language | Package | Install | Status |
|---|---|---|---|
| TypeScript / Node | @2sio/sdk |
npm install @2sio/sdk viem |
ā x402 + bearer |
| TypeScript / Node | @2sio/mcp |
npx @2sio/mcp |
ā MCP server, x402 + bearer |
| Python | 2sio |
pip install "2sio[x402]" |
ā x402 + bearer |
| Go | github.com/2s-io/sdk/packages/go |
go get github.com/2s-io/sdk/packages/go |
š§ bearer ready, x402 pending |
| Rust | twosio |
cargo add twosio |
š§ bearer ready, x402 pending |
No accounts. No API keys. No credit cards. Buyers sign an EIP-3009 USDC authorization on-the-fly, the Coinbase CDP facilitator verifies + settles in ~2 seconds on Base mainnet, and the API returns typed data. Prices start at $0.001/call.
30-second demo
TypeScript:
import { TwoS } from '@2sio/sdk'
import { privateKeyToAccount } from 'viem/accounts'
const client = new TwoS({ signer: privateKeyToAccount(process.env.EVM_PRIVATE_KEY as `0x${string}`) })
const { data } = await client.patents.search({ q: 'neural network', limit: 5 })
console.log(data.hits[0].title)
Python:
from eth_account import Account
from twosio import TwoS
client = TwoS(signer=Account.from_key(os.environ["EVM_PRIVATE_KEY"]))
r = client.patents.search(q="neural network", limit=5)
print(r.data["hits"][0]["title"])
30-second Claude Desktop install
{
"mcpServers": {
"2sio": {
"command": "npx",
"args": ["-y", "@2sio/mcp"],
"env": { "EVM_PRIVATE_KEY": "0x..." }
}
}
}
Restart Claude. The model can now call patents.search, law.sanctions-check, ai.summarize, geocode.address, crypto.address-validate, and 30+ other paid tools ā paying per call, no human in the loop.
What's behind the API
39 endpoints across:
- AI: webpage summarization, translation, typed extraction, image description, screenshots
- Patents: USPTO Open Data Portal search + full file-wrapper detail + document list
- Law: federal/state case search, citation verification, OFAC sanctions screening, Federal Register, opinions
- Geo / weather: forward + reverse geocoding, US weather by ZIP, NOAA tides, sunrise/sunset, climate stations, recent earthquakes, IP geolocation
- Internet: DNS lookup, RDAP whois, URL unfurl (Open Graph), URL ā clean Markdown
- Wikipedia / academic papers: summaries, multi-source paper search (arXiv + PubMed + Semantic Scholar)
- Crypto: multi-chain address validation (BTC, ETH, SOL, LTC, TRX, XRP, BCH), live EVM gas oracle
- Airports: lookup by IATA/ICAO, nearest-airport-to-coord (OurAirports CC0, ~85k airports)
- Utilities: hash computation, image compression, barcode/QR generation, countdown GIFs
- Census: US Census ACS 5-year demographics by ZCTA
- Account: balance + create (bearer mode)
Live catalog: https://2s.io/api/directory. OpenAPI 3.1: https://2s.io/api/openapi. Machine-discovery manifest: https://2s.io/.well-known/x402.
Safety
- The SDK refuses to sign payments above a configurable
maxPriceUsd(default$0.10). - Every x402 payment is a single-use EIP-3009 authorization with a 60-second deadline. No allowances are issued; a leaked key can only spend what's in the wallet at the moment of signing, only at advertised prices.
- Optional
onPaymentRequestedhook lets callers approve/deny each call programmatically.
Repo layout
packages/
āāā 2s-sdk/ @2sio/sdk ā typed client
āāā 2s-mcp/ @2sio/mcp ā MCP server (depends on 2s-sdk)
examples/sdk/ minimal paying-agent samples + Claude Desktop wiring
License
MIT. See LICENSE.
Links
- API site: https://2s.io
- npm:
- x402 protocol: https://x402.org
- MCP protocol: https://modelcontextprotocol.io
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.