Skip to main content

VERITY

VERITY es un agente de IA autónomo construido sobre l402-kit. Vende 10 servicios mediante el protocolo L402, acumula un tesoro de Bitcoin y ajusta sus propios precios en función de la demanda — sin intervención humana. Endpoint de descubrimiento: GET https://l402kit.com/api/verity

Los 10 Servicios

ServicioEndpointPrecioRequiere
Búsqueda Web/api/verity/search100 sats
Web Scraping/api/verity/scrape200 sats
Precio BTC/api/verity/btc-price10 sats
Resumir/api/verity/summarize50 sats
Sentimiento/api/verity/sentiment30 sats
Inteligencia de Dominio/api/verity/domain-intel500 sats
Integración l402-kit/api/verity/integration10,000 sats
Estado del Mundo/api/verity/worldstate80 sats
Traducir/api/verity/translate50 sats
Investigación/api/verity/research300 sats
Los precios son dinámicos — VERITY los ajusta cada 30 minutos en función de la demanda.

Cómo Pagar

Cada servicio sigue el estándar L402:
# Paso 1 — solicitar el servicio (obtener factura)
curl -i https://l402kit.com/api/verity/btc-price

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

# Paso 2 — pagar la factura con cualquier billetera Lightning
# Paso 3 — reintentar con la prueba
curl -H "Authorization: L402 <macaroon>:<preimage>" \
  https://l402kit.com/api/verity/btc-price

Pago automatizado 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 },
});

// Precio 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);

// Estado del mundo — 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);

Referencia de Servicios

Búsqueda — 100 sats

Búsqueda web que devuelve los 10 primeros resultados orgánicos.
# 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
Respuesta:
{
  "agent": "VERITY",
  "service": "search",
  "query": "bitcoin lightning",
  "results": [
    { "title": "...", "link": "...", "snippet": "..." }
  ],
  "paid_with": "⚡ Lightning L402"
}

Web Scraping — 200 sats

Devuelve el contenido completo de la página en 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

Precio BTC — 10 sats

Precio de Bitcoin en tiempo real en USD, EUR y BRL.
curl -H "Authorization: L402 <token>" \
  https://l402kit.com/api/verity/btc-price
Respuesta:
{
  "bitcoin": { "usd": 98000, "eur": 90000, "brl": 550000 },
  "timestamp": "2026-05-10T12:00:00.000Z"
}

Resumir — 50 sats

Resumen mediante IA de hasta 50,000 caracteres.
curl -X POST -H "Authorization: L402 <token>" \
  -H "Content-Type: application/json" \
  -d '{"text":"...long text...", "language":"portuguese"}' \
  https://l402kit.com/api/verity/summarize

Sentimiento — 30 sats

Análisis de sentimiento con puntuación, confianza y palabras clave.
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
Respuesta:
{
  "analysis": {
    "sentiment": "positive",
    "score": 0.92,
    "confidence": 0.88,
    "keywords": ["bitcoin", "future", "money"]
  }
}

Inteligencia de Dominio — 500 sats

WHOIS, registros DNS y certificados SSL. Sin clave de API — usa RDAP público y crt.sh.
curl -H "Authorization: L402 <token>" \
  "https://l402kit.com/api/verity/domain-intel?domain=example.com"
Respuesta:
{
  "domain": "example.com",
  "whois": { "registrar": "...", "registered": "...", "expires": "..." },
  "dns": { "a_records": ["93.184.216.34"] },
  "certificates": [{ "issued": "...", "expires": "...", "issuer": "..." }]
}

Integración l402-kit — 10,000 sats

Envía la URL de un repositorio público de GitHub. VERITY analiza el código fuente y devuelve el código de integración completo para 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
Respuesta:
{
  "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"]
}

Estado del Mundo — 80 sats

Hora UTC + geolocalización del solicitante + clima local en una sola llamada. Sin costo por APIs externas.
curl -H "Authorization: L402 <token>" \
  https://l402kit.com/api/verity/worldstate
Respuesta:
{
  "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"
  }
}

Investigación — 300 sats

Paquete de investigación profunda: búsqueda + scraping + resumen con IA en una sola llamada. Ahorra 3 pagos separados y 3 veces la latencia de ida y vuelta.
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
Respuesta:
{
  "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. llamar a los servicios por separado: Búsqueda (100 sats) + Scraping (200 sats) + Resumir (50 sats) = 350 sats en total. Investigación cuesta 300 sats — más barato y con un solo pago.

Traducir — 50 sats

Traduce texto o documentación MDX a cualquiera de los 11 idiomas soportados. Cuando format es mdx, los bloques de código, componentes MDX, URLs y términos técnicos se preservan exactamente — solo se traduce el texto. Locales soportados: 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 bloques de código y componentes):
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
Respuesta:
{
  "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"
}
Entrada máxima: 100,000 caracteres por llamada.

Precios Dinámicos

VERITY ajusta los precios cada 30 minutos:
Alta demanda (> umbral de llamadas/hora) → precio × 1.1
Demanda cero (2 horas consecutivas)      → precio × 0.9
Protección de mínimo                     → el precio nunca baja del mínimo
Consulta los precios actuales en cualquier momento:
curl https://l402kit.com/api/verity | jq '.services[].priceSats'


Endpoints Públicos de Descubrimiento

Estos dos endpoints no requieren pago L402 — exponen el catálogo y las finanzas de VERITY para auditoría y descubrimiento.

GET /api/verity/services

Catálogo legible por máquina de todos los servicios activos con precios en tiempo real, pisos y umbrales de 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

Informe fiscal diario de VERITY — ingresos, costos, margen y desglose por servicio. Generado a las 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"
}
Los informes se almacenan durante 7 días. Devuelve 404 si el informe del día aún no ha sido generado.

API de Operador

Si bifurcas VERITY para ejecutar tu propio agente, estos endpoints te permiten cambiar precios y presupuestos en tiempo de ejecución — sin necesidad de desplegar. Todas las rutas de administración requieren el encabezado DASHBOARD_SECRET:
Authorization: Bearer <DASHBOARD_SECRET>

GET /api/verity/admin/config

Devuelve la configuración de precios actual y el gasto del consumidor para todos los servicios.
curl -H "Authorization: Bearer <secret>" \
  https://l402kit.com/api/verity/admin/config
Respuesta:
{
  "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

Actualiza los parámetros de precio para un servicio específico. Solo se modifican los campos proporcionados.
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
CampoDescripción
serviceNombre del servicio (obligatorio)
basePrecio base en sats
floorPrecio mínimo (el precio dinámico nunca baja de este valor)
surgeThresholdLlamadas/hora que activan un aumento del +10%
cogsCosto del bien en sats (usado por el agente fiscal)

POST /api/verity/admin/budget

Establece el límite de gasto diario del consumidor.
curl -X POST -H "Authorization: Bearer <secret>" \
  -H "Content-Type: application/json" \
  -d '{"sats": 5000}' \
  https://l402kit.com/api/verity/admin/budget
Mínimo: 100 sats. Los cambios tienen efecto inmediato.

Arquitectura

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 es de código abierto — la misma arquitectura puede bifurcarse para crear tu propio agente autónomo.