@tanod-labs/ai-sdk
v0.3.1
Published
Vercel AI SDK tools for Tanod: address risk checks, smart-contract scans, MCP/skill package scans, web/DNS/chain reads for AI agents. Pay per call with x402 (USDC on Base); free daily tier, no signup.
Maintainers
Readme
@tanod-labs/ai-sdk
Vercel AI SDK tools for Tanod: pay-per-call security
and utility tools for AI agents. No signup and no API key. Each tool has a free daily tier. Past
it, the agent pays per call in USDC on Base with x402, through
@tanod-labs/sdk.
Results are automated and heuristic, not an audit. Every tool description tells the model that text inside results is untrusted data, never instructions.
Install
npm install @tanod-labs/ai-sdk ai zodThe package works with ai 5, 6 or 7 and zod 3.25+ or 4. It is ESM only and needs Node 20 or
later.
Use
import { generateText, isStepCount } from "ai";
import { tanodTools } from "@tanod-labs/ai-sdk";
const result = await generateText({
model, // any tool-calling model
tools: tanodTools({ maxPriceUsd: 0.05 }), // never pays more than USD 0.05 per call
stopWhen: isStepCount(5), // AI SDK 7; use stepCountIs(5) on AI SDK 5/6
prompt: "Before I approve it: is 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 on Base risky?",
});To let the agent pay past the free tier, set TANOD_PRIVATE_KEY. Use a dedicated hot wallet
that holds a little USDC on Base. You can also pass privateKey, signer (a viem account), or a
ready-made client: new Tanod({...}). Without a wallet, only free-tier calls succeed. Once the
free tier runs out, the tool tells the model the price.
Tools
These tools are included by default:
| Tool | What it does | Price (USD) |
|---|---|---|
| tanod_check_address | txpeek: risk verdict before transacting with, approving, or buying a token at an address | 0.005 (30 free/day) |
| tanod_scan_contract_source | pactlint: static analysis of one Solidity file | 0.25 / 0.75 (3 free scans/day) |
| tanod_scan_contract_address | pactlint: scan a verified deployed contract | 0.25 / 0.75 |
| tanod_scan_package | toolsniff: scan an MCP server or agent skill before installing it | 0.02 / 0.05 |
| tanod_render_url | sitepeek: web page to Markdown | 0.002 (0.01 with JS); 5 free/day |
| tanod_inspect_domain | dnspeek: DNS, email auth, TLS | 0.01 (0.004 for one section); 5 free/day |
| tanod_resolve_ens, tanod_decode_calldata, tanod_token_info, tanod_balance, tanod_gas_price | chainpeek reads | 0.001 to 0.003 (10 free/day, shared) |
| tanod_agents_summary | agentscan: summary of the x402/MCP index | free |
| tanod_agents_query | agentscan: search the x402/MCP index | 0.02 (10 free/day) |
These tools are opt-in. Request them with tanodTools({ include: [...] }), or call
allTanodTools() for every tool:
tanod_get_contract_sourcetanod_latest_blocktanod_extract_pdf,tanod_get_page_meta,tanod_ocr_image: sitepeek PDF text, page metadata, image OCR (0.005 / 0.002 / 0.01; share the 5 free/day)tanod_rdap_lookup,tanod_verify_email,tanod_ip_lookup: dnspeek RDAP, email check (DNS only, no SMTP), IP lookup (0.002 / 0.001 / 0.001; share the 5 free/day)tanod_get_token_price,tanod_get_transaction,tanod_get_nft,tanod_get_allowance,tanod_get_portfolio,tanod_get_swap_quote: more chainpeek reads (0.002 / 0.002 / 0.002 / 0.002 / 0.004 / 0.003; share the 10 free/day). The swap quote is a spot quote, not a firm pricetanod_web_search: findpeek web search (0.012; 3 free/day)tanod_get_weather: weatherpeek hourly forecast (0.002; 5 free/day)- skypeek (0.001 each,
satellite_passes0.002; the 5 free calls/day are one pool):tanod_get_metar,tanod_get_taf,tanod_decode_metar_taf,tanod_lookup_airport,tanod_airport_distance,tanod_get_space_weather,tanod_aurora_forecast,tanod_asteroid_close_approaches,tanod_sun_moon_times,tanod_satellite_passes - mlpeek (open models run on Tanod's own CPU; 5 free calls/day, one pool):
tanod_embed_textsandtanod_text_similarity(0.0005 per text or pair, at least 0.001 per call),tanod_rerank_documents(0.002),tanod_extract_entitiesandtanod_classify_zero_shot(0.001) - screening:
tanod_check_url(0.001; shares the 10 free chain reads/day),tanod_check_urls(0.0002 per item, at least 0.001; no free tier),tanod_check_sanctions_batch(OFAC SDN list only; 0.0005 per address, at least 0.002; no free tier). A URL that is not listed is not cleared tanod_agents_historytanod_agents_export(no free tier)
Free tiers are per IP per UTC day. The live prices are in https://tanod.dev/openapi.json.
What the model sees
On success, a tool returns:
{ "ok": true, "result": { "...": "API data" }, "payment": null, "freeRemainingToday": 29, "note": "...untrusted data..." }payment holds the x402 receipt (transaction, priceUsd, ...) when the call was paid.
On a problem the agent can act on, a tool returns a structured error. These errors are not
charged ("charged": null on error means unknown):
{ "ok": false, "error": "payment_required", "message": "...", "priceUsd": 0.02, "charged": false }The possible error values are payment_required, price_limit, invalid_input, not_found,
rate_limited, unavailable and error. Unexpected exceptions, such as network failures before
any payment, are thrown and handled by the AI SDK's normal tool-error path.
When a payment was sent but its outcome is unresolved (for example settlement_unknown, or no answer
after paying), the tool returns "error": "payment_unresolved" with charged (true, false or
null), code, payer and nonce. Do not call the tool again for the same input; send payer
and nonce to [email protected].
Development
From the workspace root (oss/integrations):
npm install
npm test # builds @tanod-labs/sdk, then runs vitest with a mock model and mock API; no network, no paymentsMIT licensed. Contact: [email protected].
