{
  "openapi": "3.1.0",
  "info": {
    "title": "Brazil AI & x402 API Suite",
    "version": "2.4.1",
    "description": "9 serverless edge APIs for autonomous AI agents monetized via x402 v2 (USDC on Base)."
  },
  "servers": [
    {
      "url": "https://api.brunopompeo.com.br"
    }
  ],
  "paths": {
    "/health": {
      "get": {
        "summary": "Free health check",
        "responses": {
          "200": {
            "description": "Gateway healthy"
          }
        }
      }
    },
    "/guard": {
      "post": {
        "operationId": "agent_guard",
        "summary": "Agent Guard — Prompt Injection & PII Firewall ($0.008 USDC via x402 v2)",
        "description": "Detects prompt injection, jailbreaks, secret leaks and Brazilian PII (CPF/CNPJ/email/phone) with deterministic + edge AI scoring.",
        "responses": {
          "200": {
            "description": "Structured JSON result after x402 payment settlement"
          },
          "402": {
            "description": "Payment Required — x402 v2 PAYMENT-REQUIRED header (USDC on Base)"
          }
        }
      }
    },
    "/send": {
      "post": {
        "operationId": "agent_email",
        "summary": "Agent Email — Transactional Email for AI Agents ($0.005 USDC via x402 v2)",
        "description": "Pay-per-send transactional email API for autonomous agents with built-in dryRun validation mode and delivery receipts.",
        "responses": {
          "200": {
            "description": "Structured JSON result after x402 payment settlement"
          },
          "402": {
            "description": "Payment Required — x402 v2 PAYMENT-REQUIRED header (USDC on Base)"
          }
        }
      }
    },
    "/clean": {
      "get": {
        "operationId": "web_enrichment",
        "summary": "Web Enrichment — Clean Markdown & Structured Extraction ($0.002 USDC via x402 v2)",
        "description": "Converts noisy web pages into clean, token-optimized Markdown/JSON for LLM context windows with up to 85% token reduction.",
        "responses": {
          "200": {
            "description": "Structured JSON result after x402 payment settlement"
          },
          "402": {
            "description": "Payment Required — x402 v2 PAYMENT-REQUIRED header (USDC on Base)"
          }
        }
      }
    },
    "/audit": {
      "post": {
        "operationId": "br_nfe_xml_auditor",
        "summary": "BR NF-e XML Auditor — Brazilian Electronic Invoice Compliance ($0.01 USDC via x402 v2)",
        "description": "Audits Brazilian NF-e / NFC-e XML invoices for structural, fiscal (ICMS, PIS, COFINS, CFOP, NCM) and IBS/CBS tax reform compliance.",
        "responses": {
          "200": {
            "description": "Structured JSON result after x402 payment settlement"
          },
          "402": {
            "description": "Payment Required — x402 v2 PAYMENT-REQUIRED header (USDC on Base)"
          }
        }
      }
    },
    "/generate": {
      "post": {
        "operationId": "br_danfse_rtc",
        "summary": "BR DANFSE RTC — NFS-e Nacional 2026 HTML/PDF Generator ($0.005 USDC via x402 v2)",
        "description": "Generates compliant Brazilian DANFSE Nacional (RTC 2026 IBS/CBS layout) documents from structured service invoice JSON/XML.",
        "responses": {
          "200": {
            "description": "Structured JSON result after x402 payment settlement"
          },
          "402": {
            "description": "Payment Required — x402 v2 PAYMENT-REQUIRED header (USDC on Base)"
          }
        }
      }
    },
    "/parse": {
      "post": {
        "operationId": "br_docs_parser",
        "summary": "BR Docs Parser — Boletos, PIX, CPF/CNPJ & Bank Slip Parser ($0.008 USDC via x402 v2)",
        "description": "Parses and validates Brazilian financial documents: boletos (linha digitável/código de barras), PIX EMV payloads, CPF, CNPJ and CEP.",
        "responses": {
          "200": {
            "description": "Structured JSON result after x402 payment settlement"
          },
          "402": {
            "description": "Payment Required — x402 v2 PAYMENT-REQUIRED header (USDC on Base)"
          }
        }
      }
    },
    "/calc": {
      "post": {
        "operationId": "br_tax_payroll_calc",
        "summary": "BR Tax & Payroll Calc — CLT, INSS, IRRF, FGTS & Simples Nacional ($0.008 USDC via x402 v2)",
        "description": "Deterministic Brazilian payroll and tax calculators: net CLT salary, 13th salary, vacation, termination, INSS/IRRF progressive brackets and Simples Nacional.",
        "responses": {
          "200": {
            "description": "Structured JSON result after x402 payment settlement"
          },
          "402": {
            "description": "Payment Required — x402 v2 PAYMENT-REQUIRED header (USDC on Base)"
          }
        }
      }
    },
    "/intel": {
      "post": {
        "operationId": "br_business_intel",
        "summary": "BR Business Intel — CNPJ Registry & Risk Intelligence ($0.01 USDC via x402 v2)",
        "description": "Enriches Brazilian companies (CNPJ) with official registration status, QSA partners, CNAE activities, address and structured KYC risk signals.",
        "responses": {
          "200": {
            "description": "Structured JSON result after x402 payment settlement"
          },
          "402": {
            "description": "Payment Required — x402 v2 PAYMENT-REQUIRED header (USDC on Base)"
          }
        }
      }
    },
    "/fin": {
      "post": {
        "operationId": "br_fin_calculators",
        "summary": "BR Financial Calculators — SAC, Price, CDI/Selic & Compound Interest ($0.005 USDC via x402 v2)",
        "description": "Deterministic Brazilian financial math: SAC/Price loan amortization schedules, CET, compound interest, inflation adjustment and fixed-income yields.",
        "responses": {
          "200": {
            "description": "Structured JSON result after x402 payment settlement"
          },
          "402": {
            "description": "Payment Required — x402 v2 PAYMENT-REQUIRED header (USDC on Base)"
          }
        }
      }
    }
  }
}