{
  "openapi": "3.1.0",
  "info": {
    "title": "FSVPWatch API",
    "version": "1.0.0",
    "summary": "Nightly FDA checks on your foreign suppliers, with a dated log.",
    "description": "FSVPWatch is for US food importers with a Foreign Supplier Verification Program. Upload your foreign supplier list once; every night FSVPWatch reads the FDA records published since the night before (import refusals, warning letters and other compliance actions, food recalls, and the Red List of every FDA import alert), shows the records that may be about each supplier for you to confirm or dismiss, emails you when there is something new, and keeps a dated log of every check you can download. Agents can check one supplier through the API or the MCP server.\n\n## Authentication\nSend an API key as `Authorization: Bearer <key>` (or `X-API-Key`). Keys are created on the account page (https://fsvpwatch.tenhatch.com/app/api-keys). Signed-in browser sessions work too.\n\n## Metering and pricing\nEvery successful `check-supplier` call records one `supplier_check` usage event. Accounts on a plan use their monthly allowance (Starter: 1,000 results, $19/month; Pro: 5,000 results, $49/month; Business: 20,000 results, $129/month); accounts on the free tier get 50 results per month. API and agent callers without a plan pay $0.02 per result.\nAgents should send `x-usage-source: agent` so their usage is attributed correctly; it does not change the price.\n\n## Rate limits\nPer key or IP, published in the `X-RateLimit-*` response headers. A 429 carries `Retry-After`.\n\nSupport: support@tenhatch.com. Machine-readable product summary: https://fsvpwatch.tenhatch.com/.well-known/product.json",
    "contact": {
      "name": "FSVPWatch support",
      "email": "support@tenhatch.com",
      "url": "https://fsvpwatch.tenhatch.com"
    },
    "termsOfService": "https://fsvpwatch.tenhatch.com/legal/terms",
    "x-pricing": {
      "currency": "usd",
      "perResultCents": 2,
      "eventName": "supplier_check",
      "freeResultsPerMonth": 50,
      "plans": [
        {
          "planId": "starter",
          "name": "Starter",
          "monthly": "$19/month",
          "annual": "$190/year",
          "annualPerMonth": "$15.83/month",
          "savingsPercent": 17,
          "savings": "$38",
          "resultsPerMonth": 1000
        },
        {
          "planId": "pro",
          "name": "Pro",
          "monthly": "$49/month",
          "annual": "$490/year",
          "annualPerMonth": "$40.83/month",
          "savingsPercent": 17,
          "savings": "$98",
          "resultsPerMonth": 5000
        },
        {
          "planId": "business",
          "name": "Business",
          "monthly": "$129/month",
          "annual": "$1,290/year",
          "annualPerMonth": "$107.50/month",
          "savingsPercent": 17,
          "savings": "$258",
          "resultsPerMonth": 20000
        }
      ],
      "refundWindowDays": 14
    }
  },
  "servers": [
    {
      "url": "https://fsvpwatch.tenhatch.com",
      "description": "Production"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    },
    {
      "apiKeyHeader": []
    }
  ],
  "tags": [
    {
      "name": "feature",
      "description": "Check one foreign supplier"
    },
    {
      "name": "account",
      "description": "Account, usage and API keys"
    },
    {
      "name": "meta",
      "description": "Documents about the API itself"
    }
  ],
  "paths": {
    "/api/v1/check-supplier": {
      "post": {
        "tags": [
          "feature"
        ],
        "operationId": "check-supplier",
        "summary": "Check one foreign supplier",
        "description": "Checks one foreign food supplier against FDA import refusals, compliance actions (warning letters, seizures, injunctions), food recalls and the Red List of every FDA import alert, and returns the records that may be about it, each with the record’s own words and link, for a person to confirm. It never says a supplier is in trouble. Every answer carries the rule record for 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: A JSON object with the `candidates` (how each matched, the record’s source, date, words and link), the state of each FDA source (`sources`, with `dataAsOf`), a `notice` to show with them, `importAlerts` (whether the Red Lists were checked, and each import alert the supplier may be on with its number, the date the firm was listed, the link and the entry’s exact `line`) and the `rule` record.",
        "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/FeatureInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result and how it was metered.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckSupplierResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (see `error.details`).",
            "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": "Plan allowance exhausted and pay-as-you-go not available for 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"
                }
              }
            }
          }
        },
        "x-price-per-result-cents": 2,
        "x-usage-event": "supplier_check"
      }
    },
    "/api/v1/rule": {
      "get": {
        "tags": [
          "meta"
        ],
        "operationId": "getRule",
        "summary": "The rule record (free, no key)",
        "description": "The rule FSVPWatch is built around, 21 CFR 1.505(c)(1), with its official link, the exact quote, who must comply and when it was last checked, so an agent can cite it. Every check-supplier answer carries it too.",
        "security": [],
        "responses": {
          "200": {
            "description": "The rule record.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuleRecord"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/usage": {
      "get": {
        "tags": [
          "account"
        ],
        "operationId": "getUsage",
        "summary": "Current-period usage meter",
        "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": {
      "FeatureInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "The foreign supplier’s name, as you have it."
          },
          "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 check-supplier: one foreign supplier."
      },
      "CheckSupplierResponse": {
        "type": "object",
        "properties": {
          "result": {
            "type": "object",
            "properties": {
              "supplier": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "countryCode": {
                    "type": "string"
                  },
                  "country": {
                    "type": "string"
                  },
                  "fei": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "city": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "name",
                  "countryCode",
                  "country",
                  "fei",
                  "city"
                ],
                "additionalProperties": false
              },
              "checkedAt": {
                "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))$"
              },
              "window": {
                "type": "object",
                "properties": {
                  "from": {
                    "type": "string"
                  },
                  "to": {
                    "type": "string"
                  }
                },
                "required": [
                  "from",
                  "to"
                ],
                "additionalProperties": false
              },
              "sources": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "source": {
                      "type": "string",
                      "enum": [
                        "import-refusal",
                        "compliance-action",
                        "recall",
                        "import-alert"
                      ],
                      "description": "import-refusal and compliance-action: FDA Data Dashboard API. recall: openFDA food enforcement. import-alert: the Red List of an FDA import alert, from FDA’s import alert pages."
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "ok",
                        "not-configured",
                        "error",
                        "not-loaded"
                      ]
                    },
                    "dataAsOf": {
                      "description": "FSVPWatch’s copy holds this source’s records up to this date.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "message": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "source",
                    "status",
                    "dataAsOf",
                    "message"
                  ],
                  "additionalProperties": false,
                  "description": "Whether an FDA source could be used for this check."
                }
              },
              "notice": {
                "type": "string",
                "description": "Show this with the candidates."
              },
              "candidates": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "level": {
                      "type": "string",
                      "enum": [
                        "fei",
                        "same-name",
                        "close-name",
                        "mentioned"
                      ]
                    },
                    "levelLabel": {
                      "type": "string"
                    },
                    "score": {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1
                    },
                    "reason": {
                      "type": "string",
                      "description": "One plain sentence: why this record is shown."
                    },
                    "record": {
                      "type": "object",
                      "properties": {
                        "source": {
                          "type": "string",
                          "enum": [
                            "import-refusal",
                            "compliance-action",
                            "recall",
                            "import-alert"
                          ],
                          "description": "import-refusal and compliance-action: FDA Data Dashboard API. recall: openFDA food enforcement. import-alert: the Red List of an FDA import alert, from FDA’s import alert pages."
                        },
                        "sourceLabel": {
                          "type": "string"
                        },
                        "id": {
                          "type": "string"
                        },
                        "firmName": {
                          "type": "string",
                          "description": "The firm as the FDA record names it."
                        },
                        "fei": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "country": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "city": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "date": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        },
                        "words": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "The record’s own words, by field."
                        },
                        "link": {
                          "type": "string",
                          "description": "The record’s own link."
                        },
                        "moreLinks": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "label": {
                                "type": "string"
                              },
                              "url": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "label",
                              "url"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "source",
                        "sourceLabel",
                        "id",
                        "firmName",
                        "fei",
                        "country",
                        "city",
                        "date",
                        "title",
                        "words",
                        "link",
                        "moreLinks"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "level",
                    "levelLabel",
                    "score",
                    "reason",
                    "record"
                  ],
                  "additionalProperties": false,
                  "description": "An FDA record that may be about the supplier, for a person to confirm."
                }
              },
              "truncated": {
                "type": "boolean"
              },
              "importAlerts": {
                "type": "object",
                "properties": {
                  "checked": {
                    "type": "boolean",
                    "description": "True when the Red Lists were read and used for this check."
                  },
                  "note": {
                    "type": "string"
                  },
                  "link": {
                    "type": "string",
                    "description": "FDA’s import alerts by country."
                  },
                  "dataAsOf": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "alerts": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "number": {
                          "type": "string",
                          "description": "The import alert number, such as 99-08."
                        },
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "type": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "date": {
                          "type": "string",
                          "description": "The firm’s “Date Published” on the Red List, YYYY-MM-DD."
                        },
                        "link": {
                          "type": "string",
                          "description": "FDA’s page for the alert."
                        },
                        "line": {
                          "type": "string",
                          "description": "The Red List entry’s opening lines exactly as on FDA’s page."
                        },
                        "firmName": {
                          "type": "string"
                        },
                        "country": {
                          "type": "string"
                        },
                        "level": {
                          "type": "string",
                          "enum": [
                            "fei",
                            "same-name",
                            "close-name",
                            "mentioned"
                          ]
                        },
                        "levelLabel": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "number",
                        "name",
                        "type",
                        "date",
                        "link",
                        "line",
                        "firmName",
                        "country",
                        "level",
                        "levelLabel"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "checked",
                  "note",
                  "link",
                  "dataAsOf",
                  "alerts"
                ],
                "additionalProperties": false,
                "description": "The FDA import alerts whose Red List may name the supplier."
              },
              "rule": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "citation": {
                    "type": "string"
                  },
                  "title": {
                    "type": "string"
                  },
                  "officialUrl": {
                    "type": "string"
                  },
                  "readFrom": {
                    "type": "string"
                  },
                  "quote": {
                    "type": "string"
                  },
                  "factorQuote": {
                    "type": "string"
                  },
                  "whoMustComply": {
                    "type": "string"
                  },
                  "whoMustComplyQuote": {
                    "type": "string"
                  },
                  "whoMustComplyUrl": {
                    "type": "string"
                  },
                  "federalRegister": {
                    "type": "string"
                  },
                  "federalRegisterUrl": {
                    "type": "string"
                  },
                  "publishedAt": {
                    "type": "string"
                  },
                  "effectiveAt": {
                    "type": "string"
                  },
                  "lastChecked": {
                    "type": "string"
                  },
                  "howFsvpWatchHelps": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "citation",
                  "title",
                  "officialUrl",
                  "readFrom",
                  "quote",
                  "factorQuote",
                  "whoMustComply",
                  "whoMustComplyQuote",
                  "whoMustComplyUrl",
                  "federalRegister",
                  "federalRegisterUrl",
                  "publishedAt",
                  "effectiveAt",
                  "lastChecked",
                  "howFsvpWatchHelps"
                ],
                "additionalProperties": false,
                "description": "The rule record: 21 CFR 1.505(c)(1), its official link, exact words, who must comply and when it was last checked."
              }
            },
            "required": [
              "supplier",
              "checkedAt",
              "window",
              "sources",
              "notice",
              "candidates",
              "truncated",
              "importAlerts",
              "rule"
            ],
            "additionalProperties": false,
            "description": "Result of check-supplier."
          },
          "usage": {
            "type": "object",
            "properties": {
              "source": {
                "type": "string",
                "enum": [
                  "human",
                  "agent",
                  "api"
                ],
                "description": "Which door a request came through: human (web app), agent (MCP / agent frameworks), api (plain API calls)."
              },
              "chargedCents": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "remaining": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991,
                "description": "Results left in the current period after this call."
              }
            },
            "required": [
              "source",
              "chargedCents",
              "remaining"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "result",
          "usage"
        ],
        "additionalProperties": false,
        "description": "The feature result plus how it was metered."
      },
      "RuleRecord": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "citation": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "officialUrl": {
            "type": "string"
          },
          "readFrom": {
            "type": "string"
          },
          "quote": {
            "type": "string"
          },
          "factorQuote": {
            "type": "string"
          },
          "whoMustComply": {
            "type": "string"
          },
          "whoMustComplyQuote": {
            "type": "string"
          },
          "whoMustComplyUrl": {
            "type": "string"
          },
          "federalRegister": {
            "type": "string"
          },
          "federalRegisterUrl": {
            "type": "string"
          },
          "publishedAt": {
            "type": "string"
          },
          "effectiveAt": {
            "type": "string"
          },
          "lastChecked": {
            "type": "string"
          },
          "howFsvpWatchHelps": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "citation",
          "title",
          "officialUrl",
          "readFrom",
          "quote",
          "factorQuote",
          "whoMustComply",
          "whoMustComplyQuote",
          "whoMustComplyUrl",
          "federalRegister",
          "federalRegisterUrl",
          "publishedAt",
          "effectiveAt",
          "lastChecked",
          "howFsvpWatchHelps"
        ],
        "additionalProperties": false,
        "description": "The rule record: 21 CFR 1.505(c)(1), its official link, exact words, who must comply and when it was last checked."
      },
      "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": "Results 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
              },
              "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",
                  "internal"
                ]
              },
              "message": {
                "type": "string"
              },
              "details": {}
            },
            "required": [
              "code",
              "message"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false,
        "description": "Error envelope returned with every non-2xx status."
      }
    }
  }
}