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 withfetch 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 headers —
X-Cred-Trust-ScoreandX-Cred-Trust-Tierset 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:| Field | Description |
|---|---|
trust_score | 0–100 normalized composite score |
trust_tier | trusted, verified, limited, untrusted, or blocked |
gate_results | Per-gate pass/fail with scores |
confidence | 0.0–1.0 based on data availability |
price_multiplier | Dynamic pricing multiplier (if enabled) |
reputation | Behavioral history from ERC-8004 feedback |
challenge | Pre-built 402 challenge body (if gates failed) |
c.set(), Express req.credTrust, Next.js response headers, FastAPI Depends().
Trust Tiers
| Tier | Score | Meaning |
|---|---|---|
| Trusted | 80–100 | Full access, lowest pricing. Proven track record. |
| Verified | 60–79 | Standard access, standard pricing. |
| Limited | 30–59 | Restricted access, elevated pricing. |
| Untrusted | 1–29 | Minimal access, maximum pricing. |
| Blocked | 0 | Access denied. Critical gate failure. |
Policy Templates
Instead of configuring individual gates, use a named policy template:| Template | Gates | Best For |
|---|---|---|
basic | Human check only | Bot filtering, basic API protection |
standard | Human + identity verification | General API protection (recommended default) |
strict | Human + identity + established wallet | Financial services, sensitive data |
financial | All gates, tight thresholds | Lending, payments, credit |
reputation | Weighted composite, dynamic pricing | Tiered access, trust-to-earn |
quick | Human check, relaxed threshold | Low-stakes endpoints |
Getting Your API Key
Save your API key
The response includes a
cred_sk_... key. Store it securely — it is shown exactly once.Next Steps
Pick the package that matches your stack and follow the integration guide:- TypeScript SDK — if you want full control
- Hono Middleware — fastest path for Hono/Cloudflare Workers
- Express Middleware — for Express/Node.js APIs
- Next.js Middleware — for Next.js edge middleware
- Python SDK — for Python/FastAPI services