TrustLayer API Documentation
Verify human identity and trust scores with a single API call. No personal data collected, fully non-custodial, cryptographic proof-based.
Get your API Key
Create a free account and generate your API key from the Developer Portal.
Make your first call
Send a POST request to the verify endpoint with an identity key.
Use the result
Get trust_score, is_human, and risk_level in the response. Use it to gate access.
Authentication
All API requests require an API key passed in the x-api-key header.
x-api-key: htl_live_xxxxxxxxxxxxxxxxhtl_test_*Unlimited requests, no billing. Returns simulated scores.
htl_live_*Production usage. Counted against your plan quota.
API Endpoints
Base URL:
https://klzwvxcxjzhtgqpfyglc.supabase.co/functions/v1/v1-verifyVerify an identity's trust score and human probability. Returns real-time assessment based on cryptographic proof history.
Request Body
| Parameter | Type | Description |
|---|---|---|
identity_key | string | Base64-encoded public key of the identity to verify |
include_details | boolean | Include detailed proof metrics in response |
threshold | number | Custom trust score threshold (0-100, default: 50) |
context | string | Use case context: "voting", "payment", "access" |
Code Examples
curl -X POST https://klzwvxcxjzhtgqpfyglc.supabase.co/functions/v1/v1-verify \
-H "Content-Type: application/json" \
-H "x-api-key: htl_live_your_key_here" \
-d '{
"identity_key": "base64_public_key",
"include_details": true
}'/v1-verifyVerify multiple identities in a single request. Pass an array of identity keys in the batch field. Max 100 per request.
curl -X POST https://klzwvxcxjzhtgqpfyglc.supabase.co/functions/v1/v1-verify \
-H "Content-Type: application/json" \
-H "x-api-key: htl_live_your_key_here" \
-d '{
"batch": [
{ "identity_key": "key_1" },
{ "identity_key": "key_2" },
{ "identity_key": "key_3" }
]
}'Response Format
{
"is_human": true,
"trust_score": 78,
"risk_level": "low",
"confidence": 92,
"details": {
"unique_interactions": 24,
"total_proofs": 56,
"network_diversity": 0.67,
"account_age_days": 120,
"last_activity_hours": 1,
"proof_types": {
"face_to_face": 8,
"social_vouch": 12,
"wallet_linked": 4
}
},
"verification_id": "ver_a1b2c3d4e5",
"timestamp": "2026-02-17T10:30:00Z",
"cached": false
}Response Fields
is_humanbooleanWhether identity passes the human verification thresholdtrust_scorenumber0-100 composite score based on proof history, diversity, and timerisk_levelstring"low" | "medium" | "high" | "unknown"confidencenumber0-100 confidence level in the assessmentdetailsobjectDetailed breakdown (when include_details: true)verification_idstringUnique ID for this verification event (for audit)cachedbooleanWhether result was served from cacheError Handling
All errors return a consistent JSON structure with an error field.
{
"error": "Invalid API key",
"code": "AUTH_INVALID_KEY",
"status": 401
}| Status | Code | Description |
|---|---|---|
400 | INVALID_REQUEST | Missing or malformed parameters |
401 | AUTH_INVALID_KEY | Invalid or missing API key |
403 | KEY_INACTIVE | API key has been revoked or suspended |
429 | RATE_LIMITED | Too many requests, retry after cooldown |
402 | QUOTA_EXCEEDED | Monthly quota exceeded (Starter tier) |
500 | INTERNAL_ERROR | Server error, retry with exponential backoff |
Rate Limits
Rate limits are applied per API key per minute. Headers are returned with each response.
Rate Limit Headers
X-RateLimit-LimitMax requests per minuteX-RateLimit-RemainingRequests remaining in current windowX-RateLimit-ResetUnix timestamp when window resetsSDKs & Libraries
npm install @trustlayer/sdkpip install trustlayergo get github.com/trustlayer/go-sdkcargo add trustlayerUse Cases
DAO Governance
Ensure 1-person-1-vote in on-chain governance. Filter sybil attacks from proposal voting.
DeFi Airdrops
Verify unique humans before token distribution. Prevent farming and multi-account abuse.
Gaming Anti-Bot
Gate competitive features behind human verification. Keep bots out of ranked play.
Social Platforms
Build trust layers into social feeds. Show trust badges on verified human accounts.
Marketplace Trust
Display seller trust scores. Reduce fraud in P2P trading and NFT marketplaces.
Access Control
Gate premium features or communities behind minimum trust thresholds.