REPUTATION API

Query trust scores, signals, and event history for any ERC-8004 agent. One curl command to answer: “Can I trust this agent?”

Quick Start

curl -H "Authorization: Bearer ds_YOUR_KEY" \
  https://denscope.vercel.app/api/v1/agent/42220/5/score

Get your API key from the Console → API Keys section.

Start with SDK

Prefer TypeScript? Use @denlabs/trust-sdk to query the same trust data used by the portal. It supports both API keys and x402 payment mode.

Repo: github.com/den-labs/trust-sdk

Example: examples/get-score.mjs

x402 Example: examples/get-score-x402.mjs

Install

pnpm add @denlabs/trust-sdk

# For x402 payment mode (optional)
pnpm add viem

Local SDK repo example (after cloning): DENSCOPE_API_KEY=ds_xxx pnpm example:get-score

Local x402 example: DENSCOPE_PRIVATE_KEY=0x... pnpm example:get-score:x402

API Key Example

import { DenScope } from '@denlabs/trust-sdk'

const ds = new DenScope({ apiKey: 'ds_...' })

const { score } = await ds.getScore(42220, 5)
console.log(score.value, score.confidence)

const { signals } = await ds.getSignals(42220, 5, { status: 'open' })
const { agents } = await ds.search({ q: '0xabc', chainId: 42220, limit: 5 })

x402 Example (wallet/agent)

import { DenScope } from '@denlabs/trust-sdk'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount('0x...')
const ds = new DenScope({ account })

// SDK handles: 402 -> decode PAYMENT-REQUIRED -> sign -> retry
const { score } = await ds.getScore(42220, 5)
const { signals } = await ds.getSignals(42220, 5)

Error Handling Example

import {
  DenScope,
  DenScopeError,
  AuthenticationError,
  PaymentRequiredError,
} from '@denlabs/trust-sdk'

const ds = new DenScope({ apiKey: process.env.DENSCOPE_API_KEY! })

try {
  const { score } = await ds.getScore(42220, 5)
  console.log(score.value, score.confidence)
} catch (e) {
  if (e instanceof AuthenticationError) {
    console.error('Invalid or disabled API key')
  } else if (e instanceof PaymentRequiredError) {
    console.error('x402 payment required (use wallet mode or X-PAYMENT flow)')
  } else if (e instanceof DenScopeError) {
    console.error('Denscope API error', e.status, e.body)
  } else {
    console.error('Unexpected error', e)
  }
}

Interpretation Guide (Portal-Aligned)

The API returns raw score data (value, confidence, feedback stats). In the portal, Denscope maps those fields into semantic states for faster reading.

Portal StateStarter Interpretation (guide)Typical signals
Sin suficiente señalToo little evidence for a strong trust/risk labelLow feedback count or low confidence
En observaciónEarly or mixed signal; monitor before relyingSome feedback but not enough evidence / confidence
ConfiablePositive signal with enough evidenceHigher feedback count + positive ratio + medium/high confidence
Alto riesgoNegative signal with enough evidenceNegative dominance + medium/high confidence

Note: Semantic labels are UX interpretation helpers. Use raw fields for strict programmatic decisions.

Authentication

Two authentication methods are supported. Use whichever fits your use case:

Option 1: API Key (for developers)

Best for bulk integrations, dashboards, and analytics. Get a key from the Console.

  • Authorization: Bearer ds_... (recommended)
  • X-API-Key: ds_...

Option 2: x402 Payment (for agents)

Any wallet can query trust data with zero setup. No API key, no account needed. Available on /score and /signals endpoints.

  • Call the endpoint without auth → receive HTTP 402 + PAYMENT-REQUIRED header
  • Sign an EIP-712 authorization (off-chain, no gas)
  • Retry with X-PAYMENT header → receive the data

Rate Limits

TierRequests/dayPrice
Free100$0
Pro10,000Coming soon

Rate limit headers: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset

Endpoints

GET/api/v1/agent/{chain}/{id}

Agent profile with metadata, feedback counts, and claim status.

GET/api/v1/agent/{chain}/{id}/score

Trust score (0-100) with confidence level and component breakdown. Supports x402 ($0.001/call).

GET/api/v1/agent/{chain}/{id}/signals

Active incidents/signals. Query param: ?status=open|resolved|all. Supports x402 ($0.0005/call).

GET/api/v1/agent/{chain}/{id}/events

Paginated event history. Query params: ?limit=50&offset=0&kind=feedback

GET/api/v1/search

Search agents by ID or owner. Query params: ?q=5&chainId=42220&limit=20

POST/api/v1/trust/evaluate

Contextual trust evaluation with configurable presets. Returns a structured judgment including trust band, risk level, recommended action, and human-readable rationale. Auth: API Key or x402 ($0.001).

Trust Evaluation

The /evaluate endpoint goes beyond raw scores. It applies a preset-driven evaluation that returns a structured judgment: trust band, risk level, recommended action, and a human-readable rationale.

Request Body

