Skip to main content

Why Use an SDK?

The Cred Evaluation API returns a trust score, trust tier, per-gate breakdown, and optional dynamic pricing for any wallet address. You can call it directly with fetch or httpx, but the SDK packages give you:
  • Typed responses — full TypeScript types and Python dataclasses, no parsing raw JSON
  • Framework middleware — one line to gate every route with trust checks
  • Automatic 402/403 handling — challenges and denials built in
  • Trust headersX-Cred-Trust-Score and X-Cred-Trust-Tier set on every response
  • Dynamic pricing — trust-score-based price multipliers computed server-side

Available Packages

TypeScript SDK

Core client for Node.js, Deno, Bun, and edge runtimes. Zero dependencies beyond fetch.

Hono Middleware

Drop-in middleware for Hono. One line to trust-gate your API.

Express Middleware

Express middleware with req.credTrust for downstream handlers.

Next.js Middleware

Next.js edge middleware with route matching.

Python SDK

Async client and FastAPI Depends() integration.

How It Works

Every SDK package calls the same backend endpoint:
POST https://validator.credprotocol.com/v1/evaluate
Authorization: Bearer cred_sk_...
The response includes:
FieldDescription
trust_score0–100 normalized composite score
trust_tiertrusted, verified, limited, untrusted, or blocked
gate_resultsPer-gate pass/fail with scores
confidence0.0–1.0 based on data availability
price_multiplierDynamic pricing multiplier (if enabled)
reputationBehavioral history from ERC-8004 feedback
challengePre-built 402 challenge body (if gates failed)
The middleware packages wrap this into framework-native patterns — Hono c.set(), Express req.credTrust, Next.js response headers, FastAPI Depends().

Trust Tiers

TierScoreMeaning
Trusted80–100Full access, lowest pricing. Proven track record.
Verified60–79Standard access, standard pricing.
Limited30–59Restricted access, elevated pricing.
Untrusted1–29Minimal access, maximum pricing.
Blocked0Access denied. Critical gate failure.

Policy Templates

Instead of configuring individual gates, use a named policy template:
TemplateGatesBest For
basicHuman check onlyBot filtering, basic API protection
standardHuman + identity verificationGeneral API protection (recommended default)
strictHuman + identity + established walletFinancial services, sensitive data
financialAll gates, tight thresholdsLending, payments, credit
reputationWeighted composite, dynamic pricingTiered access, trust-to-earn
quickHuman check, relaxed thresholdLow-stakes endpoints

Getting Your API Key

1

Sign up for a developer account

curl -X POST https://validator.credprotocol.com/v1/platform/signup \
  -H "Content-Type: application/json" \
  -d '{"name": "Your Name", "email": "you@example.com"}'
2

Save your API key

The response includes a cred_sk_... key. Store it securely — it is shown exactly once.
3

Set it as an environment variable

export CRED_API_KEY=cred_sk_your_key_here

Next Steps

Pick the package that matches your stack and follow the integration guide: