{
  "openapi": "3.1.0",
  "info": {
    "title": "ToolMint USAspending Awards JSON",
    "version": "0.1.0",
    "description": "US federal awards (USAspending.gov: contracts, IDVs, grants, loans, other assistance) as normalized JSON for AI agents. Pay per search with USDC on Base via x402. Not an official Treasury product.",
    "x-guidance": "Use GET /awards with awardType (contracts default) and any of q, recipient, agency, naics, state, startDate, endDate (YYYY-MM-DD), minAmount, maxAmount, sort, order, page (1-based), limit (1-100). Unpaid calls receive HTTP 402 with x402 payment requirements (USDC on Base). Bad params (incl. unknown agency) return 400 and are not charged. Zero results is a valid 200. Free: /, /health, /openapi.json, /.well-known/x402.",
    "contact": {
      "email": "toolmint.dev@gmail.com",
      "name": "ToolMint"
    }
  },
  "paths": {
    "/health": {
      "get": {
        "operationId": "health",
        "summary": "Liveness",
        "security": [],
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/awards": {
      "get": {
        "operationId": "usaspending_awards_search",
        "summary": "Search USAspending.gov federal awards",
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.010000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ],
          "network": "eip155:8453",
          "payTo": "0xfbF7413bcB3a604936775C96FDbe0b0C9c9E37F5",
          "asset": "USDC",
          "scheme": "exact",
          "amountAtomic": "10000"
        },
        "parameters": [
          {
            "name": "awardType",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "contracts",
                "idvs",
                "grants",
                "loans",
                "direct_payments",
                "other_financial_assistance"
              ],
              "default": "contracts"
            }
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 300
            }
          },
          {
            "name": "recipient",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 3,
              "maxLength": 100
            }
          },
          {
            "name": "agency",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 120
            }
          },
          {
            "name": "naics",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^\\d{2,6}$"
            }
          },
          {
            "name": "state",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z]{2}$"
            }
          },
          {
            "name": "startDate",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "minAmount",
            "in": "query",
            "schema": {
              "type": "number",
              "minimum": 0
            }
          },
          {
            "name": "maxAmount",
            "in": "query",
            "schema": {
              "type": "number",
              "minimum": 0
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "amount",
                "startDate",
                "endDate",
                "lastModified"
              ],
              "default": "amount"
            }
          },
          {
            "name": "order",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "desc",
                "asc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Normalized awards with provenance + terms"
          },
          "400": {
            "description": "Bad parameters (not charged)"
          },
          "402": {
            "description": "Payment Required"
          },
          "502": {
            "description": "Upstream USAspending error (not charged)"
          }
        }
      }
    }
  }
}