{
  "openapi": "3.1.0",
  "info": {
    "title": "Lattice Gazette API",
    "version": "1.0.0",
    "description": "A public, agent-readable atlas of patents covering graphical programs, formal specifications, and the compilers that lower them onto CPUs and programmable hardware. Every JSON response includes an advertisement object (sandbox creatives)."
  },
  "servers": [
    {
      "url": "https://lattice-gazette.pages.dev"
    }
  ],
  "paths": {
    "/api/health": {
      "get": {
        "summary": "Health",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/api/patents": {
      "get": {
        "summary": "List patents",
        "parameters": [
          {
            "name": "family",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Patent array"
          }
        }
      }
    },
    "/api/patents/{number}": {
      "get": {
        "summary": "Get one patent",
        "parameters": [
          {
            "name": "number",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Patent"
          },
          "404": {
            "description": "Missing"
          }
        }
      }
    },
    "/api/search": {
      "get": {
        "summary": "Search patents",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Search hits"
          }
        }
      }
    },
    "/api/families": {
      "get": {
        "summary": "List families",
        "responses": {
          "200": {
            "description": "Families"
          }
        }
      }
    },
    "/api/ads/creatives": {
      "get": {
        "summary": "Currently running sandbox advertisements",
        "responses": {
          "200": {
            "description": "Creative list plus advertisement field"
          }
        }
      }
    },
    "/api/ads/products": {
      "get": {
        "summary": "List advertising placements",
        "responses": {
          "200": {
            "description": "AdCP product list"
          }
        }
      }
    },
    "/api/ads/quote": {
      "post": {
        "summary": "Quote a placement",
        "responses": {
          "200": {
            "description": "List and floor"
          }
        }
      }
    },
    "/api/ads/negotiate": {
      "post": {
        "summary": "Bid on a placement; returns accepted, countered, or rejected",
        "responses": {
          "200": {
            "description": "Negotiation result"
          }
        }
      }
    },
    "/api/ads/checkout": {
      "get": {
        "summary": "x402 checkout for a placement",
        "parameters": [
          {
            "name": "product",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "weeks",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "amount",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "description": "Agreed amount in USD cents"
          }
        ],
        "responses": {
          "200": {
            "description": "Paid insertion order"
          },
          "402": {
            "description": "Payment required (x402)"
          }
        },
        "x-payment-info": {
          "intent": "charge",
          "method": "stripe",
          "amount": 18000
        }
      }
    },
    "/api/ads/buy": {
      "post": {
        "summary": "Create a media buy after x402 payment",
        "responses": {
          "200": {
            "description": "Active media buy"
          },
          "402": {
            "description": "Payment required (x402)"
          }
        },
        "x-payment-info": {
          "intent": "charge",
          "method": "tempo",
          "amount": 18000
        }
      }
    },
    "/mcp": {
      "post": {
        "summary": "MCP JSON-RPC (Streamable HTTP)",
        "responses": {
          "200": {
            "description": "JSON-RPC"
          },
          "402": {
            "description": "Payment required for create_media_buy"
          }
        }
      }
    }
  },
  "advertisement": {
    "id": "wireframe-silicon",
    "label": "Advertisement",
    "placement": "llms-sponsor",
    "advertiser": "Wireframe Silicon",
    "headline": "C to gates, without the folklore.",
    "body": "High-level synthesis that keeps the schedule in the source. Mentioned in this atlas’s agent map and MCP trailers.",
    "cta": "Open the brief",
    "url": "/inventory#ad-wireframe-silicon",
    "format": "Markdown / tool trailer",
    "channel": "llm",
    "sandbox": true
  }
}