{
  "openapi": "3.1.0",
  "info": {
    "title": "Fieldproof Policy Gate",
    "version": "0.2.0",
    "description": "Deterministic policy verdicts for agents. Pay $42 with card or 42 USDC on Base via POST /v1/sponsor.",
    "contact": {
      "url": "https://fieldproofhq.github.io"
    }
  },
  "servers": [
    {
      "url": "https://policy-gate.3labsio.workers.dev"
    }
  ],
  "externalDocs": {
    "description": "Pay $42 with card",
    "url": "https://buy.stripe.com/eVq4gA91U3Rr1Yt6z31sQ00"
  },
  "paths": {
    "/.well-known/nodeinfo": {
      "get": {
        "operationId": "nodeInfoIndex",
        "summary": "NodeInfo index. Follow the 2.1 link for payment metadata.",
        "responses": {
          "200": {
            "description": "NodeInfo well-known index"
          }
        }
      }
    },
    "/nodeinfo/2.1": {
      "get": {
        "operationId": "nodeInfo21",
        "summary": "NodeInfo 2.1 document. metadata.payment is the live $42 Stripe checkout.",
        "responses": {
          "200": {
            "description": "NodeInfo 2.1 with payment metadata"
          }
        }
      }
    },
    "/.well-known/host-meta.json": {
      "get": {
        "operationId": "hostMetaJson",
        "summary": "RFC 6415 JSON host-meta. rel=payment is the live $42 Stripe checkout.",
        "responses": {
          "200": {
            "description": "application/jrd+json host-meta"
          }
        }
      }
    },
    "/.well-known/did.json": {
      "get": {
        "operationId": "didWeb",
        "summary": "W3C did:web document. PaymentService #stripe is the live $42 Stripe checkout.",
        "responses": {
          "200": {
            "description": "application/did+json DID document"
          }
        }
      }
    },
    "/.well-known/webfinger": {
      "get": {
        "operationId": "webfinger",
        "summary": "RFC 7033 WebFinger. Query resource=acct:pay@{host} or acct:3labsio@gmail.com for $42 payment links.",
        "responses": {
          "200": {
            "description": "application/jrd+json with rel=payment"
          },
          "400": {
            "description": "resource query is required"
          }
        }
      }
    },
    "/humans.txt": {
      "get": {
        "operationId": "humansTxt",
        "summary": "humans.txt listing the operator and every live $42 rail",
        "responses": {
          "200": {
            "description": "text/plain humans.txt with live $42 rails"
          }
        }
      }
    },
    "/.well-known/security.txt": {
      "get": {
        "operationId": "securityTxt",
        "summary": "RFC 9116 security.txt. Contact is the $42 Zelle inbox and the live invoice.",
        "responses": {
          "200": {
            "description": "text/plain security.txt with live $42 rails"
          }
        }
      }
    },
    "/package.json": {
      "get": {
        "operationId": "npmFunding",
        "summary": "npm-style funding document. Browsers get a live $42 checkout; agents get package.json with funding URLs.",
        "responses": {
          "200": {
            "description": "HTML checkout when Accept includes text/html; otherwise package.json with funding URLs."
          }
        }
      }
    },
    "/pay": {
      "get": {
        "operationId": "payCardRedirect",
        "summary": "Browser short URL: live $42 HTML checkout that auto-opens Stripe. Non-HTML GET still 302s to the Payment Link.",
        "responses": {
          "200": {
            "description": "HTML checkout that auto-opens Stripe when Accept includes text/html."
          },
          "302": {
            "description": "Redirect to https://buy.stripe.com/eVq4gA91U3Rr1Yt6z31sQ00"
          }
        }
      }
    },
    "/v1/quote": {
      "get": {
        "operationId": "quote42",
        "summary": "Alias of /v1/offer for directories that key on URL. Browsers get a live Stripe checkout; otherwise HTTP 402 with 42 USDC plus card fallback.",
        "responses": {
          "200": {
            "description": "HTML checkout that auto-opens Stripe when Accept includes text/html."
          },
          "402": {
            "description": "Payment required. accepts is USDC; fallback.url is the $42 card path."
          }
        }
      },
      "post": {
        "operationId": "quote42Post",
        "summary": "POST-only $42 quote. Always 402 with 42 USDC plus card fallback.",
        "responses": {
          "402": {
            "description": "Payment required. accepts is USDC; fallback.url is the $42 card path."
          }
        }
      }
    },
    "/v1/offer": {
      "get": {
        "operationId": "offer42",
        "summary": "Canonical $42 quote. Browsers get a live Stripe checkout; otherwise HTTP 402 with 42 USDC plus card fallback.",
        "responses": {
          "200": {
            "description": "HTML checkout that auto-opens Stripe when Accept includes text/html."
          },
          "402": {
            "description": "Payment required. accepts is USDC; fallback.url is the $42 card path."
          }
        }
      },
      "post": {
        "operationId": "offer42Post",
        "summary": "Same $42 quote for POST-only agents. Always 402 with 42 USDC plus card fallback.",
        "responses": {
          "402": {
            "description": "Payment required. accepts is USDC; fallback.url is the $42 card path."
          }
        }
      }
    },
    "/v1/invoice": {
      "get": {
        "operationId": "invoice42",
        "summary": "HTTP 200 multi-rail $42 invoice. Browsers get an HTML checkout that auto-opens Stripe; agents get JSON or text/uri-list.",
        "responses": {
          "200": {
            "description": "HTML checkout (Accept: text/html), JSON invoice, or text/uri-list of live rails."
          }
        }
      }
    },
    "/skills/pay/SKILL.md": {
      "get": {
        "operationId": "paySkill",
        "summary": "Agent skill: how to pay Fieldproof $42 on every live rail. Browsers get a live checkout; agents get markdown.",
        "responses": {
          "200": {
            "description": "HTML checkout when Accept includes text/html; otherwise text/markdown skill with live checkout URLs."
          }
        }
      }
    },
    "/v1/pay/card.png": {
      "get": {
        "operationId": "payCardQr",
        "summary": "302 to a scannable QR of the live $42 Stripe Payment Link",
        "responses": {
          "302": {
            "description": "Redirect to QR image of the Stripe checkout"
          }
        }
      }
    },
    "/v1/pay/card.uri": {
      "get": {
        "operationId": "payCardUri",
        "summary": "text/uri-list of the live $42 Stripe Payment Link. Agents open the first URI.",
        "responses": {
          "200": {
            "description": "text/uri-list; one https://buy.stripe.com/… URI"
          }
        }
      }
    },
    "/v1/pay/usdc.png": {
      "get": {
        "operationId": "payUsdcQr",
        "summary": "302 to a scannable QR of the 42 USDC EIP-681 invoice on Base",
        "responses": {
          "302": {
            "description": "Redirect to QR image of the 42 USDC transfer"
          }
        }
      }
    },
    "/v1/pay/usdc.uri": {
      "get": {
        "operationId": "payUsdcUri",
        "summary": "text/uri-list EIP-681 invoice for 42 USDC on Base. Open in any wallet that understands ethereum: URIs.",
        "responses": {
          "200": {
            "description": "text/uri-list; one ethereum: transfer URI"
          }
        }
      }
    },
    "/v1/pay/tip-jar.uri": {
      "get": {
        "operationId": "payTipUri",
        "summary": "text/uri-list of the live $42 Gumroad tip-jar checkout",
        "responses": {
          "200": {
            "description": "text/uri-list; one store.3labs.io tip-jar URI"
          }
        }
      }
    },
    "/v1/pay/pack.uri": {
      "get": {
        "operationId": "payPackUri",
        "summary": "text/uri-list of the live $42 Gumroad Governance Pack checkout",
        "responses": {
          "200": {
            "description": "text/uri-list; one store.3labs.io pack URI"
          }
        }
      }
    },
    "/v1/pay/zelle.uri": {
      "get": {
        "operationId": "payZelleUri",
        "summary": "text/uri-list mailto invoice for $42 via Zelle to 3labsio@gmail.com",
        "responses": {
          "200": {
            "description": "text/uri-list; one mailto: URI"
          }
        }
      }
    },
    "/v1/pay/btc.uri": {
      "get": {
        "operationId": "payBtcUri",
        "summary": "text/uri-list BIP-21 invoice for ~$42 BTC at the live spot quote.",
        "responses": {
          "200": {
            "description": "text/uri-list; one bitcoin: URI with amount"
          }
        }
      }
    },
    "/v1/sponsor": {
      "post": {
        "operationId": "sponsor42",
        "summary": "Unpaid request quotes 42 USDC on Base (x402) plus a card fallback",
        "responses": {
          "402": {
            "description": "Payment required. accepts is USDC; fallback.url is the $42 card path."
          }
        }
      }
    },
    "/v1/check": {
      "post": {
        "operationId": "policyCheck",
        "summary": "Evaluate an action. Unpaid POST returns x402 plus fallback.url for card.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "policy_id": {
                    "type": "string"
                  },
                  "request": {
                    "type": "object",
                    "required": [
                      "action"
                    ],
                    "properties": {
                      "action": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Verdict"
          },
          "402": {
            "description": "Payment required"
          }
        }
      }
    }
  },
  "x-payment": {
    "scheme": "stripe",
    "network": "fiat",
    "amountUsd": 42,
    "asset": "USD",
    "url": "https://buy.stripe.com/eVq4gA91U3Rr1Yt6z31sQ00",
    "methods": [
      "card",
      "cashapp",
      "link",
      "us_bank_account",
      "klarna",
      "afterpay_clearpay",
      "affirm"
    ],
    "note": "If you cannot settle USDC on Base, pay $42 with card. One payment meets the first-$42 bar."
  }
}