VERITY Examples
VERITY is a live autonomous agent at https://l402kit.com/api/verity. These examples show how to call all 10 services programmatically using the l402-kit agent SDK.
Setup
import { L402Client } from "l402-kit/agent";
import { BlinkWallet } from "l402-kit/wallets";
const client = new L402Client({
wallet: new BlinkWallet(process.env.BLINK_API_KEY!),
budget: { maxSats: 5000 }, // hard cap per session
});
Discover all services and current prices
// Machine-readable catalog — no payment required
const res = await fetch("https://l402kit.com/api/verity/services");
const { services } = await res.json();
for (const svc of services) {
console.log(`${svc.id}: ${svc.price_sats} sats (floor: ${svc.floor_sats})`);
}
Check daily fiscal report
// Public — no payment required
const res = await fetch("https://l402kit.com/api/verity/fiscal");
const report = await res.json();
console.log(`Revenue: ${report.revenue_sats} sats (~${report.usd_equivalent})`);
console.log(`Net: ${report.net_sats} sats (${report.margin_pct}% margin)`);
for (const [service, data] of Object.entries(report.breakdown)) {
console.log(` ${service}: ${data.calls} calls × ${data.price} sats = ${data.revenue} sats`);
}
World State — 80 sats
Get UTC time, your location, and local weather in one call.
const res = await client.fetch("https://l402kit.com/api/verity/worldstate");
const { time, location, weather } = await res.json();
console.log(`Time: ${time.utc}`);
console.log(`Location: ${location.city}, ${location.country}`);
console.log(`Weather: ${weather.temperature_c}°C, ${weather.condition}`);
BTC Price — 10 sats
const res = await client.fetch("https://l402kit.com/api/verity/btc-price");
const { bitcoin } = await res.json();
console.log(`BTC: $${bitcoin.usd} USD | R$${bitcoin.brl} BRL`);
Web Search — 100 sats
const res = await client.fetch(
"https://l402kit.com/api/verity/search?q=bitcoin+lightning+l402",
);
const { results } = await res.json();
for (const r of results) {
console.log(`${r.title}\n${r.link}\n${r.snippet}\n`);
}
Summarize — 50 sats
const longText = "..."; // up to 50,000 chars
const res = await client.fetch("https://l402kit.com/api/verity/summarize", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ text: longText, language: "english" }),
});
const { summary } = await res.json();
console.log(summary);
Sentiment — 30 sats
const res = await client.fetch("https://l402kit.com/api/verity/sentiment", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ text: "Lightning payments are instant and cheap!" }),
});
const { analysis } = await res.json();
// { sentiment: "positive", score: 0.94, confidence: 0.91, keywords: [...] }
Domain Intel — 500 sats
const res = await client.fetch(
"https://l402kit.com/api/verity/domain-intel?domain=bitcoin.org",
);
const { whois, dns, certificates } = await res.json();
console.log(`Registered: ${whois.registered}`);
console.log(`Expires: ${whois.expires}`);
console.log(`A records: ${dns.a_records.join(", ")}`);
Web Scraping — 200 sats
const res = await client.fetch("https://l402kit.com/api/verity/scrape", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ url: "https://bitcoin.org/en/bitcoin-paper" }),
});
const { content, title } = await res.json();
console.log(`${title}\n\n${content.slice(0, 500)}...`);
Translate — 50 sats
Translate any text to 11 locales. MDX-aware mode preserves code blocks, component tags, URLs, and L402 terminology.
// Plain text
const res = await client.fetch("https://l402kit.com/api/verity/translate", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
text: "Pay per call with Bitcoin Lightning. No API keys needed.",
locale: "pt",
}),
});
const { translated } = await res.json();
console.log(translated);
// "Pague por chamada com Bitcoin Lightning. Nenhuma chave de API necessária."
// MDX-aware (preserves code blocks, <Components />, URLs)
const mdxPage = `## Install\n\`\`\`bash\nnpm install l402-kit\n\`\`\`\nSee [docs](https://docs.l402kit.com).`;
const res = await client.fetch("https://l402kit.com/api/verity/translate", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ text: mdxPage, locale: "es", format: "mdx" }),
});
const { translated } = await res.json();
// Code block and URL preserved intact; only prose translated
Supported locales: pt es zh ar fr de ja ko hi ru it
l402-kit Integration — 10,000 sats
Send VERITY a public GitHub repo. She reads the code and returns a complete l402-kit integration.
const res = await client.fetch("https://l402kit.com/api/verity/integration", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ repoUrl: "https://github.com/owner/my-api" }),
});
const { integration, next_steps } = await res.json();
// integration = markdown with exact code to add to your repo
console.log(integration);
The integration service costs 10,000 sats (~$10). After payment, you receive complete middleware code specific to your framework (Express, FastAPI, Gin, Axum, etc.) — and VERITY earns the first referral to your new l402-kit-powered API.
Chaining services
A common agent pattern: search → scrape → summarize.
// 1. Search for a topic (100 sats)
const searchRes = await client.fetch(
"https://l402kit.com/api/verity/search?q=bitcoin+lightning+adoption+2026",
);
const { results } = await searchRes.json();
const topUrl = results[0].link;
// 2. Scrape the top result (200 sats)
const scrapeRes = await client.fetch("https://l402kit.com/api/verity/scrape", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ url: topUrl }),
});
const { content } = await scrapeRes.json();
// 3. Summarize the article (50 sats)
const sumRes = await client.fetch("https://l402kit.com/api/verity/summarize", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ text: content }),
});
const { summary } = await sumRes.json();
// Total cost: 350 sats (~$0.35)
console.log(summary);
Python
from l402kit import L402Client, BlinkWallet
import os
client = L402Client(
wallet=BlinkWallet(os.environ["BLINK_API_KEY"]),
budget={"max_sats": 5000},
)
# World state
resp = client.get("https://l402kit.com/api/verity/worldstate")
data = resp.json()
print(f"{data['time']['utc']} | {data['location']['city']} | {data['weather']['temperature_c']}°C")