Přeskočit obsah

Unified API Gateway

Status: ✅ Production Ready
URL: https://api.czechai.io
Swagger UI: http://46.224.121.179:9090/docs
Dokumentace: https://router.czechai.io/web/gateway-docs-index.html


📊 Přehled

Centrální API gateway pro 88 agentů napříč 11 službami.

Feature Status
SSL/TLS ✅ HTTPS (Let's Encrypt)
Authentication ✅ API Keys s SHA-256 hash
Rate Limiting ✅ 100 requests/minute
Usage Tracking ✅ Endpoint/method/status logging
Metrics ✅ Prometheus (6 metrik)
Documentation ✅ OpenAPI 3.0 + Swagger UI

🔐 API Key Authentication

Získání API klíče

Kontaktuj admina pro vygenerování klíče:

curl -X POST https://api.czechai.io/admin/keys/generate   -H "X-Admin-Key: ADMIN_KEY"   -H "Content-Type: application/json"   -d '{
    "name": "Client Name",
    "owner": "email@example.com",
    "expires_days": 365,
    "rate_limit": 10000,
    "requests_per_minute": 100
  }'

⚠️ Klíč se zobrazí JEN JEDNOU! Ulož si ho bezpečně.

Použití API klíče

Python

import requests

API_KEY = "czai_..."
response = requests.post(
    "https://api.czechai.io/api/banking/loan_assessment",
    headers={"X-API-Key": API_KEY},
    json={"amount": 5000000, "income": 80000}
)
print(response.json())

JavaScript

fetch("https://api.czechai.io/api/aml/company_screening", {
  method: "POST",
  headers: {
    "X-API-Key": "czai_...",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({ico: "12345678"})
})
.then(res => res.json())
.then(data => console.log(data));

Curl

curl -X POST https://api.czechai.io/api/real-estate/due_diligence   -H "X-API-Key: czai_..."   -d '{"address": "..."}'

📦 88 Agentů (11 Služeb)

Service Port Agents Příklad endpointu
banking 9100 6 /api/banking/loan_assessment
legal-aml 9101 5 /api/legal-aml/aml_compliance
real-estate 9102 9 /api/real-estate/due_diligence
insurance 9103 4 /api/insurance/underwriting
compliance 9104 5 /api/compliance/kyc
risk 9105 5 /api/risk/credit_risk
aml 9106 7 /api/aml/company_screening
legal 9107 3 /api/legal/contract_review
data 9108 16 /api/data/ares_lookup
contact 9109 13 /api/contact/email_finder
orchestrator 9116 15 /api/orchestrator/master_orchestrator

Kompletní seznam: https://api.czechai.io/api/agents


🌐 Endpointy

Veřejné (bez API klíče)

  • GET / - Gateway info
  • GET /health - Health check všech služeb
  • GET /metrics - Prometheus metrics
  • GET /docs - Swagger UI
  • GET /openapi.json - OpenAPI schema

Chráněné (vyžadují API klíč)

  • GET /api/services - Seznam služeb
  • GET /api/agents - Seznam agentů
  • POST /api/{service}/{agent} - Volání agenta

Admin (vyžadují Admin Key)

  • POST /admin/keys/generate - Generování API klíče
  • GET /admin/keys/list - Seznam klíčů
  • GET /admin/keys/usage/{id} - Usage statistiky
  • POST /admin/keys/revoke/{id} - Revokace klíče

📊 Prometheus Metrics

Dostupné metriky na /metrics:

  • gateway_requests_total - Celkový počet requestů
  • gateway_request_duration_seconds - Délka trvání requestů
  • gateway_active_requests - Počet aktivních requestů
  • gateway_service_health - Zdraví služeb (1=healthy, 0=unhealthy)
  • gateway_proxy_requests_total - Celkový počet proxy requestů
  • gateway_proxy_errors_total - Celkový počet proxy chyb

⚠️ Rate Limiting

Každý API klíč má limity:

  • 100 requests/minute (default)
  • 10,000 requests/day (default)

Při překročení limitu:

{
  "error": "Rate limit exceeded",
  "limit": 100,
  "window": "1 minute"
}


📚 Kompletní dokumentace

Detailní návody:


Vytvořeno: 2026-01-25
Status: Production Ready ✅