FieldTypeRequiredDescription
chainIdnumberYesChain ID (42220, 1187947933, etc.)
agentIdnumberYesAgent ID
presetstringYesEvaluation preset
contextstringNoFree-text context hint (v0: logged, not used in logic)
sensitivitystringNolow, normal, high (v0: defaults to normal, reserved)
objectivestringNoFree-text objective hint (v0: logged, not used in logic)

Presets

PresetForPhilosophy
default_safetyApps needing a basic trust gatePermissive with minimal signal, conservative without
agent_to_agentAgents evaluating other agentsSensitive to recent activity and sybil patterns
defi_counterpartyDeFi protocols evaluating counterpartiesDemands strong proof, assumes no trust

Response Schema

The response contains an evaluation object with:

FieldTypeDescription
trust_bandhigh | medium | low | insufficient_signalOverall trust classification
statusactive | stale | dormant | anomalousAgent activity status
signal_strengthstrong | moderate | weak | noneStrength of available evidence
risk_levelminimal | moderate | elevated | criticalRisk assessment
decision_confidencelow | medium | highConfidence in the evaluation
recommended_actionallow | review | limitSuggested action for the caller
flagsstring[]e.g. insufficient_signal, sybil_risk_high, incident_open_critical
rationalestringHuman-readable explanation of the judgment
evidenceobjectscore, score_confidence, feedbackCount, positiveRatio, openIncidents, lastActivityDays, ageDays
presetstringPreset used for this evaluation
evaluatedAtstringISO 8601 timestamp
chainIdnumberChain ID
agentIdnumberAgent ID

Example Request

curl -X POST https://denscope.vercel.app/api/v1/trust/evaluate \
  -H "Authorization: Bearer ds_..." \
  -H "Content-Type: application/json" \
  -d '{"chainId": 42220, "agentId": 5, "preset": "default_safety"}'

Example Response

{
  "evaluation": {
    "trust_band": "high",
    "status": "active",
    "signal_strength": "strong",
    "risk_level": "minimal",
    "decision_confidence": "high",
    "recommended_action": "allow",
    "flags": [],
    "rationale": "Agent scores 78/100 with high confidence (42 feedbacks, 88% positive). No open incidents. Active within last 3 days. All indicators consistent. Recommended action: allow.",
    "evidence": {
      "score": 78,
      "score_confidence": "high",
      "feedbackCount": 42,
      "positiveRatio": 0.88,
      "openIncidents": 0,
      "lastActivityDays": 3,
      "ageDays": 120
    },
    "preset": "default_safety",
    "evaluatedAt": "2026-03-29T18:30:00Z",
    "chainId": 42220,
    "agentId": 5
  }
}

SDK Example

const result = await ds.evaluate(42220, 5, { preset: 'default_safety' })
console.log(result.evaluation.recommended_action) // "allow"
console.log(result.evaluation.rationale)

Trust Score Formula

The trust score is a transparent, deterministic number between 0 and 100. It updates after every on-chain event.

score = clamp(0, 100, round(
  0.40 * positive_ratio        // positive_count / feedback_count
+ 0.20 * age_score             // min(days_since_first_seen / 90, 1.0)
+ 0.20 * activity_score        // min(feedback_count / (active_days * 2), 1.0)
- 0.10 * incident_penalty      // min(critical*0.15 + warning*0.05, 1.0)
- 0.10 * sybil_penalty         // 1.0 if open sybil_cluster, else 0.0
) * 100)

Confidence Levels

LevelCondition
Low0 feedbacks
Medium3-9 feedbacks
High10+ feedbacks

x402 Payment Flow

The /score and /signals endpoints accept x402 micropayments via the UltravioletaDAO facilitator on Celo. This enables autonomous agents to query trust data without human-managed API keys.

Flow

# 1. Call without auth -> get 402 with payment instructions
curl -i https://denscope.vercel.app/api/v1/agent/42220/5/score
# HTTP/2 402
# PAYMENT-REQUIRED: <base64-encoded JSON>

# 2. Decode PAYMENT-REQUIRED header -> sign EIP-712 off-chain

# 3. Retry with X-PAYMENT header
curl -H "X-PAYMENT: <base64-encoded payment>" \
  https://denscope.vercel.app/api/v1/agent/42220/5/score
# HTTP/2 200 { score: { value: 85, ... } }

Pricing

EndpointPrice (USDC)micro-USDC
/score$0.0011000
/signals$0.0005500

Details

  • Protocol: x402 v2 (HTTP 402 Payment Required)
  • Settlement: EIP-3009 TransferWithAuthorization (off-chain signature, no gas for the caller)
  • Stablecoin: USDC on Celo (chain ID 42220)
  • Facilitator: UltravioletaDAO (facilitator.ultravioletadao.xyz)

Supported Chains

ChainChain ID
Celo Mainnet42220
Celo Sepolia (testnet)11142220

Error Responses

StatusMeaning
400Invalid parameters
401Missing or invalid API key
402Payment required (x402 — see PAYMENT-REQUIRED header)
403API key disabled
404Agent or score not found
429Rate limit exceeded
500Internal server error