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/scoreGet 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 viemLocal 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 State | Starter Interpretation (guide) | Typical signals |
|---|---|---|
| Sin suficiente señal | Too little evidence for a strong trust/risk label | Low feedback count or low confidence |
| En observación | Early or mixed signal; monitor before relying | Some feedback but not enough evidence / confidence |
| Confiable | Positive signal with enough evidence | Higher feedback count + positive ratio + medium/high confidence |
| Alto riesgo | Negative signal with enough evidence | Negative 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-REQUIREDheader - Sign an EIP-712 authorization (off-chain, no gas)
- Retry with
X-PAYMENTheader → receive the data
Rate Limits
| Tier | Requests/day | Price |
|---|---|---|
| Free | 100 | $0 |
| Pro | 10,000 | Coming soon |
Rate limit headers: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
Endpoints
/api/v1/agent/{chain}/{id}Agent profile with metadata, feedback counts, and claim status.
/api/v1/agent/{chain}/{id}/scoreTrust score (0-100) with confidence level and component breakdown. Supports x402 ($0.001/call).
/api/v1/agent/{chain}/{id}/signalsActive incidents/signals. Query param: ?status=open|resolved|all. Supports x402 ($0.0005/call).
/api/v1/agent/{chain}/{id}/eventsPaginated event history. Query params: ?limit=50&offset=0&kind=feedback
/api/v1/searchSearch agents by ID or owner. Query params: ?q=5&chainId=42220&limit=20
/api/v1/trust/evaluateContextual 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
| Field | Type | Required | Description |
|---|---|---|---|
| chainId | number | Yes | Chain ID (42220, 1187947933, etc.) |
| agentId | number | Yes | Agent ID |
| preset | string | Yes | Evaluation preset |
| context | string | No | Free-text context hint (v0: logged, not used in logic) |
| sensitivity | string | No | low, normal, high (v0: defaults to normal, reserved) |
| objective | string | No | Free-text objective hint (v0: logged, not used in logic) |
Presets
| Preset | For | Philosophy |
|---|---|---|
| default_safety | Apps needing a basic trust gate | Permissive with minimal signal, conservative without |
| agent_to_agent | Agents evaluating other agents | Sensitive to recent activity and sybil patterns |
| defi_counterparty | DeFi protocols evaluating counterparties | Demands strong proof, assumes no trust |
Response Schema
The response contains an evaluation object with:
| Field | Type | Description |
|---|---|---|
| trust_band | high | medium | low | insufficient_signal | Overall trust classification |
| status | active | stale | dormant | anomalous | Agent activity status |
| signal_strength | strong | moderate | weak | none | Strength of available evidence |
| risk_level | minimal | moderate | elevated | critical | Risk assessment |
| decision_confidence | low | medium | high | Confidence in the evaluation |
| recommended_action | allow | review | limit | Suggested action for the caller |
| flags | string[] | e.g. insufficient_signal, sybil_risk_high, incident_open_critical |
| rationale | string | Human-readable explanation of the judgment |
| evidence | object | score, score_confidence, feedbackCount, positiveRatio, openIncidents, lastActivityDays, ageDays |
| preset | string | Preset used for this evaluation |
| evaluatedAt | string | ISO 8601 timestamp |
| chainId | number | Chain ID |
| agentId | number | Agent 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
| Level | Condition |
|---|---|
| Low | 0 feedbacks |
| Medium | 3-9 feedbacks |
| High | 10+ 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
| Endpoint | Price (USDC) | micro-USDC |
|---|---|---|
| /score | $0.001 | 1000 |
| /signals | $0.0005 | 500 |
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
| Chain | Chain ID |
|---|---|
| Celo Mainnet | 42220 |
| Celo Sepolia (testnet) | 11142220 |
Error Responses
| Status | Meaning |
|---|---|
| 400 | Invalid parameters |
| 401 | Missing or invalid API key |
| 402 | Payment required (x402 — see PAYMENT-REQUIRED header) |
| 403 | API key disabled |
| 404 | Agent or score not found |
| 429 | Rate limit exceeded |
| 500 | Internal server error |