Skip to main content

VERITY

VERITY è un agente AI autonomo costruito su l402-kit. Vende 10 servizi tramite il protocollo L402, accumula un treasury Bitcoin e adegua i propri prezzi in base alla domanda — senza intervento umano. Endpoint di discovery: GET https://l402kit.com/api/verity

I 10 Servizi

ServizioEndpointPrezzoRichiede
Ricerca Web/api/verity/search100 sats
Web Scraping/api/verity/scrape200 sats
Prezzo BTC/api/verity/btc-price10 sats
Riassumi/api/verity/summarize50 sats
Sentiment/api/verity/sentiment30 sats
Domain Intel/api/verity/domain-intel500 sats
Integrazione l402-kit/api/verity/integration10.000 sats
Stato del Mondo/api/verity/worldstate80 sats
Traduci/api/verity/translate50 sats
Ricerca Approfondita/api/verity/research300 sats
I prezzi sono dinamici — VERITY li aggiusta ogni 30 minuti in base alla domanda.

Come Pagare

Ogni servizio segue lo standard L402:
# Step 1 — richiedi il servizio (ottieni la fattura)
curl -i https://l402kit.com/api/verity/btc-price

# HTTP/1.1 402 Payment Required
# WWW-Authenticate: L402 macaroon="...", invoice="lnbc..."

# Step 2 — paga la fattura con qualsiasi wallet Lightning
# Step 3 — riprova con la prova di pagamento
curl -H "Authorization: L402 <macaroon>:<preimage>" \
  https://l402kit.com/api/verity/btc-price

Pagamento automatico con L402Client

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: 500 },
});

// Prezzo BTC — 10 sats
const price = await client.fetch("https://l402kit.com/api/verity/btc-price");
const data = await price.json();
console.log(data.bitcoin.usd);

// Stato del mondo — 80 sats
const world = await client.fetch("https://l402kit.com/api/verity/worldstate");
const state = await world.json();
console.log(state.time.utc, state.location.city, state.weather.temperature_c);

Riferimento ai Servizi

Ricerca — 100 sats

Ricerca web che restituisce i primi 10 risultati organici.
# GET
curl -H "Authorization: L402 <token>" \
  "https://l402kit.com/api/verity/search?q=bitcoin+lightning"

# POST
curl -X POST -H "Authorization: L402 <token>" \
  -H "Content-Type: application/json" \
  -d '{"q":"bitcoin lightning"}' \
  https://l402kit.com/api/verity/search
Risposta:
{
  "agent": "VERITY",
  "service": "search",
  "query": "bitcoin lightning",
  "results": [
    { "title": "...", "link": "...", "snippet": "..." }
  ],
  "paid_with": "⚡ Lightning L402"
}

Web Scraping — 200 sats

Restituisce il contenuto completo della pagina in formato markdown.
curl -X POST -H "Authorization: L402 <token>" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com"}' \
  https://l402kit.com/api/verity/scrape

Prezzo BTC — 10 sats

Prezzo Bitcoin in tempo reale in USD, EUR e BRL.
curl -H "Authorization: L402 <token>" \
  https://l402kit.com/api/verity/btc-price
Risposta:
{
  "bitcoin": { "usd": 98000, "eur": 90000, "brl": 550000 },
  "timestamp": "2026-05-10T12:00:00.000Z"
}

Riassumi — 50 sats

Riassunto AI fino a 50.000 caratteri.
curl -X POST -H "Authorization: L402 <token>" \
  -H "Content-Type: application/json" \
  -d '{"text":"...testo lungo...", "language":"portuguese"}' \
  https://l402kit.com/api/verity/summarize

Sentiment — 30 sats

Analisi del sentiment con punteggio, confidenza e parole chiave.
curl -X POST -H "Authorization: L402 <token>" \
  -H "Content-Type: application/json" \
  -d '{"text":"Bitcoin is the future of money"}' \
  https://l402kit.com/api/verity/sentiment
Risposta:
{
  "analysis": {
    "sentiment": "positive",
    "score": 0.92,
    "confidence": 0.88,
    "keywords": ["bitcoin", "future", "money"]
  }
}

Domain Intel — 500 sats

WHOIS, record DNS e certificati SSL. Nessuna chiave API — utilizza RDAP pubblico e crt.sh.
curl -H "Authorization: L402 <token>" \
  "https://l402kit.com/api/verity/domain-intel?domain=example.com"
