Trust as a Service API

Public API for external platforms to query DAT trust scores via API key authentication. Per-key rate limiting, monthly quotas, and tiered pricing from free to enterprise.

5 Public Endpoints

Query any agent's trust score, get detailed pillar breakdowns, perform batch lookups of up to 100 DIDs, check badges, or do quick boolean trust threshold verification — all with a single API key.

  • GET /trust/:agentDid — Trust score + 5 pillar summary
  • GET /trust/:agentDid/pillars — Detailed breakdown with formula
  • POST /trust/batch — Bulk lookup up to 100 DIDs
  • GET /trust/:agentDid/badges — Active non-expired badges
  • GET /trust/:agentDid/verify — Quick boolean threshold check
// Single trust query
GET /api/v1/public/trust/did:dat:testnet:agent_...
X-TaaS-API-Key: taas_key_abc123...

{
  "trustScore": 77.43,
  "pillars": {
    "reliability": 82.1,
    "performance": 75.3,
    "compliance": 71.8,
    "security": 68.5,
    "reportingFidelity": 65.2
  },
  "investigationState": "active",
  "activityTier": "active"
}

// Quick verification
GET /trust/:did/verify?threshold=70
→ { "meetsThreshold": true }

Tiered Quotas & Rate Limiting

Four API tiers from free to enterprise. Per-key per-second rate limiting via Redis INCR prevents burst abuse, while monthly quotas enforce fair usage across all consumers.

  • Free — 1,000 req/month, 5 req/second
  • Starter — 10,000 req/month, 20 req/second
  • Pro — 100,000 req/month, 50 req/second
  • Enterprise — Unlimited requests, 200 req/second
// API key authentication flow
Request → X-TaaS-API-Key header
  → SHA-256 hash
  → Redis cache lookup (5-min TTL)
  → Prisma fallback if cache miss
  → Per-key rate limit check
    (Redis INCR, 1s TTL)
  → Monthly quota check
    (Redis INCR, per-month key)
  → Process request

// Admin key management
POST /admin/keys     → create (returns plaintext once)
GET  /admin/keys     → list all keys
PATCH /admin/keys/:id → update tier/enabled
DELETE /admin/keys/:id → revoke
GET  /admin/usage    → aggregate stats

Batch Operations & Integration

The batch endpoint accepts up to 100 DIDs in a single request, returning trust scores for all agents in parallel. Designed for platforms that need to evaluate agent fleets or marketplace listings in bulk.

  • Batch lookup of up to 100 DIDs per request
  • SHA-256 hashed API keys — plaintext never stored
  • Redis-cached key lookups for sub-millisecond auth
  • Dashboard admin console for key management and usage stats
// Batch trust lookup
POST /api/v1/public/trust/batch
X-TaaS-API-Key: taas_key_abc123...
{
  "dids": [
    "did:dat:testnet:agent_1fb5d...",
    "did:dat:testnet:agent_f1881...",
    "did:dat:testnet:agent_df1ef..."
  ]
}

→ {
  "results": [
    { "did": "..._1fb5d", "trustScore": 77.4 },
    { "did": "..._f1881", "trustScore": 65.0 },
    { "did": "..._df1ef", "trustScore": 65.0 }
  ],
  "found": 3,
  "notFound": 0
}
5
Public Endpoints
4
API Tiers
100
Batch DIDs
<1ms
Auth Latency

Integrate Trust Into Your Platform

Query agent trust scores from any application with a simple API key.