ScoringClient interacts with the Agether scoring API. It lets you read the current onchain credit score for free, or trigger a fresh ML computation (x402-gated, $0.01 USDC per query).
Reading the current onchain score via
getCurrentScore() is always free. Triggering a fresh computation via requestScore() costs $0.01 USDC and is settled via the x402 protocol.Constructor
ScoringClientConfig object:
| Field | Type | Required | Description |
|---|---|---|---|
endpoint | string | Yes | Backend API URL |
x402 | X402Config | No | x402 config for paid scoring calls |
If you only need free score reads (
getCurrentScore, getAgentDetails), the x402 config is not needed. It’s only required for requestScore() which triggers a fresh computation.Methods
getCurrentScore(agentId)
Read the current onchain score from the Agether8004Scorer contract. Free, no payment required.
A score is considered fresh if it was submitted within the last 24 hours. Stale scores still reflect the agent’s most recent assessment — they just haven’t been recomputed recently.
requestScore(agentId)
Trigger a fresh score computation. This is x402-gated ($0.01 USDC). Requires x402 config in the constructor.
The flow:
- Client calls the scoring endpoint
- Server returns 402 → X402Client pays automatically
- Backend calls the ML service, computes score
- Backend signs and submits the score onchain via
Agether8004Scorer.submitScore() - Returns the score breakdown with txHash
getAgentDetails(agentId)
Fetch full agent details from the backend — including score, code approval status, and account info.
getAgentCount()
Get the total number of registered agents and accounts.
getHealth()
Check the scoring service health.
getStatus()
Retrieve full protocol status — chain info, contract addresses, and scoring config.
Score Tiers Reference
| Score Range | Tier | Approximate P(Default) |
|---|---|---|
| 800–1000 | 🟢 Excellent | < 0.5% |
| 670–799 | 🟡 Good | 0.5–2% |
| 580–669 | 🟡 Fair | 2–8% |
| 450–579 | 🟠 Poor | 8–25% |
| 300–449 | 🔴 Very Poor | > 25% |
Safety Rails
The ML model’s output is adjusted by rule-based safety rails for critical cases:Thin File (score → 300)
Thin File (score → 300)
Applies when the agent has very little credit history. New agents start at the minimum score of 300.
Underwater (capped at 350)
Underwater (capped at 350)
Applies when health factor is below 1.0. The agent is at or past the liquidation threshold.
Recent Liquidation (capped at 400)
Recent Liquidation (capped at 400)
Applies when the agent was liquidated within the last 30 days. Proven default risk.
KYA Bonus (+30 points)
KYA Bonus (+30 points)
Applies when the agent’s code has been audited and approved via the ValidationRegistry.