Risposta:
{
  "domain": "example.com",
  "whois": { "registrar": "...", "registered": "...", "expires": "..." },
  "dns": { "a_records": ["93.184.216.34"] },
  "certificates": [{ "issued": "...", "expires": "...", "issuer": "..." }]
}

Integrazione l402-kit — 10.000 sats

Invia l’URL di un repository GitHub pubblico. VERITY analizza il codice e restituisce il codice di integrazione completo per l402-kit.
curl -X POST -H "Authorization: L402 <token>" \
  -H "Content-Type: application/json" \
  -d '{"repoUrl":"https://github.com/owner/repo"}' \
  https://l402kit.com/api/verity/integration
Risposta:
{
  "repo": "owner/repo",
  "integration": "## Detected: Express.js\n\n```typescript\nimport { l402 } from 'l402-kit';\n...",
  "next_steps": ["Apply integration code", "Set env vars", "Deploy and test"]
}

Stato del Mondo — 80 sats

Orario UTC + geolocalizzazione del chiamante + meteo locale in un’unica chiamata. Nessun costo per API esterne.
curl -H "Authorization: L402 <token>" \
  https://l402kit.com/api/verity/worldstate
Risposta:
{
  "time": {
    "utc": "2026-05-10T14:32:00.000Z",
    "unix": 1778421120,
    "hour": 14, "minute": 32, "weekday": "Sun"
  },
  "location": {
    "city": "São Paulo", "country": "BR", "timezone": "America/Sao_Paulo"
  },
  "weather": {
    "temperature_c": 23.4,
    "feels_like_c": 22.1,
    "humidity_pct": 68,
    "condition": "partly cloudy"
  }
}

Ricerca Approfondita — 300 sats

Bundle di ricerca completa: ricerca + scraping + riassunto AI in un’unica chiamata. Risparmia 3 pagamenti separati e 3 volte la latenza di andata e ritorno.
curl -X POST -H "Authorization: L402 <token>" \
  -H "Content-Type: application/json" \
  -d '{"query": "bitcoin lightning network adoption 2026"}' \
  https://l402kit.com/api/verity/research
Risposta:
{
  "agent": "VERITY",
  "service": "research",
  "query": "bitcoin lightning network adoption 2026",
  "summary": "Lightning Network adoption has accelerated significantly in 2026...",
  "scraped_url": "https://example.com/article",
  "sources": [
    { "title": "...", "link": "...", "snippet": "..." }
  ],
  "provider": "serper",
  "paid_with": "⚡ Lightning L402"
}
vs. chiamare i servizi separatamente: Ricerca (100 sats) + Scraping (200 sats) + Riassumi (50 sats) = 350 sats totali. La Ricerca Approfondita costa 300 sats — più economica e con un solo pagamento.

Traduci — 50 sats

Traduce testo o documentazione MDX in una qualsiasi delle 11 lingue supportate. Quando format è mdx, i blocchi di codice, i componenti MDX, gli URL e i termini tecnici vengono preservati esattamente — viene tradotta solo la prosa. Lingue supportate: pt, es, zh, ar, hi, fr, de, ru, ja, it, en
curl -X POST -H "Authorization: L402 <token>" \
  -H "Content-Type: application/json" \
  -d '{"text": "Pay once, access forever.", "locale": "pt", "format": "plain"}' \
  https://l402kit.com/api/verity/translate
Formato MDX (preserva blocchi di codice e componenti):
curl -X POST -H "Authorization: L402 <token>" \
  -H "Content-Type: application/json" \
  -d '{"text": "---\ntitle: Quickstart\n---\n\nPay with Lightning.", "locale": "ja", "format": "mdx"}' \
  https://l402kit.com/api/verity/translate
Risposta:
{
  "agent": "VERITY",
  "service": "translate",
  "locale": "pt",
  "language": "Brazilian Portuguese",
  "format": "plain",
  "translated": "Pague uma vez, acesse para sempre.",
  "source_length": 26,
  "paid_with": "⚡ Lightning L402"
}
Input massimo: 100.000 caratteri per chiamata.

Prezzi Dinamici

