{
  "openapi": "3.1.0",
  "info": {
    "title": "Tenhatch Checks API",
    "version": "1.1.0",
    "summary": "Trade-rule checks AI agents call before they act.",
    "description": "Tenhatch Checks answers the questions a trade rule makes a business ask before it acts, for AI agents and the people who run them: is this text reply an opt-out under the FCC rule in force from November 25, 2026 (free); does this German e-invoice pass the EN 16931 and XRechnung rules; what Australian fuel tax credit rate applies on a day; what deposit a drink container carries in Ireland, the UK or Australia; and does FDA have records that may be about a foreign food supplier. One remote MCP server and a REST API. Every answer carries the rule it rests on, with its official link and exact words, and a signed, dated receipt anyone can verify with the published key. Not legal or tax advice.\n\n## Authentication\nSend an API key as `Authorization: Bearer <key>` (or `X-API-Key`). Keys are created on the account page (https://checks.tenhatch.com/app/api-keys), or come with prepaid credits an agent buys itself (POST /api/v1/credits). Signed-in browser sessions work too. The opt-out check, the catalog, the rule records and the receipts need no key.\n\n## Opening\nBuying opens in January 2027. Until then the catalog, the rule records, the receipt format and keys, the credit packs and the MCP server’s free tools answer; the checks answer 503 not_open.\n\n## Credits\nOne credit is one cent of list price: sms-opt-out uses 0, fda-supplier uses 2, de-einvoice uses 1, au-fuel-tax-credit-rate uses 1, deposit-rate uses 1. The free tier has 50 credits a month; Checks: 1,000 credits, $9/month. Prepaid packs, bought once with a Stripe Shared Payment Token: 1,000 credits for $10, 5,000 credits for $50. When the plan's and the prepaid credits are used up, checks answer 402.\nAgents should send `x-usage-source: agent`; it changes attribution only.\n\n## Receipts\nEvery answer carries a receipt signed with Ed25519 over its canonical JSON (object keys sorted at every level, no spaces). The format and a test vector are at /.well-known/tenhatch-checks-receipt.json; the public keys at /.well-known/tenhatch-checks-keys.json.\n\n## The MCP server\nThe same checks are MCP tools at https://checks.tenhatch.com/mcp (Streamable HTTP); https://checks.tenhatch.com/mcp/free has the free tools only. Server card: https://checks.tenhatch.com/.well-known/mcp/server-card.json.\n\nNot legal advice. Support: support@tenhatch.com. Machine-readable product summary: https://checks.tenhatch.com/.well-known/product.json",
    "contact": {
      "name": "Tenhatch Checks support",
      "email": "support@tenhatch.com",
      "url": "https://checks.tenhatch.com"
    },
    "termsOfService": "https://checks.tenhatch.com/legal/terms",
    "x-pricing": {
      "currency": "usd",
      "unit": "credit",
      "centsPerCredit": 1,
      "freeCreditsPerMonth": 50,
      "plans": [
        {
          "planId": "checks",
          "name": "Checks",
          "monthly": "$9/month",
          "annual": "$90/year",
          "annualPerMonth": "$7.50/month",
          "savingsPercent": 17,
          "savings": "$18",
          "creditsPerMonth": 1000
        }
      ],
      "creditPacks": [
        {
          "id": "credits-1000",
          "credits": 1000,
          "priceCents": 1000
        },
        {
          "id": "credits-5000",
          "credits": 5000,
          "priceCents": 5000
        }
      ],
      "opens": "2027-01",
      "refundWindowDays": 14
    }
  },
  "servers": [
    {
      "url": "https://checks.tenhatch.com",
      "description": "Production"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    },
    {
      "apiKeyHeader": []
    }
  ],
  "tags": [
    {
      "name": "checks",
      "description": "The checks (the opt-out check is free; the others use credits)"
    },
    {
      "name": "free",
      "description": "The catalog, the rule records and the receipts (no key, no credits)"
    },
    {
      "name": "credits",
      "description": "Prepaid credits an agent buys with no person (opens January 2027)"
    },
    {
      "name": "account",
      "description": "Account, usage and API keys"
    },
    {
      "name": "meta",
      "description": "Documents about the API itself"
    }
  ],
  "paths": {
    "/api/v1/checks": {
      "get": {
        "tags": [
          "free"
        ],
        "operationId": "listChecks",
        "summary": "Every check, its credits, input, rules and endpoint",
        "security": [],
        "responses": {
          "200": {
            "description": "The catalog.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Catalog"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/checks/sms-opt-out": {
      "post": {
        "tags": [
          "checks"
        ],
        "operationId": "smsOptOut",
        "summary": "Is this text reply an opt-out?",
        "description": "Is this text reply an opt-out under the FCC rule in force from November 25, 2026 (47 CFR 64.1200(a)(10) and (a)(11), as amended by FCC 26-67)?\n\nFor: Businesses in the United States that send marketing or informational texts, and the agents that read the replies for them.\n\nInput: A JSON object with `text`: the reply exactly as it was received (1 to 2,000 characters); optionally `exclusiveMethod` (\"reply-words\" if you designated replying with one of the seven words as your only way to opt out and disclose it in each text, or \"none\") and `messageKind` (\"marketing\" or \"informational\", the text the reply answers).\n\nOutput: The `answer` (opt_out, unclear, not_opt_out or no_rule_word), the rule’s words found, the rule version applied, what the answer means, how soon an opt-out must be honored, what it covers, the rule record and a signed receipt.\n\nFree: no key and no credits (limited per address without a key). It still returns a signed receipt.\n\n- Free: it uses no credits and needs no key. StopNoted keeps a business’s opt-outs and its proof.\n- It reads the words of one text and relies on what you say you designated and disclosed; it does not read intent.\n- \"unclear\" means a rule word appears with other words around it, and \"no_rule_word\" that none appears while any reasonable request still counts: a person or the agent reads it.\n- The text is never stored: the receipt keeps only its SHA-256 fingerprint.",
        "parameters": [
          {
            "name": "x-usage-source",
            "in": "header",
            "required": false,
            "description": "Set to `agent` when the caller is an AI agent or MCP client.",
            "schema": {
              "type": "string",
              "enum": [
                "agent",
                "api"
              ]
            }
          }
        ],
        "security": [
          {},
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SmsOptOutInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The answer, its signed receipt and how it was metered.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (see `error.message`). Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key / session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "This month’s plan credits and the prepaid credits are used up, or, with no key, the x402 quote: the `payment-required` header carries the price in USDC and the address to pay; pay, then call again with the `payment-signature` header (open only when the pay door is open). Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Honour Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error; retry with backoff.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The check cannot answer right now (for example its product is not open yet). Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-credits": 0,
        "x-mcp-tool": "check_sms_opt_out",
        "x-rules": [
          "us-fcc-47-cfr-64-1200-a-10"
        ]
      }
    },
    "/api/v1/checks/fda-supplier": {
      "post": {
        "tags": [
          "checks"
        ],
        "operationId": "fdaSupplier",
        "summary": "FDA records on a foreign food supplier",
        "description": "Does FDA have import refusals, compliance actions (warning letters, seizures, injunctions) or food recalls that may be about this foreign food supplier?\n\nFor: US food importers with a Foreign Supplier Verification Program, and the agents that vet suppliers for them (21 CFR 1.505(c)).\n\nInput: A JSON object with the supplier’s `name` and `country` (a name or a two-letter code), and optionally its `fei` number, `city` and `lookbackDays` (1 to 1095, default 1095).\n\nOutput: The `answer` (records_found, no_records_found or incomplete), the FDA records that may be about the supplier (`candidates`, each with its own words and link, for a person to confirm), each FDA source read with its data date (`sources`), the import alert link (not checked), the rule record and a signed receipt.\n\nUses 2 credits: the month’s plan credits first, then prepaid credits. A check that cannot answer is never charged.\n\n- Import alerts are not checked: FDA publishes them only as web pages, with no API. Every answer links FDA’s list.\n- A record is listed because it may be about the supplier. A person confirms or dismisses it; the check never says a supplier is in trouble or clear.\n- Answers come from FSVPWatch’s copy of the FDA sources, updated every night; each source’s data date is in the answer.",
        "parameters": [
          {
            "name": "x-usage-source",
            "in": "header",
            "required": false,
            "description": "Set to `agent` when the caller is an AI agent or MCP client.",
            "schema": {
              "type": "string",
              "enum": [
                "agent",
                "api"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FdaSupplierInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The answer, its signed receipt and how it was metered.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (see `error.message`). Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key / session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "This month’s plan credits and the prepaid credits are used up, or, with no key, the x402 quote: the `payment-required` header carries the price in USDC and the address to pay; pay, then call again with the `payment-signature` header (open only when the pay door is open). Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Honour Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error; retry with backoff.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The check cannot answer right now (for example its product is not open yet). Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-credits": 2,
        "x-mcp-tool": "check_fda_supplier",
        "x-rules": [
          "21-cfr-1.505-c"
        ]
      }
    },
    "/api/v1/checks/de-einvoice": {
      "post": {
        "tags": [
          "checks"
        ],
        "operationId": "deEinvoice",
        "summary": "Does this German e-invoice pass the rules?",
        "description": "Does this German e-invoice (CII XML: an XRechnung or the XML inside a ZUGFeRD / Factur-X PDF) pass the EN 16931 and XRechnung rules?\n\nFor: Businesses that send e-invoices to German businesses, which must from January 1, 2027 (over EUR 800,000 turnover) and 2028 (all), and the agents that prepare them.\n\nInput: A JSON object with `xml`: the invoice's CII XML as text (up to 200,000 characters).\n\nOutput: The `answer` (valid, valid_with_warnings or invalid), the profile its specification identifier names, the counts and each finding (rule id, error or warning, what to fix), the rule records and a signed receipt.\n\nUses 1 credit: the month’s plan credits first, then prepaid credits. A check that cannot answer is never charged.\n\n- CII XML only: not UBL, and not a PDF (send the factur-x.xml inside it).\n- InvoiceKonform’s implementation of the rules; the official KoSIT validator is the authority. Codes it does not know are warnings, not errors.\n- Amounts of 1,000,000,000 or more cannot be read and are reported as such.\n- The invoice is never stored: the receipt keeps only its SHA-256 fingerprint.",
        "parameters": [
          {
            "name": "x-usage-source",
            "in": "header",
            "required": false,
            "description": "Set to `agent` when the caller is an AI agent or MCP client.",
            "schema": {
              "type": "string",
              "enum": [
                "agent",
                "api"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeEinvoiceInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The answer, its signed receipt and how it was metered.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (see `error.message`). Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key / session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "This month’s plan credits and the prepaid credits are used up, or, with no key, the x402 quote: the `payment-required` header carries the price in USDC and the address to pay; pay, then call again with the `payment-signature` header (open only when the pay door is open). Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Honour Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error; retry with backoff.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The check cannot answer right now (for example its product is not open yet). Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-credits": 1,
        "x-mcp-tool": "check_de_einvoice",
        "x-rules": [
          "de-ustg-14-e-invoice",
          "de-xrechnung-3-0"
        ]
      }
    },
    "/api/v1/checks/au-fuel-tax-credit-rate": {
      "post": {
        "tags": [
          "checks"
        ],
        "operationId": "auFuelTaxCreditRate",
        "summary": "Australian fuel tax credit rate on a day",
        "description": "What fuel tax credit rate did the ATO set for liquid fuel acquired on this date, for a heavy vehicle on public roads or for all other business uses?\n\nFor: Australian businesses that claim fuel tax credits (farms, transport, construction, mining) and the agents and bookkeepers that apply the rate to each fuel bill.\n\nInput: A JSON object with `date` (YYYY-MM-DD, the day the fuel was acquired) and `use` (\"heavy-vehicle\" for a heavy vehicle on public roads, or \"other\" for all other business uses).\n\nOutput: The `answer` (rate, rate_unconfirmed or not_covered), the rate in cents a litre, the road user charge, the period it applies to and why, the ATO page it comes from, the rule record and a signed receipt.\n\nUses 1 credit: the month’s plan credits first, then prepaid credits. A check that cannot answer is never charged.\n\n- Liquid fuels only (petrol, diesel and the blends that share their rate); not gaseous fuels, and not whether a use is eligible.\n- Fuel acquired from 1 July 2022. A day after the table was last checked gets the latest rate as \"rate_unconfirmed\".\n- Not tax advice. Not affiliated with the ATO.",
        "parameters": [
          {
            "name": "x-usage-source",
            "in": "header",
            "required": false,
            "description": "Set to `agent` when the caller is an AI agent or MCP client.",
            "schema": {
              "type": "string",
              "enum": [
                "agent",
                "api"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FuelTaxCreditInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The answer, its signed receipt and how it was metered.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (see `error.message`). Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key / session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "This month’s plan credits and the prepaid credits are used up, or, with no key, the x402 quote: the `payment-required` header carries the price in USDC and the address to pay; pay, then call again with the `payment-signature` header (open only when the pay door is open). Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Honour Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error; retry with backoff.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The check cannot answer right now (for example its product is not open yet). Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-credits": 1,
        "x-mcp-tool": "check_au_fuel_tax_credit_rate",
        "x-rules": [
          "au-ato-fuel-tax-credit-rates"
        ]
      }
    },
    "/api/v1/checks/deposit-rate": {
      "post": {
        "tags": [
          "checks"
        ],
        "operationId": "depositRate",
        "summary": "Drink container deposit",
        "description": "What deposit, if any, does this drink container carry in this deposit scheme on this date (Ireland’s Re-turn, the UK scheme and Wales’ own from October 1, 2027, the Australian states)?\n\nFor: Drinks producers, importers, wholesalers and retailers that charge or pass on container deposits, and the agents that price and invoice for them.\n\nInput: A JSON object with `area` (IE, ENG, NIR, SCT, WLS, NSW, ACT, QLD, WA, NT, SA, VIC, TAS), `material` (pet, aluminium, steel, glass, hdpe, carton or other), `sizeMl` and optionally `drink` (standard, wine, spirits, milk or dairy, a milk-based drink), `date` (YYYY-MM-DD, default today) and `lowVolumeLine` (UK and Wales).\n\nOutput: The `answer` (deposit, no_deposit, scheme_cost or check), the scheme, whether the container is in it and why, the deposit and its currency, the rule records used and a signed receipt.\n\nUses 1 credit: the month’s plan credits first, then prepaid credits. A check that cannot answer is never charged.\n\n- Deposit amounts are set by Ireland’s Re-turn (EUR 0.15 up to 0.5 litres, 0.25 above) and the UK scheme (20p from October 1, 2027), where any drink counts, plain milk, milk-based drinks, wine and spirits included, as SI 2025/67, regulation 3, names no exception for them; Ireland leaves out plain milk and milk-based drinks, as S.I. No. 33/2024, regulation 2, says a beverage does not include milk or other dairy-based products. In Australia the check says whether the container is in the scheme; the cost per container is set by the scheme coordinator.\n- Wales has its own scheme from October 1, 2027 (WSI 2026/103): PET, aluminium and steel at 20p (the amount Exchange for Change sets), glass at 0 pence until September 30, 2031, and \"check\" for glass after that until an amount is published. Where the official pages do not settle a container, the answer is \"check\".\n- Not legal advice. Not affiliated with any scheme operator or government.",
        "parameters": [
          {
            "name": "x-usage-source",
            "in": "header",
            "required": false,
            "description": "Set to `agent` when the caller is an AI agent or MCP client.",
            "schema": {
              "type": "string",
              "enum": [
                "agent",
                "api"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DepositInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The answer, its signed receipt and how it was metered.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (see `error.message`). Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key / session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "This month’s plan credits and the prepaid credits are used up, or, with no key, the x402 quote: the `payment-required` header carries the price in USDC and the address to pay; pay, then call again with the `payment-signature` header (open only when the pay door is open). Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Honour Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error; retry with backoff.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The check cannot answer right now (for example its product is not open yet). Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-credits": 1,
        "x-mcp-tool": "check_deposit_rate",
        "x-rules": [
          "ie-deposit-amounts",
          "ie-containers-in-scope",
          "uk-start-and-containers",
          "uk-deposit-20p",
          "uk-producer-records",
          "uk-wales",
          "uk-wales-containers",
          "uk-wales-deposit",
          "au-nsw-act-supply",
          "au-nsw-wine-spirits",
          "au-sa-wine-spirits",
          "au-nt-expansion",
          "au-wa-expansion",
          "au-qld-wine-spirits",
          "au-vic-containers",
          "au-tas-start"
        ]
      }
    },
    "/api/v1/rules": {
      "get": {
        "tags": [
          "free"
        ],
        "operationId": "listRules",
        "summary": "The rule records the checks rest on",
        "security": [],
        "responses": {
          "200": {
            "description": "Every rule record, and where the other Tenhatch products publish theirs.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "rules": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/RuleRecord"
                      }
                    },
                    "otherRuleRecords": {
                      "type": "array"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/rules/{id}": {
      "get": {
        "tags": [
          "free"
        ],
        "operationId": "getRule",
        "summary": "One rule record",
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "us-fcc-47-cfr-64-1200-a-10",
                "21-cfr-1.505-c",
                "de-ustg-14-e-invoice",
                "de-xrechnung-3-0",
                "au-ato-fuel-tax-credit-rates",
                "ie-deposit-amounts",
                "ie-containers-in-scope",
                "uk-start-and-containers",
                "uk-deposit-20p",
                "uk-producer-records",
                "uk-wales",
                "uk-wales-containers",
                "uk-wales-deposit",
                "au-nsw-act-supply",
                "au-nsw-wine-spirits",
                "au-sa-wine-spirits",
                "au-nt-expansion",
                "au-wa-expansion",
                "au-qld-wine-spirits",
                "au-vic-containers",
                "au-tas-start"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The rule record.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "rule": {
                      "$ref": "#/components/schemas/RuleRecord"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No rule has that id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/receipts/{id}": {
      "get": {
        "tags": [
          "free"
        ],
        "operationId": "getReceipt",
        "summary": "A receipt and whether its signature verifies",
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^rcpt_[0-9a-f]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The receipt, its signature and `valid`. No account details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignedReceipt"
                }
              }
            }
          },
          "404": {
            "description": "No receipt has that id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Honour Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/receipts/verify": {
      "post": {
        "tags": [
          "free"
        ],
        "operationId": "verifyReceipt",
        "summary": "Verify a receipt you hold (and, optionally, its input)",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VerifyReceiptInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Whether it is genuine.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerifyReceiptResponse"
                }
              }
            }
          },
          "400": {
            "description": "Not a receipt.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Honour Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/credits": {
      "get": {
        "tags": [
          "credits"
        ],
        "operationId": "getCredits",
        "summary": "The credit packs, whether buying is open, how to pay, and (with a key) the prepaid balance",
        "security": [
          {},
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "responses": {
          "200": {
            "description": "The packs and the sale.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "credits"
        ],
        "operationId": "buyCredits",
        "summary": "Buy a pack of prepaid credits with a Stripe Shared Payment Token (opens January 2027)",
        "description": "Without an API key, a new agent account is opened and its API key is returned once. With a key, the credits go to that account. A declined token charges nothing and grants nothing.",
        "security": [
          {},
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BuyCreditsInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Paid; the credits are on the account.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "The payment is processing; the credits arrive when it succeeds.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid pack or token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The payment was declined. Nothing was charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Honour Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Buying credits opens in January 2027. Nothing was charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/tenhatch-checks-keys.json": {
      "get": {
        "tags": [
          "free"
        ],
        "operationId": "getReceiptKeys",
        "summary": "The public keys that sign receipts (current and retired)",
        "security": [],
        "responses": {
          "200": {
            "description": "JWKs (Ed25519).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/tenhatch-checks-receipt.json": {
      "get": {
        "tags": [
          "free"
        ],
        "operationId": "getReceiptFormat",
        "summary": "The receipt format, its JSON Schema and a test vector",
        "security": [],
        "responses": {
          "200": {
            "description": "The format.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/usage": {
      "get": {
        "tags": [
          "account"
        ],
        "operationId": "getUsage",
        "summary": "Credits used this month",
        "responses": {
          "200": {
            "description": "Usage this calendar month.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageMeter"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key / session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Honour Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error; retry with backoff.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/me": {
      "get": {
        "tags": [
          "account"
        ],
        "operationId": "getAccount",
        "summary": "The calling account, its plan and limits",
        "responses": {
          "200": {
            "description": "Account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key / session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Honour Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error; retry with backoff.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/keys": {
      "get": {
        "tags": [
          "account"
        ],
        "operationId": "listApiKeys",
        "summary": "List API keys (session only)",
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Keys without secrets.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ApiKeySummary"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key / session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Honour Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error; retry with backoff.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "account"
        ],
        "operationId": "createApiKey",
        "summary": "Create an API key (session only)",
        "security": [
          {
            "session": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateApiKeyInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new key; the secret is shown once.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateApiKeyResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key / session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key limit for the plan reached.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Honour Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error; retry with backoff.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/keys/{id}": {
      "delete": {
        "tags": [
          "account"
        ],
        "operationId": "revokeApiKey",
        "summary": "Revoke an API key (session only)",
        "security": [
          {
            "session": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Revoked."
          },
          "401": {
            "description": "Missing or invalid API key / session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such key on this account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Honour Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error; retry with backoff.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/openapi.json": {
      "get": {
        "tags": [
          "meta"
        ],
        "operationId": "getOpenApi",
        "summary": "This document",
        "security": [],
        "responses": {
          "200": {
            "description": "OpenAPI 3.1 document.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "API key as a bearer token."
      },
      "apiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      },
      "session": {
        "type": "apiKey",
        "in": "cookie",
        "name": "session",
        "description": "Browser session of a signed-in user."
      }
    },
    "schemas": {
      "SmsOptOutInput": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000,
            "description": "The text reply exactly as it was received (1 to 2,000 characters). Never stored."
          },
          "exclusiveMethod": {
            "description": "\"reply-words\" if you designated replying with one of the seven standardized words as your only way to opt out and disclose it in each text; \"none\" if you designated no exclusive way (the default). From November 25, 2026.",
            "type": "string",
            "enum": [
              "reply-words",
              "none"
            ]
          },
          "messageKind": {
            "description": "What the text being replied to was: \"marketing\" or \"informational\". It decides what an opt-out covers.",
            "type": "string",
            "enum": [
              "marketing",
              "informational"
            ]
          }
        },
        "required": [
          "text"
        ],
        "description": "Input of sms-opt-out: one text reply."
      },
      "FdaSupplierInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "The foreign supplier’s name, as you have it. Never stored."
          },
          "country": {
            "type": "string",
            "minLength": 2,
            "maxLength": 100,
            "description": "The supplier’s country: a name (\"Vietnam\") or a two-letter code (\"VN\")."
          },
          "fei": {
            "description": "The supplier’s FDA Establishment Identifier (FEI number), digits, if you know it.",
            "type": "string",
            "maxLength": 20
          },
          "city": {
            "description": "The supplier’s city.",
            "type": "string",
            "maxLength": 100
          },
          "lookbackDays": {
            "description": "How many days of FDA records to look at, ending today (default 1095, three years).",
            "type": "integer",
            "minimum": 1,
            "maximum": 1095
          }
        },
        "required": [
          "name",
          "country"
        ],
        "description": "Input of fda-supplier: one foreign food supplier."
      },
      "DeEinvoiceInput": {
        "type": "object",
        "properties": {
          "xml": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200000,
            "description": "The e-invoice’s CII XML as text: an XRechnung in CII syntax, or the factur-x.xml inside a ZUGFeRD / Factur-X PDF. Never stored."
          }
        },
        "required": [
          "xml"
        ],
        "description": "Input of de-einvoice: one CII e-invoice."
      },
      "FuelTaxCreditInput": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "format": "date",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
            "description": "The day the fuel was acquired (YYYY-MM-DD)."
          },
          "use": {
            "type": "string",
            "enum": [
              "heavy-vehicle",
              "other"
            ],
            "description": "\"heavy-vehicle\": a heavy vehicle (over 4.5 tonnes) on public roads; \"other\": all other business uses."
          }
        },
        "required": [
          "date",
          "use"
        ],
        "description": "Input of au-fuel-tax-credit-rate: one fuel purchase."
      },
      "DepositInput": {
        "type": "object",
        "properties": {
          "area": {
            "type": "string",
            "enum": [
              "IE",
              "ENG",
              "NIR",
              "SCT",
              "WLS",
              "NSW",
              "ACT",
              "QLD",
              "WA",
              "NT",
              "SA",
              "VIC",
              "TAS"
            ],
            "description": "Where the drink is sold: IE (Ireland), ENG, NIR, SCT, WLS (UK nations), or an Australian state or territory (NSW, ACT, QLD, WA, NT, SA, VIC, TAS)."
          },
          "material": {
            "type": "string",
            "enum": [
              "pet",
              "aluminium",
              "steel",
              "glass",
              "hdpe",
              "carton",
              "other"
            ],
            "description": "The container’s material."
          },
          "sizeMl": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100000,
            "description": "The container’s size in millilitres."
          },
          "drink": {
            "description": "standard (water, soft drinks, beer, cider, juice), wine, spirits, milk (plain milk) or dairy (a milk-based drink, such as flavoured milk or a milky coffee). Default standard.",
            "type": "string",
            "enum": [
              "standard",
              "wine",
              "spirits",
              "milk",
              "dairy"
            ]
          },
          "date": {
            "description": "The day of the sale (YYYY-MM-DD). Default today (UTC).",
            "type": "string",
            "format": "date",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
          },
          "lowVolumeLine": {
            "description": "The UK and Wales only: a product line registered as a low volume line (at most 5,000 units a year; 6,250 in Wales’ first scheme year).",
            "type": "boolean"
          }
        },
        "required": [
          "area",
          "material",
          "sizeMl"
        ],
        "description": "Input of deposit-rate: one drink container."
      },
      "BuyCreditsInput": {
        "type": "object",
        "properties": {
          "pack": {
            "type": "string",
            "enum": [
              "credits-1000",
              "credits-5000"
            ],
            "description": "Which pack: credits-1000 ($10) or credits-5000 ($50)."
          },
          "sharedPaymentToken": {
            "type": "string",
            "pattern": "^spt_[A-Za-z0-9_]{4,200}$",
            "description": "A Stripe Shared Payment Token (spt_…) for the pack’s price, granted to Tenhatch’s Stripe profile."
          }
        },
        "required": [
          "pack",
          "sharedPaymentToken"
        ],
        "description": "Buy prepaid credits with no person (opens January 2027)."
      },
      "CheckResponse": {
        "type": "object",
        "properties": {
          "check": {
            "type": "string"
          },
          "answer": {
            "type": "string"
          },
          "input": {
            "description": "The input as the check read it (spaces trimmed, empty optional fields left out); the receipt’s inputSha256 is its fingerprint."
          },
          "result": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {},
            "description": "The check’s full answer (see the check in GET /api/v1/checks)."
          },
          "receipt": {
            "type": "object",
            "properties": {
              "receipt": {
                "type": "object",
                "properties": {
                  "v": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "id": {
                    "type": "string",
                    "description": "rcpt_ and 24 hex characters."
                  },
                  "issuer": {
                    "type": "string"
                  },
                  "keyId": {
                    "type": "string",
                    "description": "Which published key signed it."
                  },
                  "check": {
                    "type": "string"
                  },
                  "checkVersion": {
                    "type": "string"
                  },
                  "at": {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                  },
                  "inputSha256": {
                    "type": "string",
                    "description": "SHA-256 of the canonical JSON of the input you sent."
                  },
                  "resultSha256": {
                    "type": "string",
                    "description": "SHA-256 of the canonical JSON of the result."
                  },
                  "answer": {
                    "type": "string"
                  },
                  "dataAsOf": {
                    "anyOf": [
                      {
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "rules": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "lastChecked": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "lastChecked"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "credits": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "v",
                  "id",
                  "issuer",
                  "keyId",
                  "check",
                  "checkVersion",
                  "at",
                  "inputSha256",
                  "resultSha256",
                  "answer",
                  "dataAsOf",
                  "rules",
                  "credits"
                ],
                "additionalProperties": false,
                "description": "What was checked, when and with what answer, without the input itself."
              },
              "signature": {
                "type": "string",
                "description": "Base64url Ed25519 signature over the canonical JSON of `receipt`."
              },
              "url": {
                "description": "Where anyone can look the receipt up.",
                "type": "string"
              }
            },
            "required": [
              "receipt",
              "signature"
            ],
            "additionalProperties": false,
            "description": "A signed receipt. Keep it with your records."
          },
          "usage": {
            "type": "object",
            "properties": {
              "source": {
                "type": "string",
                "enum": [
                  "human",
                  "agent",
                  "api"
                ],
                "description": "Which door a request came through: human (web app), agent (MCP and agent frameworks), api (plain API calls)."
              },
              "credits": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991,
                "description": "Credits this check used (0 for a free check)."
              },
              "paidWith": {
                "type": "string",
                "enum": [
                  "free",
                  "plan",
                  "prepaid",
                  "per-call"
                ]
              },
              "remaining": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Plan credits left this month after this check (null with no account)."
              },
              "prepaid": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Prepaid credits left (null with no account)."
              }
            },
            "required": [
              "source",
              "credits",
              "paidWith",
              "remaining",
              "prepaid"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "check",
          "answer",
          "input",
          "result",
          "receipt",
          "usage"
        ],
        "additionalProperties": false,
        "description": "A check’s answer, its signed receipt and how it was metered."
      },
      "Catalog": {
        "type": "object",
        "properties": {
          "checks": {
            "type": "array",
            "items": {
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {}
            }
          },
          "credits": {
            "type": "object",
            "properties": {
              "centsPerCredit": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "note": {
                "type": "string"
              }
            },
            "required": [
              "centsPerCredit",
              "note"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "checks",
          "credits"
        ],
        "additionalProperties": false,
        "description": "Every check, its price in credits, its rules and its endpoint."
      },
      "RuleRecord": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "citation": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "jurisdiction": {
            "type": "string"
          },
          "officialUrl": {
            "type": "string"
          },
          "readFrom": {
            "type": "string"
          },
          "quotes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Exact words of the rule, in order, only from texts whose licence or law allows copying them (the note names it)."
          },
          "facts": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The rest in our own words, where the source is a scheme operator’s, trade body’s or company’s page, or one whose reuse terms were not read; readFrom and the dates link it."
          },
          "dates": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "date": {
                  "type": "string"
                },
                "what": {
                  "type": "string"
                },
                "source": {
                  "type": "string"
                }
              },
              "required": [
                "date",
                "what",
                "source"
              ],
              "additionalProperties": false
            }
          },
          "whoMustComply": {
            "type": "string"
          },
          "lastChecked": {
            "type": "string",
            "description": "The day the quotes were last compared with the official text."
          },
          "keptBy": {
            "type": "object",
            "properties": {
              "product": {
                "type": "string"
              },
              "url": {
                "type": "string"
              }
            },
            "required": [
              "product",
              "url"
            ],
            "additionalProperties": false
          },
          "verified": {
            "type": "boolean",
            "description": "False when the official pages did not settle it: no check acts on it."
          },
          "note": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "citation",
          "title",
          "jurisdiction",
          "officialUrl",
          "readFrom",
          "quotes",
          "facts",
          "dates",
          "whoMustComply",
          "lastChecked",
          "keptBy",
          "verified",
          "note"
        ],
        "additionalProperties": false,
        "description": "A rule record: the official link, the exact words (where their licence allows) or the facts in our own words, who must comply and when it was last checked."
      },
      "SignedReceipt": {
        "type": "object",
        "properties": {
          "receipt": {
            "type": "object",
            "properties": {
              "v": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "id": {
                "type": "string",
                "description": "rcpt_ and 24 hex characters."
              },
              "issuer": {
                "type": "string"
              },
              "keyId": {
                "type": "string",
                "description": "Which published key signed it."
              },
              "check": {
                "type": "string"
              },
              "checkVersion": {
                "type": "string"
              },
              "at": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              "inputSha256": {
                "type": "string",
                "description": "SHA-256 of the canonical JSON of the input you sent."
              },
              "resultSha256": {
                "type": "string",
                "description": "SHA-256 of the canonical JSON of the result."
              },
              "answer": {
                "type": "string"
              },
              "dataAsOf": {
                "anyOf": [
                  {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "rules": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "lastChecked": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "lastChecked"
                  ],
                  "additionalProperties": false
                }
              },
              "credits": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "v",
              "id",
              "issuer",
              "keyId",
              "check",
              "checkVersion",
              "at",
              "inputSha256",
              "resultSha256",
              "answer",
              "dataAsOf",
              "rules",
              "credits"
            ],
            "additionalProperties": false,
            "description": "What was checked, when and with what answer, without the input itself."
          },
          "signature": {
            "type": "string",
            "description": "Base64url Ed25519 signature over the canonical JSON of `receipt`."
          },
          "url": {
            "description": "Where anyone can look the receipt up.",
            "type": "string"
          }
        },
        "required": [
          "receipt",
          "signature"
        ],
        "additionalProperties": false,
        "description": "A signed receipt. Keep it with your records."
      },
      "VerifyReceiptInput": {
        "type": "object",
        "properties": {
          "receipt": {
            "type": "object",
            "properties": {
              "v": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "id": {
                "type": "string",
                "description": "rcpt_ and 24 hex characters."
              },
              "issuer": {
                "type": "string"
              },
              "keyId": {
                "type": "string",
                "description": "Which published key signed it."
              },
              "check": {
                "type": "string"
              },
              "checkVersion": {
                "type": "string"
              },
              "at": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              "inputSha256": {
                "type": "string",
                "description": "SHA-256 of the canonical JSON of the input you sent."
              },
              "resultSha256": {
                "type": "string",
                "description": "SHA-256 of the canonical JSON of the result."
              },
              "answer": {
                "type": "string"
              },
              "dataAsOf": {
                "anyOf": [
                  {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "rules": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "lastChecked": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "lastChecked"
                  ]
                }
              },
              "credits": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "v",
              "id",
              "issuer",
              "keyId",
              "check",
              "checkVersion",
              "at",
              "inputSha256",
              "resultSha256",
              "answer",
              "dataAsOf",
              "rules",
              "credits"
            ],
            "description": "What was checked, when and with what answer, without the input itself."
          },
          "signature": {
            "type": "string"
          },
          "input": {
            "description": "Optional: the exact input you sent, to show it is the one the receipt was made for."
          }
        },
        "required": [
          "receipt",
          "signature"
        ],
        "description": "A receipt to verify."
      },
      "VerifyReceiptResponse": {
        "type": "object",
        "properties": {
          "valid": {
            "type": "boolean"
          },
          "reason": {
            "type": "string"
          },
          "keyId": {
            "type": "string"
          },
          "inputMatches": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "onRecord": {
            "type": "boolean",
            "description": "Whether Tenhatch Checks holds this exact receipt."
          }
        },
        "required": [
          "valid",
          "inputMatches",
          "onRecord"
        ],
        "additionalProperties": false,
        "description": "Whether a receipt is genuine."
      },
      "UsageMeter": {
        "type": "object",
        "properties": {
          "used": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "limit": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "remaining": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "percent": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "exhausted": {
            "type": "boolean"
          },
          "period": {
            "type": "object",
            "properties": {
              "start": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              "end": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              }
            },
            "required": [
              "start",
              "end"
            ],
            "additionalProperties": false
          },
          "bySource": {
            "type": "object",
            "properties": {
              "human": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "agent": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "api": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "human",
              "agent",
              "api"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "used",
          "limit",
          "remaining",
          "percent",
          "exhausted",
          "period",
          "bySource"
        ],
        "additionalProperties": false,
        "description": "Credits used in the current calendar month (UTC) against the plan limit, split by door."
      },
      "Account": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "email": {
            "type": "string",
            "format": "email",
            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "plan": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false,
            "description": "The free tier has id \"free\"."
          },
          "limits": {
            "type": "object",
            "properties": {
              "resultsPerMonth": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991,
                "description": "Credits a month."
              },
              "apiKeys": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "seats": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "resultsPerMonth",
              "apiKeys",
              "seats"
            ],
            "additionalProperties": false
          },
          "subscription": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string"
                  },
                  "interval": {
                    "type": "string",
                    "enum": [
                      "monthly",
                      "annual"
                    ]
                  },
                  "currentPeriodEnd": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "cancelAtPeriodEnd": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "status",
                  "interval",
                  "currentPeriodEnd",
                  "cancelAtPeriodEnd"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "email",
          "plan",
          "limits",
          "subscription"
        ],
        "additionalProperties": false,
        "description": "The calling account."
      },
      "ApiKeySummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "name": {
            "type": "string"
          },
          "prefix": {
            "type": "string",
            "description": "First characters of the key, for recognising it. The full key is only returned once, on creation."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "lastUsedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "revokedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "name",
          "prefix",
          "createdAt",
          "lastUsedAt",
          "revokedAt"
        ],
        "additionalProperties": false,
        "description": "An API key without its secret."
      },
      "CreateApiKeyInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 60,
            "description": "A label such as \"CI\" or \"Claude Desktop\"."
          }
        },
        "required": [
          "name"
        ],
        "description": "Input for creating an API key."
      },
      "CreateApiKeyResponse": {
        "type": "object",
        "properties": {
          "key": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "name": {
                "type": "string"
              },
              "prefix": {
                "type": "string",
                "description": "First characters of the key, for recognising it. The full key is only returned once, on creation."
              },
              "createdAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              "lastUsedAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "revokedAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "id",
              "name",
              "prefix",
              "createdAt",
              "lastUsedAt",
              "revokedAt"
            ],
            "additionalProperties": false,
            "description": "An API key without its secret."
          },
          "secret": {
            "type": "string",
            "description": "The full API key. Shown once; store it now."
          }
        },
        "required": [
          "key",
          "secret"
        ],
        "additionalProperties": false,
        "description": "A freshly created API key."
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "unauthorized",
                  "forbidden",
                  "not_found",
                  "invalid_input",
                  "quota_exhausted",
                  "rate_limited",
                  "payment_required",
                  "not_open",
                  "unavailable",
                  "internal"
                ]
              },
              "message": {
                "type": "string"
              },
              "details": {}
            },
            "required": [
              "code",
              "message"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false,
        "description": "Error envelope returned with every non-2xx status."
      }
    }
  }
}