> ## Documentation Index
> Fetch the complete documentation index at: https://shinydapps-bd9fa40b.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# VERITY

> Autonomer KI-Agent mit 10 L402-geschützten Diensten. Verdient sats, zahlt in sats.

# VERITY

VERITY ist ein autonomer KI-Agent, der auf l402-kit aufgebaut wurde. Sie verkauft 10 Dienste über das L402-Protokoll, akkumuliert eine Bitcoin-Treasury und passt ihre eigenen Preise basierend auf der Nachfrage an – ohne menschliches Eingreifen.

**Discovery-Endpunkt:** `GET https://l402kit.com/api/verity`

***

## Die 10 Dienste

| Dienst               | Endpunkt                   | Preis       | Erfordert |
| -------------------- | -------------------------- | ----------- | --------- |
| Websuche             | `/api/verity/search`       | 100 sats    | —         |
| Web-Scraping         | `/api/verity/scrape`       | 200 sats    | —         |
| BTC-Preis            | `/api/verity/btc-price`    | 10 sats     | —         |
| Zusammenfassung      | `/api/verity/summarize`    | 50 sats     | —         |
| Sentiment            | `/api/verity/sentiment`    | 30 sats     | —         |
| Domain-Intel         | `/api/verity/domain-intel` | 500 sats    | —         |
| l402-kit Integration | `/api/verity/integration`  | 10.000 sats | —         |
| Weltzustand          | `/api/verity/worldstate`   | 80 sats     | —         |
| Übersetzen           | `/api/verity/translate`    | 50 sats     | —         |
| Recherche            | `/api/verity/research`     | 300 sats    | —         |

Die Preise sind dynamisch – VERITY passt sie alle 30 Minuten basierend auf der Nachfrage an.

***

## Wie man bezahlt

Jeder Dienst folgt dem Standard-L402-Ablauf:

```bash theme={null}
# Schritt 1 — Dienst anfragen (Rechnung erhalten)
curl -i https://l402kit.com/api/verity/btc-price

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

# Schritt 2 — Rechnung mit einer beliebigen Lightning-Wallet bezahlen
# Schritt 3 — Erneut mit Nachweis versuchen
curl -H "Authorization: L402 <macaroon>:<preimage>" \
  https://l402kit.com/api/verity/btc-price
```

***

## Automatisierte Zahlung mit L402Client

```typescript theme={null}
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 },
});

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

// Weltzustand — 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);
```

***

## Dienstreferenz

### Suche — 100 sats

Websuche, die die Top-10-organischen Ergebnisse zurückgibt.

```bash theme={null}
# 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
```

**Antwort:**

```json theme={null}
{
  "agent": "VERITY",
  "service": "search",
  "query": "bitcoin lightning",
  "results": [
    { "title": "...", "link": "...", "snippet": "..." }
  ],
  "paid_with": "⚡ Lightning L402"
}
```

***

### Web-Scraping — 200 sats

Gibt den vollständigen Seiteninhalt als Markdown zurück.

```bash theme={null}
curl -X POST -H "Authorization: L402 <token>" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com"}' \
  https://l402kit.com/api/verity/scrape
```

***

### BTC-Preis — 10 sats

Echtzeit-Bitcoin-Preis in USD, EUR und BRL.

```bash theme={null}
curl -H "Authorization: L402 <token>" \
  https://l402kit.com/api/verity/btc-price
```

**Antwort:**

```json theme={null}
{
  "bitcoin": { "usd": 98000, "eur": 90000, "brl": 550000 },
  "timestamp": "2026-05-10T12:00:00.000Z"
}
```

***

### Zusammenfassung — 50 sats

KI-Zusammenfassung von bis zu 50.000 Zeichen.

```bash theme={null}
curl -X POST -H "Authorization: L402 <token>" \
  -H "Content-Type: application/json" \
  -d '{"text":"...long text...", "language":"portuguese"}' \
  https://l402kit.com/api/verity/summarize
```

***

### Sentiment — 30 sats

Sentiment-Analyse mit Score, Konfidenz und Schlüsselwörtern.

```bash theme={null}
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
```

**Antwort:**

```json theme={null}
{
  "analysis": {
    "sentiment": "positive",
    "score": 0.92,
    "confidence": 0.88,
    "keywords": ["bitcoin", "future", "money"]
  }
}
```

***

### Domain-Intel — 500 sats

WHOIS, DNS-Einträge und SSL-Zertifikate. Kein API-Schlüssel erforderlich – verwendet öffentliche RDAP- und crt.sh-Dienste.

```bash theme={null}
curl -H "Authorization: L402 <token>" \
  "https://l402kit.com/api/verity/domain-intel?domain=example.com"
```

**Antwort:**

```json theme={null}
{
  "domain": "example.com",
  "whois": { "registrar": "...", "registered": "...", "expires": "..." },
  "dns": { "a_records": ["93.184.216.34"] },
  "certificates": [{ "issued": "...", "expires": "...", "issuer": "..." }]
}
```

***

### l402-kit Integration — 10.000 sats

Senden Sie eine öffentliche GitHub-Repository-URL. VERITY analysiert die Codebasis und gibt vollständigen l402-kit-Integrationscode zurück.

```bash theme={null}
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
```

**Antwort:**

````json theme={null}
{
  "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"]
}
````

***

### Weltzustand — 80 sats

UTC-Zeit + Geolokalisierung des Anrufers + lokales Wetter in einem einzigen Aufruf. Keine externen API-Kosten.

```bash theme={null}
curl -H "Authorization: L402 <token>" \
  https://l402kit.com/api/verity/worldstate
```

**Antwort:**

```json theme={null}
{
  "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"
  }
}
```

***

### Recherche — 300 sats

Umfassendes Recherche-Paket: Suche + Scraping + KI-Zusammenfassung in einem einzigen Aufruf. Spart 3 separate Zahlungen und die dreifache Roundtrip-Latenz.

```bash theme={null}
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
```

**Antwort:**

```json theme={null}
{
  "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"
}
```

**Im Vergleich zum separaten Aufruf der Dienste:** Suche (100 sats) + Scraping (200 sats) + Zusammenfassung (50 sats) = 350 sats gesamt. Recherche kostet 300 sats – günstiger und nur eine Zahlung.

***

### Übersetzen — 50 sats

Übersetzt Text oder MDX-Dokumentation in eine von 11 unterstützten Sprachen. Wenn `format` auf `mdx` gesetzt ist, werden Codeblöcke, MDX-Komponenten, URLs und Fachbegriffe exakt beibehalten – nur Fließtext wird übersetzt.

**Unterstützte Sprachcodes:** `pt`, `es`, `zh`, `ar`, `hi`, `fr`, `de`, `ru`, `ja`, `it`, `en`

```bash theme={null}
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
```

**MDX-Format** (bewahrt Codeblöcke und Komponenten):

```bash theme={null}
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
```

**Antwort:**

```json theme={null}
{
  "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"
}
```

Maximale Eingabe: 100.000 Zeichen pro Aufruf.

***

## Dynamische Preisgestaltung

VERITY passt die Preise alle 30 Minuten an:

```
Hohe Nachfrage (> Schwellenwert Aufrufe/Stunde) → Preis × 1,1
Keine Nachfrage (2 aufeinanderfolgende Stunden)  → Preis × 0,9
Mindestpreisschutz                               → Preis niemals unter Minimum
```

Aktuelle Preise jederzeit abrufen:

```bash theme={null}
curl https://l402kit.com/api/verity | jq '.services[].priceSats'
```

***

***

## Öffentliche Discovery-Endpunkte

Diese zwei Endpunkte erfordern keine L402-Zahlung — sie legen VERITYs Katalog und Finanzen für Prüfung und Erkennung offen.

### GET /api/verity/services

Machine-lesbarer Katalog aller aktiven Dienste mit Live-Preisen, Mindestpreisen und Surge-Schwellenwerten.

```bash theme={null}
curl https://l402kit.com/api/verity/services
```

```json theme={null}
{
  "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

VERITYs täglicher Finanzbericht — Einnahmen, Kosten, Marge und Aufschlüsselung pro Dienst. Täglich um 00:00 UTC generiert.

```bash theme={null}
curl https://l402kit.com/api/verity/fiscal
```

```json theme={null}
{
  "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"
}
```

Berichte werden 7 Tage gespeichert. Gibt 404 zurück, wenn der Tagesbericht noch nicht generiert wurde.

## Betreiber-API

Wenn Sie VERITY forken, um Ihren eigenen Agenten zu betreiben, ermöglichen diese Endpunkte das Ändern von Preisen und Budgets zur Laufzeit – kein Deployment erforderlich.

Alle Admin-Routen erfordern den `DASHBOARD_SECRET`-Header:

```
Authorization: Bearer <DASHBOARD_SECRET>
```

### GET /api/verity/admin/config

Gibt die aktuelle Preiskonfiguration und die Verbraucherausgaben für alle Dienste zurück.

```bash theme={null}
curl -H "Authorization: Bearer <secret>" \
  https://l402kit.com/api/verity/admin/config
```

**Antwort:**

```json theme={null}
{
  "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

Aktualisiert Preisparameter für einen bestimmten Dienst. Nur angegebene Felder werden geändert.

```bash theme={null}
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
```

| Feld             | Beschreibung                                                        |
| ---------------- | ------------------------------------------------------------------- |
| `service`        | Dienstname (erforderlich)                                           |
| `base`           | Basispreis in sats                                                  |
| `floor`          | Mindestpreis (dynamische Preisgestaltung unterschreitet diesen nie) |
| `surgeThreshold` | Aufrufe/Stunde, die einen +10%-Anstieg auslösen                     |
| `cogs`           | Warenkosten in sats (verwendet vom Fiscal Agent)                    |

### POST /api/verity/admin/budget

Legt das tägliche Ausgabenlimit des Verbrauchers fest.

```bash theme={null}
curl -X POST -H "Authorization: Bearer <secret>" \
  -H "Content-Type: application/json" \
  -d '{"sats": 5000}' \
  https://l402kit.com/api/verity/admin/budget
```

Minimum: 100 sats. Änderungen treten sofort in Kraft.

***

## Architektur

```
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 ist Open-Source – dieselbe Architektur kann geforkt werden, um Ihren eigenen autonomen Agenten zu erstellen.
