{
  "openapi": "3.1.0",
  "info": {
    "title": "ToolMint USPTO Patents JSON",
    "version": "0.1.0",
    "description": "US patent applications and grants (USPTO Open Data Portal) as flat JSON for AI agents. Pay per call with USDC on Base via x402. Not an official USPTO product; not legal advice.",
    "x-guidance": "GET /patents/search with at least one of q, title, applicant, inventor, cpc; optional status (any|granted|not_granted), filedFrom/filedTo/grantedFrom/grantedTo (YYYY-MM-DD), sort, limit (1-25), offset. GET /patents/application/{applicationNumber} or /patents/number/{patentNumber} for one record. Unpaid calls receive HTTP 402 (USDC on Base). 4xx/5xx are never charged; zero results is a valid 200.",
    "contact": {
      "email": "toolmint.dev@gmail.com",
      "name": "ToolMint"
    }
  },
  "paths": {
    "/health": {
      "get": {
        "operationId": "health",
        "summary": "Liveness",
        "security": [],
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/patents/search": {
      "get": {
        "operationId": "uspto_patents_search",
        "summary": "Search US patent applications and grants",
        "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": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "title",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "applicant",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "inventor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 120
            }
          },
          {
            "name": "cpc",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^[A-HY](\\d{2}([A-Z](\\d{1,4}(/\\d{1,6})?)?)?)?$"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "any",
                "granted",
                "not_granted"
              ],
              "default": "any"
            }
          },
          {
            "name": "filedFrom",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "filedTo",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "grantedFrom",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "grantedTo",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "filed_desc",
                "filed_asc",
                "granted_desc"
              ],
              "default": "filed_desc"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 25,
              "default": 10
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9975,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Flat results with provenance + attribution"
          },
          "400": {
            "description": "Bad parameters (not charged)"
          },
          "402": {
            "description": "Payment Required"
          },
          "502": {
            "description": "USPTO upstream error (not charged)"
          },
          "503": {
            "description": "Data source not configured or rate-limited (not charged)"
          }
        }
      }
    },
    "/patents/application/{applicationNumber}": {
      "get": {
        "operationId": "uspto_application",
        "summary": "One application by application number",
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.005000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ],
          "network": "eip155:8453",
          "payTo": "0xfbF7413bcB3a604936775C96FDbe0b0C9c9E37F5",
          "asset": "USDC",
          "scheme": "exact",
          "amountAtomic": "5000"
        },
        "parameters": [
          {
            "name": "applicationNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One flat record"
          },
          "400": {
            "description": "Bad parameters (not charged)"
          },
          "402": {
            "description": "Payment Required"
          },
          "404": {
            "description": "No such application (not charged)"
          },
          "502": {
            "description": "USPTO upstream error (not charged)"
          },
          "503": {
            "description": "Data source not configured or rate-limited (not charged)"
          }
        }
      }
    },
    "/patents/number/{patentNumber}": {
      "get": {
        "operationId": "uspto_patent",
        "summary": "One granted patent by patent number",
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.005000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ],
          "network": "eip155:8453",
          "payTo": "0xfbF7413bcB3a604936775C96FDbe0b0C9c9E37F5",
          "asset": "USDC",
          "scheme": "exact",
          "amountAtomic": "5000"
        },
        "parameters": [
          {
            "name": "patentNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One flat record"
          },
          "400": {
            "description": "Bad parameters (not charged)"
          },
          "402": {
            "description": "Payment Required"
          },
          "404": {
            "description": "No such patent (not charged)"
          },
          "502": {
            "description": "USPTO upstream error (not charged)"
          },
          "503": {
            "description": "Data source not configured or rate-limited (not charged)"
          }
        }
      }
    }
  }
}