Entwicklerdokumentation
Integrieren Sie VEREEFY in Ihren KI-Stack und erfassen Sie jede Interaktion automatisch — DSGVO-konform, manipulationssicher, EU AI Act-ready.
Quick Start
In 4 Schritten von 0 auf laufende Compliance-Erfassung — dauert ca. 15 Minuten.
1. API-Key anfordern
Melden Sie sich im Dashboard an → Admin → API-Keys → Neuen Key erstellen. Der Key beginnt mit vfy_live_.
2. Ersten Call testen
curl -X POST https://api.vereefy.ai/v1/interactions \
-H "X-API-Key: vfy_live_IhrKey" \
-H "Content-Type: application/json" \
-d '{
"provider": "openai",
"model_name": "gpt-4o",
"purpose": "Kreditrisikoanalyse für Privatkunden",
"sector": "financial_services",
"input_hash": "a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3",
"output_hash": "b3a8e0e1f9ab1bfe3a36f231f676f78bb28a2d0acc01a89c7d85ec6b7d2888af",
"customer_facing": true,
"automation_level": "assisted",
"decision_impact": "high"
}'3. Antwort verstehen
{
"interaction_id": "550e8400-e29b-41d4-a716-446655440000",
"risk_class": "high",
"article_matches": ["Art. 6", "Art. 13", "Art. 17"],
"required_actions": [
"Technische Dokumentation gemäss Anhang IV erstellen (Art. 11).",
"Konformitätsbewertung durchführen (Art. 43)."
],
"required_disclosures": ["KI-Einsatz gegenüber Kunden offenlegen (Art. 13)."],
"confidence": "high",
"compliance_score": 42,
"audit_entry_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"chain_tip_hash": "sha256:d4f..."
}4. Dashboard prüfen
Die Interaktion erscheint sofort unter app.vereefy.ai/interactions. Risikoklasse, Artikel-Matches und Audit Trail sind bereits generiert.
Authentifizierung
VEREEFY unterstützt zwei Auth-Methoden — API-Key für Maschinen, JWT für Browser/Dashboard.
API-Key (empfohlen für Integrationen)
# Header X-API-Key: vfy_live_IhrKey # Beispiel curl https://api.vereefy.ai/v1/interactions \ -H "X-API-Key: vfy_live_abc123xyz"
JWT Bearer Token (Dashboard / Browser)
# 1. Token holen
curl -X POST https://api.vereefy.ai/auth/login \
-H "Content-Type: application/json" \
-d '{"email": "user@firma.ch", "password": "IhrPasswort"}'
# Antwort: { "access_token": "eyJ...", "refresh_token": "..." }
# 2. Token verwenden
curl https://api.vereefy.ai/v1/reports \
-H "Authorization: Bearer eyJ..."Sicherheitshinweis
API-Keys niemals im Frontend/Browser-Code oder in öffentlichen Repositories speichern. Nutzen Sie Umgebungsvariablen (VEREEFY_API_KEY).
Interaktionen
Eine Interaktion ist jeder KI-API-Call, den Sie erfassen möchten. VEREEFY klassifiziert automatisch und erstellt einen Audit-Trail-Eintrag.
POST /v1/interactions — Interaktion erfassen
| Parameter | Typ | Pflicht | Beschreibung |
|---|---|---|---|
| provider | string | ✅ | KI-Anbieter: openai | anthropic | google | custom |
| model_name | string | ✅ | Modellname, z.B. gpt-4o, claude-3-5-sonnet |
| purpose | string | ✅ | Freitext-Beschreibung des Anwendungszwecks |
| sector | string | ✅ | Sektor (siehe Sektoren-Liste unten) |
| input_hash | string | ✅ | SHA-256-Hash des Inputs (64 Hex-Zeichen) |
| output_hash | string | ✅ | SHA-256-Hash des Outputs (64 Hex-Zeichen) |
| customer_facing | boolean | — | Direkter Kundenkontakt? (default: false) |
| automation_level | string | — | none | assisted | partial | full |
| decision_impact | string | — | none | low | medium | high | critical |
| response_time_ms | integer | — | Antwortzeit in Millisekunden |
| external_ref | string | — | Ihre interne Referenz-ID |
Erlaubte Sektoren
financial_services | healthcare | hr_employment education | critical_infrastructure | law_enforcement migration | administration | other
GET /v1/interactions — Liste abrufen
curl "https://api.vereefy.ai/v1/interactions?limit=20&risk_class=high" \ -H "X-API-Key: vfy_live_IhrKey" # Query-Parameter: # limit integer max. 200 (default 50) # offset integer Pagination # risk_class string minimal | limited | high | unacceptable # sector string financial_services | healthcare | ... # date_from string ISO 8601: 2026-01-01T00:00:00Z # date_to string ISO 8601: 2026-12-31T23:59:59Z
Reports
Reports fassen alle Interaktionen eines Zeitraums zusammen und liefern auditierbare Compliance-Nachweise als JSON oder PDF.
POST /v1/reports — Report erstellen
curl -X POST https://api.vereefy.ai/v1/reports \
-H "Authorization: Bearer eyJ..." \
-H "Content-Type: application/json" \
-d '{
"report_type": "compliance_summary",
"format": "pdf",
"date_from": "2026-01-01T00:00:00Z",
"date_to": "2026-03-31T23:59:59Z"
}'
# report_type: compliance_summary | risk_analysis | audit_export | full_export
# format: json | pdfGET /v1/reports/{id}/export — Download
# JSON-Download
curl "https://api.vereefy.ai/v1/reports/{id}/export?format=json" \
-H "Authorization: Bearer eyJ..." \
-o report.json
# PDF-Download (für Auditoren)
curl "https://api.vereefy.ai/v1/reports/{id}/export?format=pdf" \
-H "Authorization: Bearer eyJ..." \
-o report.pdfAudit Chain
Jede Interaktion erzeugt automatisch einen Audit-Trail-Eintrag. Die Einträge sind kryptografisch verkettet — nachträgliche Änderungen werden sofort erkannt.
GET /v1/interactions/{id} — Detail mit Audit Trail
{
"interaction": { "id": "...", "risk_class": "high", ... },
"classification": { "article_matches": ["Art. 6"], ... },
"audit_trail": [
{
"event_type": "INTERACTION_CREATED",
"entry_hash": "sha256:a1b2c3...",
"prev_hash": "sha256:f9e8d7...",
"created_at": "2026-04-28T14:32:00Z"
}
],
"chain_tip": "sha256:a1b2c3..."
}Fehler & Rate Limits
HTTP-Statuscodes
| Code | Bedeutung | Massnahme |
|---|---|---|
| 200 / 201 | Erfolg | — |
| 400 | Ungültige Parameter | Fehlermeldung im detail-Feld prüfen |
| 401 | Nicht authentifiziert | API-Key oder Token prüfen |
| 403 | Keine Berechtigung | Scope des Keys prüfen |
| 404 | Nicht gefunden | ID prüfen |
| 409 | Konflikt | Status der Ressource prüfen (z.B. Report noch pending) |
| 422 | Validierungsfehler | Request-Body prüfen |
| 429 | Rate Limit erreicht | Exponentieller Retry, min. 60s warten |
| 500 | Serverfehler | Retry mit Backoff, support@vereefy.ai |
Rate Limits
| Endpunkt | Limit |
|---|---|
| POST /v1/interactions | 100 / Minute |
| GET /v1/interactions | 200 / Minute |
| POST /v1/reports | 20 / Minute |
| POST /auth/login | 10 / Minute (IP-basiert) |
SDKs & Beispiele
Python
import hashlib
import requests
VEREEFY_KEY = "vfy_live_IhrKey"
BASE_URL = "https://api.vereefy.ai"
def sha256(text: str) -> str:
return hashlib.sha256(text.encode()).hexdigest()
def log_interaction(prompt: str, response: str, **kwargs) -> dict:
"""Nach jedem KI-Call aufrufen."""
r = requests.post(
f"{BASE_URL}/v1/interactions",
headers={"X-API-Key": VEREEFY_KEY},
json={
"provider": kwargs.get("provider", "openai"),
"model_name": kwargs.get("model", "gpt-4o"),
"purpose": kwargs.get("purpose", "KI-Anwendung"),
"sector": kwargs.get("sector", "other"),
"input_hash": sha256(prompt),
"output_hash": sha256(response),
"customer_facing": kwargs.get("customer_facing", False),
"automation_level": kwargs.get("automation_level", "assisted"),
"decision_impact": kwargs.get("decision_impact", "low"),
},
timeout=5,
)
r.raise_for_status()
return r.json()
# Verwendung
import openai
prompt = "Analysiere das Kreditrisiko für Kunde 4711"
completion = openai.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": prompt}]
)
answer = completion.choices[0].message.content
result = log_interaction(
prompt, answer,
provider="openai",
model="gpt-4o",
purpose="Kreditrisikoanalyse",
sector="financial_services",
customer_facing=False,
automation_level="assisted",
decision_impact="high",
)
print(f"Risikoklasse: {result['risk_class']}")
print(f"Artikel: {result['article_matches']}")
print(f"Audit-ID: {result['audit_entry_id']}")Node.js / TypeScript
import crypto from "crypto";
const VEREEFY_KEY = process.env.VEREEFY_API_KEY!;
const BASE_URL = "https://api.vereefy.ai";
function sha256(text: string): string {
return crypto.createHash("sha256").update(text).digest("hex");
}
async function logInteraction(
prompt: string,
response: string,
opts: {
provider?: string;
model?: string;
purpose: string;
sector: string;
customerFacing?: boolean;
automationLevel?: string;
decisionImpact?: string;
}
) {
const res = await fetch(`${BASE_URL}/v1/interactions`, {
method: "POST",
headers: {
"X-API-Key": VEREEFY_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
provider: opts.provider ?? "openai",
model_name: opts.model ?? "gpt-4o",
purpose: opts.purpose,
sector: opts.sector,
input_hash: sha256(prompt),
output_hash: sha256(response),
customer_facing: opts.customerFacing ?? false,
automation_level: opts.automationLevel ?? "assisted",
decision_impact: opts.decisionImpact ?? "low",
}),
});
if (!res.ok) throw new Error(`VEREEFY Error: ${res.status}`);
return res.json();
}
// Verwendung mit OpenAI SDK
import OpenAI from "openai";
const openai = new OpenAI();
const prompt = "Erstelle eine Risikoeinschätzung für Portfolio X";
const completion = await openai.chat.completions.create({
model: "gpt-4o",
messages: [{ role: "user", content: prompt }],
});
const answer = completion.choices[0].message.content!;
const result = await logInteraction(prompt, answer, {
purpose: "Portfolio-Risikoanalyse",
sector: "financial_services",
decisionImpact: "high",
});
console.log("Risikoklasse:", result.risk_class);Middleware-Pattern (empfohlen)
Für produktive Systeme empfehlen wir einen nicht-blockierenden Fire-and-Forget-Ansatz, damit VEREEFY nie die Antwortzeit Ihrer KI-Calls erhöht.
import asyncio
import aiohttp
async def log_interaction_async(prompt: str, response: str, **kwargs):
"""Asynchron, blockiert den Hauptprozess nicht."""
async with aiohttp.ClientSession() as session:
try:
async with session.post(
"https://api.vereefy.ai/v1/interactions",
headers={"X-API-Key": VEREEFY_KEY},
json={...},
timeout=aiohttp.ClientTimeout(total=3),
) as resp:
return await resp.json()
except Exception:
pass # Logging darf nie die Hauptfunktion blockieren
# Fire-and-forget
asyncio.create_task(log_interaction_async(prompt, answer, ...))Interaktive API-Dokumentation
Die vollständige OpenAPI-Spezifikation mit Swagger UI finden Sie unter api.vereefy.ai/docs (oder lokal unter localhost:8000/docs). Dort können Sie alle Endpunkte direkt im Browser testen.