SDK + Integration
One call. Every x402 endpoint.
Use Gateway for routing, Check for verification, and Certify for attestation receipts. 100 Gateway routes/month are free. No API key.
5-minute quickstart
curl → first route → pay via x402
Min 0–1
Ping Gateway
Confirm the API is live and see categories + recommended defaults.
curl -s https://clearedindex.com/api/cleared/gateway | jq '.example'
Min 1–3
First route — auto (market share)
strategy=auto follows live /leaderboard route share × value × settle. Identity still lands on strong Base endpoints.
curl -s -X POST https://clearedindex.com/api/cleared/gateway \
-H "Content-Type: application/json" \
-d '{
"category": "identity",
"strategy": "auto",
"minScore": 55
}' | jq '{ name: .route.name, slug: .route.slug, score: .route.score }'Min 3–5
Pay via x402
Use route.payTo and route.totalCost with your x402 client. Save certifiedHash if you verify first.
// After route succeeds: // await x402Pay(route.payTo, route.totalCost); // Optional: GET /api/cleared/check?origin=...&certify=certified
Whale agent desk
72-hour embed. One mark.
Production loop for high-frequency agent desks: Check → Entropy pre-settle → Gateway → Pay → Witness. Import lib/cleared/whale-agent-loop.ts or paste below.
Primary mark · score 92
Coinbase Developer Platform · AgentKit + x402 on Base
Multiplier · approach
You contributed x402 to Linux Foundation. Cleared is live trust + routing on Base today — we already route identity to CDP. Make Check the default before AgentKit pays.
Multiplier: 1,000+ AgentKit agents × 10 calls/day × $0.08 blended × 5% routing ≈ $12K/mo Cleared + ecosystem GMV. Entropy attach on finance/regime loops adds operator-side gross.
Stack
CDP AgentKit · x402 facilitator · Base eip155:8453 · EIP-712 USDC
Loop
Agent discovers tool → wallet signs x402 → USDC settles on Base → (no trust layer today)
Pain
Coinbase shipped pay. Agents still hit spoofed payTo, unverified endpoints, and zero settlement receipts for compliance. CDP docs show how to pay — not whether to pay.
Wedge
Check → Gateway (routes to CDP identity by default) → Witness on 8453
Intro
Warm: Base ecosystem + learn content (/learn/base-is-for-agents). Technical: PR on agentkit docs — default cleared_check before x402. Institutional: co-branded Base x402 Trust Index.
Contacts
CDP Developer Relations · Base / agent commerce PM · AgentKit engineering (GitHub PR path) · Coinbase Ventures (air cover — not first knock)
Intel
- · clearedindex.com already Check-scores api.developer.coinbase.com
- · Gateway routes identity → Coinbase CDP by default (seed-coinbase-cdp)
- · Stripe + AWS are racing to own agent pay — CDP needs trust differentiation on Base
- · Your COINBASE_VENTURES_THESIS ask: co-branded Trust Index · Check in docs · Witness on 8453
Whale desk pilot — 6 months
We give
- · Gateway Pro waived — unlimited routes, dedicated fingerprint
- · Priority routing lane + private /gateway/analytics
- · White-glove embed — we ship the PR in 72 hours
- · Entropy pre-settle priority for regime/finance categories
- · Witness + Certified Hash bundled on pilot volume
We ask
- · Production embed in agent loop (Check → Entropy → Gateway → Pay → Witness)
- · ≥1 req/min sustained for 30 days OR one capital-desk loop in prod
- · Case study rights (anonymized OK)
- · Intro to 2 downstream agent builders when live
Embed kit
TypeScript — import module
import {
runWhaleAgentLoop,
witnessSettlement,
} from "@/lib/cleared/whale-agent-loop";
const WHALE_FP = process.env.CLEARED_AGENT_FINGERPRINT!; // provisioned desk id
export async function agentSpendLoop(category: string) {
const loop = await runWhaleAgentLoop(
{ category, maxPrice: 0.5, certify: true },
{ agentFingerprint: WHALE_FP, minScore: 70, requireEntropy: true },
);
if (!loop.ok || !loop.gateway?.route) throw new Error(loop.errors.join(","));
const { route } = loop.gateway;
// → pay route.origin + route.endpoint via x402 (CDP AgentKit, etc.)
const txHash = await payX402(route);
await witnessSettlement(
{ txHash, origin: route.origin, physicsHash: loop.entropy?.physicsHash },
{ agentFingerprint: WHALE_FP },
);
return { loop, txHash };
}LangChain tool
# LangChain — tool wrapper (Python)
from langchain.tools import tool
import httpx
CLEARED = "https://clearedindex.com"
WHALE_FP = os.environ["CLEARED_AGENT_FINGERPRINT"]
@tool
def cleared_whale_route(category: str, max_price: float = 0.5) -> dict:
"""Route agent spend through Cleared Gateway + Entropy pre-settle."""
entropy = httpx.get(
"https://www.entropyindex.com/api/v1/x402/pre-settle",
timeout=12,
).json()
gw = httpx.post(
f"{CLEARED}/api/cleared/gateway",
headers={"X-Cleared-Agent-Fingerprint": WHALE_FP},
json={"category": category, "strategy": "best_value", "minScore": 70, "maxPrice": max_price},
).json()
if not gw.get("routed"):
raise ValueError("No cleared route")
origin = gw["route"]["origin"]
check = httpx.get(f"{CLEARED}/api/cleared/check", params={"origin": origin, "certify": "certified"}).json()
if not check.get("pass"):
raise ValueError("Cleared check failed")
return {"route": gw["route"], "entropy_bind": entropy.get("bind"), "certified_hash": check.get("certifiedHash")}CrewAI hook
# CrewAI — before_task hook
# pip install httpx
import os, httpx
def cleared_before_pay(context):
fp = os.environ["CLEARED_AGENT_FINGERPRINT"]
category = context.get("spend_category", "identity")
r = httpx.post(
"https://clearedindex.com/api/cleared/gateway",
headers={"X-Cleared-Agent-Fingerprint": fp},
json={"category": category, "strategy": "best_value", "minScore": 70},
timeout=30,
).json()
if not r.get("routed"):
raise RuntimeError("Cleared: no route — abort spend")
context["cleared_route"] = r["route"]
context["cleared_request_id"] = r.get("requestId")
return contextSet CLEARED_AGENT_FINGERPRINT — we provision whale desks with Gateway Pro + analytics. Gateway docs · Unified loop
Backup marks
Multiplier · 85
LangChain · LangGraph production agents
One @tool — cleared_route — before any x402 spend. You become the default trust layer for LangGraph commerce.
Volume desk · 78
On-chain recon · Top Base x402 settlement wallets
We indexed your settlements. Here's where payTo ≠ advertised. Cleared fixes that before your next loop.
Capital desk · 88
Family office / allocator agent desk
Entropy flagged 2008 Crisis-mode six months before Lehman. Your agent should check that before it sizes.
Live index stats
483
Checks today
4,596
Total checks
45.96
$AEO burned
0.01
Per check
Gateway — Recommended
PrimaryDon't pick endpoints yourself. Prefer strategy: "auto" — it follows live route share on /leaderboard, blended with value and settle. One POST, done.
// Gateway — market auto (route-share × value × settle)
const res = await fetch("https://clearedindex.com/api/cleared/gateway", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
category: "identity",
strategy: "auto", // recommended — follows live /leaderboard share
maxPrice: 0.50,
minScore: 70, // recommended — filters fragile endpoints
}),
});
const { route } = await res.json();
// route.payTo — pay directly via x402
// route.avgLatencyMs / route.sigma / route.canaryStatus — live signals when sampled
if (route) {
const payment = await pay(route.payTo, route.totalCost);
}MCP — Drop-in
route_gatewayInstall once in Cursor, Claude, or any MCP host. Tool #1 is Gateway — agents route before they pay.
# MCP drop-in (Cursor / Claude / any MCP host)
# npx @n747ai/clearedindex-mcp-server
#
# Tool #1: route_gateway
# category: identity | enrichment | compliance | ...
# strategy: auto (market route-share) | best_value | fastest | ...
# Returns payTo + totalCost. 100 free routes/month.Drop-in wedge
/drop-inPortable beforePay + CI gate. Abort when payToMismatch or Check fails. Full kit: clearedindex.com/drop-in.
// Abort if Check fails or payTo mismatches
const { pass, score, payToMismatch } = await fetch(
"https://clearedindex.com/api/cleared/check?origin=" + origin + "&probe=false"
).then((r) => r.json());
if (!pass || payToMismatch) throw new Error("Cleared abort");
// CI — .github/actions/cleared-gate
// - uses: ./.github/actions/cleared-gate
// with: { origin: "https://api.example.com", min-score: "70" }Check + Certified Hash
If you already know the endpoint, verify it and get a certified hash. The hash is your receipt — use it for arbitration if anything goes wrong.
// Check — verify before you pay
const res = await fetch(
"https://clearedindex.com/api/cleared/check?origin=https://api.example.com&certify=certified"
);
const { pass, score, certifiedHash } = await res.json();
if (pass) proceed();
// certifiedHash is your receipt if anything goes wrongTypeScript — Direct Index Access
// cleared.ts — drop into any agent
const CLEARED_GATEWAY = "https://clearedindex.com/api/cleared/gateway";
export async function routeCleared(category: string, opts?: {
strategy?: string;
maxPrice?: number;
minScore?: number;
}) {
const res = await fetch(CLEARED_GATEWAY, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
category,
strategy: opts?.strategy ?? "auto",
maxPrice: opts?.maxPrice,
minScore: opts?.minScore ?? 70,
}),
});
const data = await res.json();
return data.routed ? data.route : null;
}Python
# Gateway integration — Python
import httpx
def gateway_route(category: str, strategy: str = "auto", max_price: float = None):
body = {"category": category, "strategy": strategy, "minScore": 70}
if max_price:
body["maxPrice"] = max_price
res = httpx.post("https://clearedindex.com/api/cleared/gateway", json=body)
data = res.json()
if data.get("routed"):
return data["route"]
return None
# Check + certify
def cleared_check(origin: str, certify: str = "basic"):
res = httpx.get(f"https://clearedindex.com/api/cleared/check?origin={origin}&certify={certify}")
return res.json()cURL — Full API Surface
# Gateway — auto (market route-share; minScore 70 recommended)
curl -X POST https://clearedindex.com/api/cleared/gateway \
-H "Content-Type: application/json" \
-d '{"category": "identity", "strategy": "auto", "minScore": 70}'
# Check with certified hash
curl "https://clearedindex.com/api/cleared/check?origin=https://api.example.com&certify=certified"
# Watchlist — subscribe to score changes
curl -X POST https://clearedindex.com/api/cleared/watchlist \
-H "x-cleared-api-key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"origin": "https://api.example.com", "webhookUrl": "https://your-app.com/webhook"}'
# Route-share market (powers strategy=auto)
curl "https://clearedindex.com/api/cleared/leaderboard?period=7d&category=identity"
# Sigma score
curl "https://clearedindex.com/api/cleared/sigma?origin=https://api.example.com"System Prompt Snippet
Drop this into your agent's system prompt. It tells the agent to route through Gateway, certify with hashes, and file disputes when things go wrong.
# Add to your agent's system prompt:
Before paying any x402 endpoint, route through Cleared Gateway:
POST https://clearedindex.com/api/cleared/gateway
{"category": "...", "strategy": "auto"}
Or via MCP: call tool route_gateway on @n747ai/clearedindex-mcp-server
(prefer strategy=auto — follows live route share on /leaderboard)
The Gateway returns the best verified endpoint. Pay it directly via x402.
If you already know the endpoint, verify it first:
GET https://clearedindex.com/api/cleared/check?origin=<URL>&certify=certified
Save the certifiedHash — it's your receipt if anything goes wrong.
File disputes at: POST https://clearedindex.com/api/cleared/arbitrationBadges
Operator badge — embed in your docs:
Gateway badge — show you route through Cleared:
