← Back to Agents

Brolli Agent API Documentation

Programmatic access to lawyer-curated patent risk framework for blockchain applications

Overview

The Brolli Risk Assessment API provides programmatic access to our lawyer-curated patent risk framework for blockchain applications. Agents can query risk scores, patent counts, and purchase recommendations before making procurement decisions.

Base URL: https://brolli.vercel.app/api

Authentication

The risk assessment API is public and does not require authentication. License purchases require x402 payment verification.

GET /risk/assess

Get available verticals and use cases

Request:
curl https://brolli.vercel.app/api/risk/assess
Response:
{
  "version": "1.0.0",
  "lastUpdated": "2025-12-29",
  "availableVerticals": [
    {
      "id": "payments",
      "name": "Payment Systems",
      "riskTier": "HIGH",
      "patentCount": 1243,
      "useCases": ["stablecoin", "crossBorder"]
    }
  ]
}

POST /risk/assess

Assess patent risk for your specific use case

Request:
curl -X POST https://brolli.vercel.app/api/risk/assess \
  -H "Content-Type: application/json" \
  -d '{
    "vertical": "payments",
    "useCases": ["stablecoin", "crossBorder"],
    "description": "USDC payment processor"
  }'
Response:
{
  "vertical": "Payment Systems",
  "riskTier": "HIGH",
  "riskScore": 8.2,
  "totalPatents": 1243,
  "matchedUseCases": [
    {
      "id": "stablecoin",
      "name": "Stablecoin Systems",
      "riskScore": 8.5,
      "patentCount": 847,
      "recommendation": "PURCHASE_RECOMMENDED"
    }
  ],
  "recommendation": "PURCHASE_RECOMMENDED",
  "justification": "Your use case falls within Payment Systems...",
  "settlementRange": "$100K-$500K",
  "licensePrice": "$99/year",
  "roi": "Potential savings: $100K-$500K vs. $99 = 1,010x-5,050x ROI",
  "disclaimer": "This framework represents professional judgment..."
}
Agent Decision Logic:
// Example: Agent uses risk score to make purchase decision
const assessment = await fetch('/api/risk/assess', {...});
const { riskScore, recommendation } = await assessment.json();

if (recommendation === 'CRITICAL_PURCHASE' || riskScore >= 7.0) {
  // Auto-purchase license
  await purchaseBrolliLicense();
  return { status: 'PROTECTED', cost: 99 };
} else if (riskScore >= 5.0) {
  // Request human approval
  await notifyTeam('Patent risk detected. Recommend license purchase.');
}

Available Verticals

payments - Payment Systems
Stablecoins, cross-border transfers, payment processing (1,243 patents, HIGH risk)
lending - Lending & Borrowing
Collateralized lending, interest protocols (892 patents, CRITICAL risk)
dex - Decentralized Exchange
AMMs, liquidity pools, swap protocols (734 patents, MEDIUM_HIGH risk)
nft - NFT & Tokenization
NFT minting, metadata, royalties (523 patents, MEDIUM risk)
rwa - Real World Assets
Tokenized securities, commodities (678 patents, HIGH risk)

Purchase License via x402

After assessing risk, agents can purchase licenses autonomously using x402 payment protocol:

import { X402Client } from "x402-next/client";

// Initialize x402 client
const client = new X402Client({
  privateKey: process.env.AGENT_PRIVATE_KEY,
  network: "eip155:8453" // Base mainnet
});

// Purchase license (x402 handles USDC payment automatically)
const response = await client.fetch(
  "https://brolli.vercel.app/api/license/authorize",
  {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({ 
      beneficiary: "0xYOUR_WALLET_ADDRESS" 
    })
  }
);

const { voucher, signature } = await response.json();

// License purchased! Use voucher to mint on-chain
console.log('License voucher received:', voucher);

Verify License On-Chain

After purchase, agents can verify license validity programmatically:

import { ethers } from "ethers";

const BROLLI_ADDRESS = "0xF44d5712826Eca7429ccf7F2fEa4b61f089e3Ea0";
const BROLLI_ABI = [
  "function hasLicense(address who) view returns (bool)",
  "function licenseExpiry(address who) view returns (uint256)"
];

const provider = new ethers.JsonRpcProvider("https://mainnet.base.org");
const contract = new ethers.Contract(BROLLI_ADDRESS, BROLLI_ABI, provider);

// Check if wallet has valid license
const hasLicense = await contract.hasLicense("0xWALLET_ADDRESS");
const expiry = await contract.licenseExpiry("0xWALLET_ADDRESS");

console.log('License valid:', hasLicense);
console.log('Expires:', new Date(Number(expiry) * 1000));

Rate Limits

Risk assessment API: Unlimited requests
License purchase API: Rate limited by x402 protocol (see Coinbase x402 docs)

Support

For questions or issues, please open an issue on our GitHub repository

© Optilex, LLC·X·GitHub·Terms·Privacy