VERITY adegua i prezzi ogni 30 minuti:
Alta domanda (> soglia chiamate/ora) → prezzo × 1.1
Domanda zero (2 ore consecutive)     → prezzo × 0.9
Protezione del minimo                → il prezzo non scende mai sotto il minimo
Controlla i prezzi correnti in qualsiasi momento:
curl https://l402kit.com/api/verity | jq '.services[].priceSats'


Endpoint di Scoperta Pubblici

Questi due endpoint non richiedono pagamento L402 — espongono il catalogo e le finanze di VERITY per auditing e discovery.

GET /api/verity/services

Catalogo machine-readable di tutti i servizi attivi con prezzi in tempo reale, floor e soglie di surge.
curl https://l402kit.com/api/verity/services
{
  "services": [
    {
      "id": "search",
      "endpoint": "https://l402kit.com/api/verity/search",
      "price_sats": 500,
      "floor_sats": 500,
      "cogs_sats": 50,
      "surge_threshold": 50
    }
  ],
  "count": 10,
  "updated": "2026-05-12T14:32:00.000Z"
}

GET /api/verity/fiscal

Report fiscale giornaliero di VERITY — entrate, costi, margine e breakdown per servizio. Generato alle 00:00 UTC.
curl https://l402kit.com/api/verity/fiscal
{
  "date": "2026-05-12",
  "agent": "VERITY",
  "revenue_sats": 8450,
  "consumer_spent_sats": 340,
  "net_sats": 8110,
  "margin_pct": "95.98",
  "usd_equivalent": "10.00",
  "btc_usd_rate": 95000,
  "breakdown": {
    "search": { "calls": 21, "price": 500, "revenue": 10500, "success_rate": 98 }
  },
  "generated_at": "2026-05-12T00:00:01.000Z"
}
I report vengono conservati per 7 giorni. Restituisce 404 se il report del giorno non è ancora stato generato.

API Operatore

Se esegui il fork di VERITY per avviare il tuo agente, questi endpoint ti consentono di modificare prezzi e budget a runtime — senza necessità di deploy. Tutte le route di amministrazione richiedono l’header DASHBOARD_SECRET:
Authorization: Bearer <DASHBOARD_SECRET>

GET /api/verity/admin/config

Restituisce la configurazione dei prezzi corrente e la spesa dei consumatori per tutti i servizi.
curl -H "Authorization: Bearer <secret>" \
  https://l402kit.com/api/verity/admin/config
Risposta:
{
  "configs": {
    "search":  { "base": 100, "floor": 50, "surgeThreshold": 50, "cogs": 2 },
    "translate": { "base": 50, "floor": 50, "surgeThreshold": 30, "cogs": 1 }
  },
  "prices": { "search": 100, "translate": 50 },
  "consumer": { "spent_today": 340, "budget": 10000 }
}

POST /api/verity/admin/config

Aggiorna i parametri di prezzo per un servizio specifico. Vengono modificati solo i campi forniti.
curl -X POST -H "Authorization: Bearer <secret>" \
  -H "Content-Type: application/json" \
  -d '{"service": "search", "base": 150, "floor": 80}' \
  https://l402kit.com/api/verity/admin/config
CampoDescrizione
serviceNome del servizio (obbligatorio)
basePrezzo base in sats
floorPrezzo minimo (il prezzo dinamico non scende mai sotto questo valore)
surgeThresholdChiamate/ora che innescano un aumento del +10%
cogsCosto del prodotto in sats (utilizzato dall’agente fiscale)

POST /api/verity/admin/budget

Imposta il limite di spesa giornaliero del consumatore.
curl -X POST -H "Authorization: Bearer <secret>" \
  -H "Content-Type: application/json" \
  -d '{"sats": 5000}' \
  https://l402kit.com/api/verity/admin/budget
Minimo: 100 sats. Le modifiche hanno effetto immediato.

Architettura

VERITY (agent:shinydapps.verity)
  ├── 10 L402-protected services
  ├── Treasury: shinydapps@blink.sv
  ├── Heartbeat: every 30min (price adjustment + Satring market scan)
  ├── Query cache: KV-backed, per-service TTL (5min–24h)
  ├── Fiscal Agent: daily report at 00:00 UTC → GET /api/verity/fiscal
  ├── Service catalog: machine-readable → GET /api/verity/services
  ├── Agent contract: GET /.well-known/agent.json → verity block
  └── LAW-N: behavioral events emitted per transaction
VERITY è open-source — la stessa architettura può essere usata come fork per creare il proprio agente autonomo.