Skip to content

feat: paid reputation dossier — GET /api/trust/deep ($0.01 x402)#10

Open
Jugmaster wants to merge 4 commits into
mainfrom
feat/reputation-deep-paid
Open

feat: paid reputation dossier — GET /api/trust/deep ($0.01 x402)#10
Jugmaster wants to merge 4 commits into
mainfrom
feat/reputation-deep-paid

Conversation

@Jugmaster

Copy link
Copy Markdown
Contributor

What

The first paid SAID endpoint — productizes the v0.8 engine.

GET /api/trust/deep?wallet=<wallet>$0.01 USDC via x402 → the full reputation dossier:

  • per-axis Beta posteriors with lowerBound95 (95% confidence floor — the underwriting-grade signal)
  • EigenTrust graph score, composite, tier, total evidence samples, computedAt

Free tier is unchanged: tier + score stay free at /api/trust/:wallet and /api/agents/:wallet. This is the freemium split — free discovery, paid depth.

Implementation

  • Reuses getV8Reputation (already on main from PR feat: serve reputation v0.8 from /api/trust + /api/verify (Stage 1) #6). The dossier data was already computed.
  • Added 'GET /api/trust/deep' to the x402 priced-routes map (x402-config.ts), $0.01, same accepts as /xchain/message.
  • Query-param path (?wallet=) so the route key is an exact match — no dependency on the SDK matching :param patterns.
  • Handler registered after the global x402 middleware so it's actually gated; a GET has no from.address, so the per-message free-tier hook never grants it (always paid).
  • Added to /.well-known/x402 for x402scan discovery.

Safety

  • Free endpoints are registered before the gate — untouched.
  • Handler is try/catch wrapped — never 500s.
  • tsc clean.

Verify after merge (the one thing I can't test locally — the gate)

# Should return HTTP 402 (payment required), NOT the data:
curl -i 'https://api.saidprotocol.com/api/trust/deep?wallet=9VaDVp1Wb78G4Wm6VuTiMrpESjrUymXefQTHcJGRSTEA'

# Free tier still 200:
curl 'https://api.saidprotocol.com/api/trust/9VaDVp1Wb78G4Wm6VuTiMrpESjrUymXefQTHcJGRSTEA'

If the deep route returns the data without a 402, the gate isn't matching the route key — tell me and I'll adjust (most likely the SDK strips/keeps the query differently than expected).

Jugmaster and others added 4 commits June 6, 2026 21:02
Productizes v0.8: free tier (tier + score) stays at /api/trust/:wallet and
/api/agents/:wallet; the paid deep dossier goes behind the existing x402 gate.

GET /api/trust/deep?wallet=<wallet> returns the full v0.8 breakdown —
per-axis Beta posteriors with **lowerBound95** (the 95% confidence floor,
the underwriting-grade signal), EigenTrust score, composite, tier, total
evidence samples, computedAt. Reuses getV8Reputation (already on main).

x402 wiring:
- Added 'GET /api/trust/deep' to the priced-routes map in x402-config.ts at
  $0.01 USDC (same accepts as /xchain/message).
- Query-param path (?wallet=) keeps the route key an exact match (no SDK
  param-pattern dependency).
- Handler registered AFTER the global x402 middleware so it's actually gated;
  a GET has no `from.address` body so the message free-tier hook never grants
  it — always paid.
- Listed in /.well-known/x402 for x402scan discovery.

Free endpoints unchanged (registered before the gate). Handler is try/catch
wrapped; never 500s the gate.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…k discriminators

- GET /api/identity/:id — partner-facing slim identity read (resolves by id/wallet/pda; on-chain detail behind ?include=onchain)
- /api/agents: ?sort=active + id tiebreaker, fixes offset-pagination dup/skip
- correct wallet link/unlink/transfer-authority Anchor discriminators
- prisma: @@index([lastActiveAt]) for the active sort

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ges, architecture

Replaces the stale 6-endpoint README (documented ~8% of the API) with the real
surface: grouped reference across identity/registration, directory, verification
(incl. Layer-2), reputation & trust, attestations/passports, A2A, and platform
integrations.

- Centered title + stack pills + a live agent-count badge that pulls /api/stats
- Live quickstart with real curl examples against api.saidprotocol.com
- Concepts (identity, verification, v0.8 Trust Score, A2A, x402) + architecture diagram
- Platform integrations split into Managed (provisioning) vs Embedded (build-in/traffic, e.g. Daemon)
- Drop the trailing "# Force rebuild" cruft

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…nericize partners, drop deploy/infra

Hardening pass on the public README:
- Trust Score: remove the ranked factor weighting (anti-gaming); keep it as
  "weighted signals anchored on verified on-chain payment history"
- Platform integrations: genericize — no named partner roster / concentration tell
- Drop the prod Deployment section + infra specifics (host, boot command,
  managed-wallet + job-queue components, env->prod table); keep local dev and a
  conceptual architecture only
- Remove /api/register/sponsored (money endpoint) from the public reference

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant