{
  "components": {
    "schemas": {
      "AMActiveAtResponse": {
        "additionalProperties": true,
        "description": "``GET /v1/am/active_at`` \u2014 paginated list with the snapshot date.",
        "properties": {
          "error": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Set when the tool failed (DB unavailable / invalid input). When present, ``results`` is empty and the caller should surface the error message rather than render an empty list.",
            "title": "Error"
          },
          "limit": {
            "description": "Page size echoed from the request.",
            "title": "Limit",
            "type": "integer"
          },
          "meta": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional envelope: alternative_intents, retrieval_note, next_cursor, advisory hints. Wired by L5.",
            "title": "Meta"
          },
          "offset": {
            "description": "Page offset echoed from the request.",
            "title": "Offset",
            "type": "integer"
          },
          "pivot_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pivot Date"
          },
          "results": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Results",
            "type": "array"
          },
          "retrieval_note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "One-line provenance hint, e.g. 'fts5_trigram + LIKE fallback (3 rows from 285)'.",
            "title": "Retrieval Note"
          },
          "total": {
            "description": "Total candidate rows before paging.",
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "total",
          "limit",
          "offset"
        ],
        "title": "AMActiveAtResponse",
        "type": "object"
      },
      "AMAnnotationsResponse": {
        "additionalProperties": true,
        "description": "``GET /v1/am/annotations/{entity_id}`` \u2014 examiner / quality / ML notes.",
        "properties": {
          "entity_id": {
            "title": "Entity Id",
            "type": "string"
          },
          "error": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Set when the tool failed (DB unavailable / invalid input). When present, ``results`` is empty and the caller should surface the error message rather than render an empty list.",
            "title": "Error"
          },
          "filters": {
            "additionalProperties": true,
            "title": "Filters",
            "type": "object"
          },
          "limit": {
            "description": "Page size echoed from the request.",
            "title": "Limit",
            "type": "integer"
          },
          "meta": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional envelope: alternative_intents, retrieval_note, next_cursor, advisory hints. Wired by L5.",
            "title": "Meta"
          },
          "offset": {
            "description": "Page offset echoed from the request.",
            "title": "Offset",
            "type": "integer"
          },
          "results": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Results",
            "type": "array"
          },
          "retrieval_note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "One-line provenance hint, e.g. 'fts5_trigram + LIKE fallback (3 rows from 285)'.",
            "title": "Retrieval Note"
          },
          "total": {
            "description": "Total candidate rows before paging.",
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "total",
          "limit",
          "offset",
          "entity_id"
        ],
        "title": "AMAnnotationsResponse",
        "type": "object"
      },
      "AMByLawResponse": {
        "additionalProperties": true,
        "description": "``GET /v1/am/by_law`` \u2014 adds the alias-resolution debug field.",
        "properties": {
          "error": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Set when the tool failed (DB unavailable / invalid input). When present, ``results`` is empty and the caller should surface the error message rather than render an empty list.",
            "title": "Error"
          },
          "law_aliases_tried": {
            "description": "Fuzzy-match alias attempts tried before settling on a hit.",
            "items": {
              "type": "string"
            },
            "title": "Law Aliases Tried",
            "type": "array"
          },
          "limit": {
            "description": "Page size echoed from the request.",
            "title": "Limit",
            "type": "integer"
          },
          "meta": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional envelope: alternative_intents, retrieval_note, next_cursor, advisory hints. Wired by L5.",
            "title": "Meta"
          },
          "offset": {
            "description": "Page offset echoed from the request.",
            "title": "Offset",
            "type": "integer"
          },
          "results": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Results",
            "type": "array"
          },
          "retrieval_note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "One-line provenance hint, e.g. 'fts5_trigram + LIKE fallback (3 rows from 285)'.",
            "title": "Retrieval Note"
          },
          "total": {
            "description": "Total candidate rows before paging.",
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "total",
          "limit",
          "offset"
        ],
        "title": "AMByLawResponse",
        "type": "object"
      },
      "AMEnforcementCheckResponse": {
        "additionalProperties": true,
        "description": "``GET /v1/am/enforcement`` \u2014 \u6392\u9664\u671f\u9593\u30c1\u30a7\u30c3\u30af result.",
        "properties": {
          "active_exclusions": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Active Exclusions",
            "type": "array"
          },
          "all_count": {
            "default": 0,
            "title": "All Count",
            "type": "integer"
          },
          "currently_excluded": {
            "default": false,
            "title": "Currently Excluded",
            "type": "boolean"
          },
          "error": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "found": {
            "default": false,
            "title": "Found",
            "type": "boolean"
          },
          "queried": {
            "additionalProperties": true,
            "title": "Queried",
            "type": "object"
          },
          "recent_history": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Recent History",
            "type": "array"
          }
        },
        "title": "AMEnforcementCheckResponse",
        "type": "object"
      },
      "AMEnumValuesResponse": {
        "additionalProperties": true,
        "description": "``GET /v1/am/enums/{enum_name}`` \u2014 distinct values + counts for an enum.",
        "properties": {
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "enum_name": {
            "title": "Enum Name",
            "type": "string"
          },
          "error": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "frequency_map": {
            "additionalProperties": {
              "type": "integer"
            },
            "title": "Frequency Map",
            "type": "object"
          },
          "last_updated": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Updated"
          },
          "values": {
            "items": {
              "type": "string"
            },
            "title": "Values",
            "type": "array"
          }
        },
        "required": [
          "enum_name"
        ],
        "title": "AMEnumValuesResponse",
        "type": "object"
      },
      "AMIntentResponse": {
        "additionalProperties": true,
        "description": "``GET /v1/am/intent`` \u2014 natural-language \u2192 tool routing.",
        "properties": {
          "all_scores": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "All Scores",
            "type": "array"
          },
          "confidence": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Confidence"
          },
          "error": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "intent_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Intent Id"
          },
          "intent_name_ja": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Intent Name Ja"
          },
          "sample_queries": {
            "items": {
              "type": "string"
            },
            "title": "Sample Queries",
            "type": "array"
          }
        },
        "title": "AMIntentResponse",
        "type": "object"
      },
      "AMLawArticleResponse": {
        "additionalProperties": true,
        "description": "``GET /v1/am/law_article`` \u2014 \u6761\u6587 lookup.",
        "properties": {
          "article_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Article Id"
          },
          "article_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Article Number"
          },
          "article_number_sort": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Article Number Sort"
          },
          "effective_from": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Effective From"
          },
          "effective_until": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Effective Until"
          },
          "error": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "found": {
            "default": false,
            "title": "Found",
            "type": "boolean"
          },
          "last_amended": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Amended"
          },
          "law": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Law"
          },
          "source_fetched_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Fetched At"
          },
          "source_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Url"
          },
          "text_full": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Text Full"
          },
          "text_summary": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Text Summary"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          }
        },
        "title": "AMLawArticleResponse",
        "type": "object"
      },
      "AMLoanSearchResponse": {
        "additionalProperties": true,
        "description": "``GET /v1/am/loans`` / ``mutual_plans`` \u2014 three-axis loan/\u5171\u6e08 search.",
        "properties": {
          "error": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "limit": {
            "default": 10,
            "title": "Limit",
            "type": "integer"
          },
          "offset": {
            "default": 0,
            "title": "Offset",
            "type": "integer"
          },
          "result_count": {
            "default": 0,
            "title": "Result Count",
            "type": "integer"
          },
          "results": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Results",
            "type": "array"
          },
          "total": {
            "default": 0,
            "title": "Total",
            "type": "integer"
          }
        },
        "title": "AMLoanSearchResponse",
        "type": "object"
      },
      "AMOpenProgramsResponse": {
        "additionalProperties": true,
        "description": "``GET /v1/am/open_programs`` \u2014 adds ``pivot_date`` (the date the snapshot\nwas taken on, defaulting to today).",
        "properties": {
          "error": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Set when the tool failed (DB unavailable / invalid input). When present, ``results`` is empty and the caller should surface the error message rather than render an empty list.",
            "title": "Error"
          },
          "limit": {
            "description": "Page size echoed from the request.",
            "title": "Limit",
            "type": "integer"
          },
          "meta": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional envelope: alternative_intents, retrieval_note, next_cursor, advisory hints. Wired by L5.",
            "title": "Meta"
          },
          "offset": {
            "description": "Page offset echoed from the request.",
            "title": "Offset",
            "type": "integer"
          },
          "pivot_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ISO YYYY-MM-DD of the snapshot date.",
            "title": "Pivot Date"
          },
          "results": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Results",
            "type": "array"
          },
          "retrieval_note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "One-line provenance hint, e.g. 'fts5_trigram + LIKE fallback (3 rows from 285)'.",
            "title": "Retrieval Note"
          },
          "total": {
            "description": "Total candidate rows before paging.",
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "total",
          "limit",
          "offset"
        ],
        "title": "AMOpenProgramsResponse",
        "type": "object"
      },
      "AMProvenanceResponse": {
        "additionalProperties": true,
        "description": "``GET /v1/am/provenance/{entity_id}`` and the per-fact variant.",
        "properties": {
          "error": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Set when the tool failed (DB unavailable / invalid input). When present, ``results`` is empty and the caller should surface the error message rather than render an empty list.",
            "title": "Error"
          },
          "limit": {
            "description": "Page size echoed from the request.",
            "title": "Limit",
            "type": "integer"
          },
          "meta": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional envelope: alternative_intents, retrieval_note, next_cursor, advisory hints. Wired by L5.",
            "title": "Meta"
          },
          "offset": {
            "description": "Page offset echoed from the request.",
            "title": "Offset",
            "type": "integer"
          },
          "results": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Results",
            "type": "array"
          },
          "retrieval_note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "One-line provenance hint, e.g. 'fts5_trigram + LIKE fallback (3 rows from 285)'.",
            "title": "Retrieval Note"
          },
          "total": {
            "description": "Total candidate rows before paging.",
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "total",
          "limit",
          "offset"
        ],
        "title": "AMProvenanceResponse",
        "type": "object"
      },
      "AMReasonResponse": {
        "additionalProperties": true,
        "description": "``GET /v1/am/reason`` \u2014 citation-backed narrative answer.",
        "properties": {
          "answer_skeleton": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Answer Skeleton"
          },
          "confidence": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Confidence"
          },
          "db_bind_notes": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Db Bind Notes"
          },
          "db_bind_ok": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Db Bind Ok"
          },
          "error": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "filters_extracted": {
            "additionalProperties": true,
            "title": "Filters Extracted",
            "type": "object"
          },
          "intent": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Intent"
          },
          "intent_name_ja": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Intent Name Ja"
          },
          "missing_data": {
            "items": {
              "type": "string"
            },
            "title": "Missing Data",
            "type": "array"
          },
          "persona_hint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Persona Hint"
          },
          "precompute_gaps": {
            "items": {
              "type": "string"
            },
            "title": "Precompute Gaps",
            "type": "array"
          },
          "retry_with": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Retry With"
          },
          "source_urls": {
            "items": {
              "type": "string"
            },
            "title": "Source Urls",
            "type": "array"
          }
        },
        "title": "AMReasonResponse",
        "type": "object"
      },
      "AMRelatedResponse": {
        "additionalProperties": true,
        "description": "``GET /v1/am/related/{program_id}`` \u2014 graph walk over am_relation.",
        "properties": {
          "depth": {
            "default": 1,
            "title": "Depth",
            "type": "integer"
          },
          "error": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "hint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Hint"
          },
          "nodes": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Nodes",
            "type": "array"
          },
          "relations": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Relations",
            "type": "array"
          },
          "retry_with": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Retry With"
          },
          "seed_id": {
            "title": "Seed Id",
            "type": "string"
          },
          "seed_kind": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Seed Kind"
          },
          "total_edges": {
            "default": 0,
            "title": "Total Edges",
            "type": "integer"
          }
        },
        "required": [
          "seed_id"
        ],
        "title": "AMRelatedResponse",
        "type": "object"
      },
      "AMSearchResponse": {
        "additionalProperties": true,
        "description": "Concrete `SearchResponse[Any]` used by ``/v1/am/*`` paginated tools.\n\nThe underlying ``am_entities`` table is heterogeneous (12 record_kinds:\nprogram / tax_measure / certification / loan / adoption / \u2026), so the\nrow contract is left at ``dict`` rather than enumerated. The pagination\n+ meta + error contract \u2014 which is what an agent needs to drive a loop\n\u2014 is fully typed.",
        "properties": {
          "error": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Set when the tool failed (DB unavailable / invalid input). When present, ``results`` is empty and the caller should surface the error message rather than render an empty list.",
            "title": "Error"
          },
          "limit": {
            "description": "Page size echoed from the request.",
            "title": "Limit",
            "type": "integer"
          },
          "meta": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional envelope: alternative_intents, retrieval_note, next_cursor, advisory hints. Wired by L5.",
            "title": "Meta"
          },
          "offset": {
            "description": "Page offset echoed from the request.",
            "title": "Offset",
            "type": "integer"
          },
          "results": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Results",
            "type": "array"
          },
          "retrieval_note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "One-line provenance hint, e.g. 'fts5_trigram + LIKE fallback (3 rows from 285)'.",
            "title": "Retrieval Note"
          },
          "total": {
            "description": "Total candidate rows before paging.",
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "total",
          "limit",
          "offset"
        ],
        "title": "AMSearchResponse",
        "type": "object"
      },
      "AMSimpleSearchResponse": {
        "additionalProperties": true,
        "description": "Lighter SearchResponse variant for tools that omit ``offset``.\n\nUsed by ``search_gx_programs_am`` and the like that return ``{total,\nresults}`` only. Listed separately so the OpenAPI schema is honest \u2014\nwe don't claim ``offset`` when the underlying tool doesn't ship it.",
        "properties": {
          "error": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "results": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Results",
            "type": "array"
          },
          "total": {
            "default": 0,
            "title": "Total",
            "type": "integer"
          }
        },
        "title": "AMSimpleSearchResponse",
        "type": "object"
      },
      "AMTaxRuleResponse": {
        "additionalProperties": true,
        "description": "``GET /v1/am/tax_rule`` \u2014 single-measure tax rule lookup.",
        "properties": {
          "error": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "results": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Results",
            "type": "array"
          },
          "total": {
            "default": 0,
            "title": "Total",
            "type": "integer"
          }
        },
        "title": "AMTaxRuleResponse",
        "type": "object"
      },
      "AMValidateResponse": {
        "additionalProperties": true,
        "description": "``POST /v1/am/validate`` \u2014 generic intake validator output.",
        "properties": {
          "applicant_hash": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Applicant Hash"
          },
          "entity_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Entity Id"
          },
          "error": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "results": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Results",
            "type": "array"
          },
          "scope": {
            "default": "intake",
            "title": "Scope",
            "type": "string"
          },
          "summary": {
            "additionalProperties": true,
            "title": "Summary",
            "type": "object"
          },
          "total": {
            "default": 0,
            "title": "Total",
            "type": "integer"
          }
        },
        "title": "AMValidateResponse",
        "type": "object"
      },
      "AdvisorDashboardReferral": {
        "additionalProperties": true,
        "properties": {
          "clicked_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Clicked At"
          },
          "commission_paid_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Commission Paid At"
          },
          "commission_yen": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Commission Yen"
          },
          "conversion_value_yen": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Conversion Value Yen"
          },
          "converted_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Converted At"
          },
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "source_program_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Program Id"
          },
          "token_prefix": {
            "title": "Token Prefix",
            "type": "string"
          }
        },
        "required": [
          "id",
          "token_prefix"
        ],
        "title": "AdvisorDashboardReferral",
        "type": "object"
      },
      "AdvisorDashboardResponse": {
        "additionalProperties": true,
        "properties": {
          "advisor": {
            "additionalProperties": true,
            "title": "Advisor",
            "type": "object"
          },
          "referrals": {
            "items": {
              "$ref": "#/components/schemas/AdvisorDashboardReferral"
            },
            "title": "Referrals",
            "type": "array"
          },
          "summary": {
            "$ref": "#/components/schemas/AdvisorDashboardSummary"
          }
        },
        "required": [
          "advisor",
          "summary"
        ],
        "title": "AdvisorDashboardResponse",
        "type": "object"
      },
      "AdvisorDashboardSummary": {
        "additionalProperties": true,
        "properties": {
          "clicks": {
            "default": 0,
            "title": "Clicks",
            "type": "integer"
          },
          "conversions": {
            "default": 0,
            "title": "Conversions",
            "type": "integer"
          },
          "paid_yen": {
            "default": 0,
            "title": "Paid Yen",
            "type": "integer"
          },
          "unpaid_yen": {
            "default": 0,
            "title": "Unpaid Yen",
            "type": "integer"
          }
        },
        "title": "AdvisorDashboardSummary",
        "type": "object"
      },
      "AdvisorOut": {
        "additionalProperties": false,
        "description": "Public-facing advisor row. Excludes internal-only columns\n(stripe_connect_account_id, disabled_reason, raw success_count math).",
        "properties": {
          "address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Address"
          },
          "city": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "City"
          },
          "commission_model": {
            "default": "flat",
            "enum": [
              "flat",
              "percent"
            ],
            "title": "Commission Model",
            "type": "string"
          },
          "commission_rate_pct": {
            "default": 5,
            "title": "Commission Rate Pct",
            "type": "integer"
          },
          "commission_yen_per_intro": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": 3000,
            "title": "Commission Yen Per Intro"
          },
          "contact_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Contact Email"
          },
          "contact_phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Contact Phone"
          },
          "contact_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Contact Url"
          },
          "firm_name": {
            "title": "Firm Name",
            "type": "string"
          },
          "firm_name_kana": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Firm Name Kana"
          },
          "firm_type": {
            "enum": [
              "\u7a0e\u7406\u58eb\u6cd5\u4eba",
              "\u8a8d\u5b9a\u652f\u63f4\u6a5f\u95a2",
              "\u793e\u4f1a\u4fdd\u967a\u52b4\u52d9\u58eb",
              "\u4e2d\u5c0f\u4f01\u696d\u8a3a\u65ad\u58eb",
              "\u884c\u653f\u66f8\u58eb",
              "\u5f01\u8b77\u58eb",
              "\u9280\u884c",
              "\u5546\u5de5\u4f1a\u8b70\u6240",
              "\u305d\u306e\u4ed6"
            ],
            "title": "Firm Type",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "industries": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Industries"
          },
          "intro_blurb": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Intro Blurb"
          },
          "prefecture": {
            "title": "Prefecture",
            "type": "string"
          },
          "specialties": {
            "items": {
              "type": "string"
            },
            "title": "Specialties",
            "type": "array"
          },
          "success_count": {
            "default": 0,
            "title": "Success Count",
            "type": "integer"
          },
          "verified_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Verified At"
          }
        },
        "required": [
          "id",
          "firm_name",
          "firm_type",
          "specialties",
          "prefecture"
        ],
        "title": "AdvisorOut",
        "type": "object"
      },
      "AttributionBlock": {
        "additionalProperties": false,
        "description": "PDL v1.0 attribution (\u51fa\u5178\u660e\u8a18 + \u7de8\u96c6\u30fb\u52a0\u5de5\u6ce8\u8a18).",
        "properties": {
          "edited": {
            "title": "Edited",
            "type": "boolean"
          },
          "license": {
            "title": "License",
            "type": "string"
          },
          "notice": {
            "title": "Notice",
            "type": "string"
          },
          "source": {
            "title": "Source",
            "type": "string"
          },
          "source_url": {
            "title": "Source Url",
            "type": "string"
          }
        },
        "required": [
          "source",
          "source_url",
          "license",
          "edited",
          "notice"
        ],
        "title": "AttributionBlock",
        "type": "object"
      },
      "AuthorizeRequest": {
        "properties": {
          "client_id": {
            "default": "autonomath-mcp",
            "title": "Client Id",
            "type": "string"
          },
          "scope": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": "api:read api:metered",
            "description": "Space-delimited scopes. Defaults to 'api:read api:metered'.",
            "title": "Scope"
          }
        },
        "title": "AuthorizeRequest",
        "type": "object"
      },
      "AuthorizeResponse": {
        "properties": {
          "device_code": {
            "title": "Device Code",
            "type": "string"
          },
          "expires_in": {
            "title": "Expires In",
            "type": "integer"
          },
          "interval": {
            "title": "Interval",
            "type": "integer"
          },
          "user_code": {
            "title": "User Code",
            "type": "string"
          },
          "verification_uri": {
            "title": "Verification Uri",
            "type": "string"
          },
          "verification_uri_complete": {
            "title": "Verification Uri Complete",
            "type": "string"
          }
        },
        "required": [
          "device_code",
          "user_code",
          "verification_uri",
          "verification_uri_complete",
          "expires_in",
          "interval"
        ],
        "title": "AuthorizeResponse",
        "type": "object"
      },
      "BatchGetProgramsRequest": {
        "description": "Body for POST /v1/programs/batch.\n\n`unified_ids` is capped at 50 \u2014 the 50-cap IS the pagination. Callers\nwith more ids page the request themselves (request.py: chunk(ids, 50)).\nThe cap lives here (pydantic) AND is also enforced inside the handler;\nexceeding it surfaces as HTTP 422 per the usual FastAPI validation path.",
        "properties": {
          "unified_ids": {
            "items": {
              "type": "string"
            },
            "maxItems": 50,
            "minItems": 1,
            "title": "Unified Ids",
            "type": "array"
          }
        },
        "required": [
          "unified_ids"
        ],
        "title": "BatchGetProgramsRequest",
        "type": "object"
      },
      "BatchGetProgramsResponse": {
        "description": "Response for POST /v1/programs/batch.\n\n`results[]` is in the same order as the deduped input `unified_ids`.\nMissing ids go to `not_found` (NOT a 404 \u2014 partial success is the point\nof batch-fetch). Use `not_found` length == 0 as the \"everything resolved\"\nsignal.",
        "properties": {
          "not_found": {
            "items": {
              "type": "string"
            },
            "title": "Not Found",
            "type": "array"
          },
          "results": {
            "items": {
              "$ref": "#/components/schemas/ProgramDetail"
            },
            "title": "Results",
            "type": "array"
          }
        },
        "required": [
          "results",
          "not_found"
        ],
        "title": "BatchGetProgramsResponse",
        "type": "object"
      },
      "BidOut": {
        "additionalProperties": false,
        "description": "Single \u5165\u672d row. Columns map 1:1 onto 017_bids.sql's `bids` table.",
        "properties": {
          "announcement_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ISO 8601 \u516c\u544a\u65e5",
            "title": "Announcement Date"
          },
          "awarded_amount_yen": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "\u843d\u672d\u91d1\u984d (JPY, \u7a0e\u8fbc if disclosed)",
            "title": "Awarded Amount Yen"
          },
          "bid_deadline": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ISO 8601 \u5165\u672d\u66f8\u63d0\u51fa\u671f\u9650",
            "title": "Bid Deadline"
          },
          "bid_description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "\u8abf\u9054\u6982\u8981 / \u4ed5\u69d8\u8981\u65e8",
            "title": "Bid Description"
          },
          "bid_kind": {
            "description": "open (\u4e00\u822c\u7af6\u4e89) | selective (\u6307\u540d\u7af6\u4e89) | negotiated (\u968f\u610f\u5951\u7d04) | kobo_subsidy (\u516c\u52df\u578b\u88dc\u52a9)",
            "enum": [
              "open",
              "selective",
              "negotiated",
              "kobo_subsidy"
            ],
            "title": "Bid Kind",
            "type": "string"
          },
          "bid_title": {
            "description": "\u6848\u4ef6\u540d",
            "title": "Bid Title",
            "type": "string"
          },
          "budget_ceiling_yen": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "\u4e88\u5b9a\u4fa1\u683c / \u5951\u7d04\u9650\u5ea6\u984d (JPY, \u7a0e\u8fbc if disclosed)",
            "title": "Budget Ceiling Yen"
          },
          "classification_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "'\u5f79\u52d9' | '\u7269\u54c1' | '\u5de5\u4e8b' (or finer JGS code)",
            "title": "Classification Code"
          },
          "confidence": {
            "description": "0..1 lineage confidence",
            "title": "Confidence",
            "type": "number"
          },
          "decision_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ISO 8601 \u843d\u672d\u6c7a\u5b9a\u65e5",
            "title": "Decision Date"
          },
          "eligibility_conditions": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "\u53c2\u52a0\u8cc7\u683c\u8981\u4ef6 (\u7b49\u7d1a / \u6240\u5728\u5730 / \u5b9f\u7e3e \u7b49)",
            "title": "Eligibility Conditions"
          },
          "fetched_at": {
            "description": "ISO 8601 UTC of last successful fetch",
            "title": "Fetched At",
            "type": "string"
          },
          "ministry": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "\u6240\u7ba1\u5e9c\u7701",
            "title": "Ministry"
          },
          "participant_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "\u5165\u672d\u53c2\u52a0\u8005\u6570",
            "title": "Participant Count"
          },
          "prefecture": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "\u90fd\u9053\u5e9c\u770c",
            "title": "Prefecture"
          },
          "procuring_entity": {
            "description": "\u767a\u6ce8\u6a5f\u95a2\u540d",
            "title": "Procuring Entity",
            "type": "string"
          },
          "procuring_houjin_bangou": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "13-digit \u6cd5\u4eba\u756a\u53f7 of the procuring entity (soft ref)",
            "title": "Procuring Houjin Bangou"
          },
          "program_id_hint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "programs.unified_id when the bid is the procurement arm of a funded \u88dc\u52a9\u4e8b\u696d (soft ref)",
            "title": "Program Id Hint"
          },
          "question_deadline": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ISO 8601 \u8cea\u554f\u53d7\u4ed8\u671f\u9650",
            "title": "Question Deadline"
          },
          "source_checksum": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "optional SHA-256 of raw fetch body",
            "title": "Source Checksum"
          },
          "source_excerpt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "relevant passage for audit",
            "title": "Source Excerpt"
          },
          "source_url": {
            "description": "primary source (GEPS / ministry / *.lg.jp)",
            "title": "Source Url",
            "type": "string"
          },
          "unified_id": {
            "description": "BID-<10 lowercase hex>",
            "title": "Unified Id",
            "type": "string"
          },
          "updated_at": {
            "description": "ISO 8601 UTC of last row write",
            "title": "Updated At",
            "type": "string"
          },
          "winner_houjin_bangou": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "13-digit \u6cd5\u4eba\u756a\u53f7 of the winner (soft ref)",
            "title": "Winner Houjin Bangou"
          },
          "winner_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "\u843d\u672d\u8005\u540d (as published)",
            "title": "Winner Name"
          }
        },
        "required": [
          "unified_id",
          "bid_title",
          "bid_kind",
          "procuring_entity",
          "source_url",
          "confidence",
          "fetched_at",
          "updated_at"
        ],
        "title": "BidOut",
        "type": "object"
      },
      "BidsSearchResponse": {
        "additionalProperties": false,
        "properties": {
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "offset": {
            "title": "Offset",
            "type": "integer"
          },
          "results": {
            "items": {
              "$ref": "#/components/schemas/BidOut"
            },
            "title": "Results",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "total",
          "limit",
          "offset",
          "results"
        ],
        "title": "BidsSearchResponse",
        "type": "object"
      },
      "BillingHistoryResponse": {
        "properties": {
          "cached_at": {
            "title": "Cached At",
            "type": "string"
          },
          "customer_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer Id"
          },
          "invoices": {
            "items": {
              "$ref": "#/components/schemas/BillingInvoice"
            },
            "title": "Invoices",
            "type": "array"
          }
        },
        "required": [
          "invoices",
          "cached_at",
          "customer_id"
        ],
        "title": "BillingHistoryResponse",
        "type": "object"
      },
      "BillingInvoice": {
        "properties": {
          "amount_due_yen": {
            "title": "Amount Due Yen",
            "type": "integer"
          },
          "amount_paid_yen": {
            "title": "Amount Paid Yen",
            "type": "integer"
          },
          "created": {
            "title": "Created",
            "type": "string"
          },
          "currency": {
            "title": "Currency",
            "type": "string"
          },
          "hosted_invoice_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Hosted Invoice Url"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "invoice_pdf": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Invoice Pdf"
          },
          "number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Number"
          },
          "period_end": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Period End"
          },
          "period_start": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Period Start"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "number",
          "period_start",
          "period_end",
          "amount_due_yen",
          "amount_paid_yen",
          "currency",
          "status",
          "hosted_invoice_url",
          "invoice_pdf",
          "created"
        ],
        "title": "BillingInvoice",
        "type": "object"
      },
      "BillingPortalResponse": {
        "properties": {
          "url": {
            "title": "Url",
            "type": "string"
          }
        },
        "required": [
          "url"
        ],
        "title": "BillingPortalResponse",
        "type": "object"
      },
      "Body_rest_validate_v1_am_validate_post": {
        "properties": {
          "applicant_data": {
            "additionalProperties": true,
            "description": "Applicant intake dict, e.g. {'plan': {'start_year': 2026, 'desired_amount_man_yen': 1500}, 'identity': {'age': 42, 'birth_date': '1983-08-12'}, 'behavioral': {'training_hours_per_year': 9000}}. Hashed via canonical JSON (sha256) for the result cache key.",
            "title": "Applicant Data",
            "type": "object"
          },
          "entity_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional am_entities.canonical_id. Filters rules pinned via scope_entity_id and is part of the cache key.",
            "title": "Entity Id"
          },
          "scope": {
            "default": "intake",
            "description": "applies_to scope. Default 'intake' selects the 6 generic predicates ported from autonomath.intake_consistency_rules.",
            "title": "Scope",
            "type": "string"
          }
        },
        "required": [
          "applicant_data"
        ],
        "title": "Body_rest_validate_v1_am_validate_post",
        "type": "object"
      },
      "CapRequest": {
        "description": "Body for POST /v1/me/cap.\n\n`monthly_cap_yen=None` -> remove the cap (uncapped, default).\n`monthly_cap_yen=N>0`  -> hard cap at \u00a5N billable spend per JST calendar\n                          month. \u00a53/req unit price unchanged; the cap is\n                          client-side budget control, not a discount.",
        "properties": {
          "monthly_cap_yen": {
            "anyOf": [
              {
                "minimum": 0.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "JPY hard cap for the calendar month. NULL = unlimited. Once reached, requests return 503 with cap_reached=true until JST \u6708\u521d.",
            "title": "Monthly Cap Yen"
          }
        },
        "title": "CapRequest",
        "type": "object"
      },
      "CapResponse": {
        "properties": {
          "monthly_cap_yen": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Monthly Cap Yen"
          },
          "ok": {
            "title": "Ok",
            "type": "boolean"
          }
        },
        "required": [
          "ok",
          "monthly_cap_yen"
        ],
        "title": "CapResponse",
        "type": "object"
      },
      "CaseStudy": {
        "description": "A \u63a1\u629e\u4e8b\u4f8b / success-story record.\n\nBacks /v1/case-studies/*. Collected from J\u30b0\u30e9\u30f3\u30c4 \u63a1\u629e\u7d50\u679c pages,\nmirasapo \u4e8b\u696d\u4e8b\u4f8b, local prefectural \u4e8b\u4f8b\u96c6, etc. Used as evidence\n(\"program X has actually paid out to a similar business\") and as a\nlookup for due-diligence on named recipients.",
        "properties": {
          "capital_yen": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Capital Yen"
          },
          "case_id": {
            "title": "Case Id",
            "type": "string"
          },
          "case_summary": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Case Summary"
          },
          "case_title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Case Title"
          },
          "company_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Company Name"
          },
          "confidence": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Confidence"
          },
          "employees": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Employees"
          },
          "fetched_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fetched At"
          },
          "founded_year": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Founded Year"
          },
          "houjin_bangou": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Houjin Bangou"
          },
          "industry_jsic": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Industry Jsic"
          },
          "industry_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Industry Name"
          },
          "is_sole_proprietor": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Sole Proprietor"
          },
          "municipality": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Municipality"
          },
          "outcomes": {
            "anyOf": [
              {
                "items": {},
                "type": "array"
              },
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Outcomes"
          },
          "patterns": {
            "anyOf": [
              {
                "items": {},
                "type": "array"
              },
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Patterns"
          },
          "prefecture": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prefecture"
          },
          "programs_used": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Programs Used",
            "type": "array"
          },
          "publication_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Publication Date"
          },
          "source_excerpt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Excerpt"
          },
          "source_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Url"
          },
          "total_subsidy_received_yen": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Subsidy Received Yen"
          }
        },
        "required": [
          "case_id"
        ],
        "title": "CaseStudy",
        "type": "object"
      },
      "CaseStudySearchResponse": {
        "properties": {
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "offset": {
            "title": "Offset",
            "type": "integer"
          },
          "results": {
            "items": {
              "$ref": "#/components/schemas/CaseStudy"
            },
            "title": "Results",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "total",
          "limit",
          "offset",
          "results"
        ],
        "title": "CaseStudySearchResponse",
        "type": "object"
      },
      "CompleteRequest": {
        "properties": {
          "stripe_checkout_session_id": {
            "title": "Stripe Checkout Session Id",
            "type": "string"
          },
          "user_code": {
            "title": "User Code",
            "type": "string"
          }
        },
        "required": [
          "user_code",
          "stripe_checkout_session_id"
        ],
        "title": "CompleteRequest",
        "type": "object"
      },
      "CompleteResponse": {
        "properties": {
          "ok": {
            "title": "Ok",
            "type": "boolean"
          }
        },
        "required": [
          "ok"
        ],
        "title": "CompleteResponse",
        "type": "object"
      },
      "ConfidencePerToolRow": {
        "additionalProperties": true,
        "properties": {
          "by_cohort": {
            "additionalProperties": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "By Cohort",
            "type": "object"
          },
          "discovery": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Discovery"
          },
          "discovery_ci95": {
            "anyOf": [
              {
                "items": {
                  "type": "number"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Discovery Ci95"
          },
          "discovery_hits": {
            "default": 0,
            "title": "Discovery Hits",
            "type": "integer"
          },
          "discovery_trials": {
            "default": 0,
            "title": "Discovery Trials",
            "type": "integer"
          },
          "tool": {
            "title": "Tool",
            "type": "string"
          },
          "use": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Use"
          },
          "use_ci95": {
            "anyOf": [
              {
                "items": {
                  "type": "number"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Use Ci95"
          },
          "use_hits": {
            "default": 0,
            "title": "Use Hits",
            "type": "integer"
          },
          "use_trials": {
            "default": 0,
            "title": "Use Trials",
            "type": "integer"
          }
        },
        "required": [
          "tool"
        ],
        "title": "ConfidencePerToolRow",
        "type": "object"
      },
      "ConfidenceResponse": {
        "additionalProperties": true,
        "description": "``GET /v1/stats/confidence`` \u2014 Bayesian Discovery+Use posteriors.",
        "properties": {
          "generated_at": {
            "title": "Generated At",
            "type": "string"
          },
          "overall": {
            "additionalProperties": true,
            "title": "Overall",
            "type": "object"
          },
          "per_tool": {
            "items": {
              "$ref": "#/components/schemas/ConfidencePerToolRow"
            },
            "title": "Per Tool",
            "type": "array"
          },
          "since": {
            "title": "Since",
            "type": "string"
          },
          "until": {
            "title": "Until",
            "type": "string"
          },
          "window_days": {
            "title": "Window Days",
            "type": "integer"
          }
        },
        "required": [
          "window_days",
          "since",
          "until",
          "generated_at"
        ],
        "title": "ConfidenceResponse",
        "type": "object"
      },
      "CourtDecision": {
        "properties": {
          "case_name": {
            "title": "Case Name",
            "type": "string"
          },
          "case_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Case Number"
          },
          "confidence": {
            "default": 0.9,
            "title": "Confidence",
            "type": "number"
          },
          "court": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Court"
          },
          "court_level": {
            "enum": [
              "supreme",
              "high",
              "district",
              "summary",
              "family"
            ],
            "title": "Court Level",
            "type": "string"
          },
          "decision_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Decision Date"
          },
          "decision_type": {
            "enum": [
              "\u5224\u6c7a",
              "\u6c7a\u5b9a",
              "\u547d\u4ee4"
            ],
            "title": "Decision Type",
            "type": "string"
          },
          "fetched_at": {
            "title": "Fetched At",
            "type": "string"
          },
          "full_text_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Full Text Url"
          },
          "impact_on_business": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Impact On Business"
          },
          "key_ruling": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Key Ruling"
          },
          "parties_involved": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Parties Involved"
          },
          "pdf_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pdf Url"
          },
          "precedent_weight": {
            "default": "informational",
            "enum": [
              "binding",
              "persuasive",
              "informational"
            ],
            "title": "Precedent Weight",
            "type": "string"
          },
          "related_law_ids": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Related Law Ids",
            "type": "array"
          },
          "source_checksum": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Checksum"
          },
          "source_excerpt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Excerpt"
          },
          "source_url": {
            "title": "Source Url",
            "type": "string"
          },
          "subject_area": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Subject Area"
          },
          "unified_id": {
            "description": "HAN-<10 lowercase hex>",
            "title": "Unified Id",
            "type": "string"
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          }
        },
        "required": [
          "unified_id",
          "case_name",
          "court_level",
          "decision_type",
          "source_url",
          "fetched_at"
        ],
        "title": "CourtDecision",
        "type": "object"
      },
      "CourtDecisionByStatuteRequest": {
        "description": "Body for POST /v1/court-decisions/by-statute.\n\nResolves decisions that cite a given law (and optionally a specific\narticle). Matches against `related_law_ids_json` on court_decisions.\nWhen `article_citation` is supplied, the match is tightened via\nLIKE on `key_ruling` / `source_excerpt` \u2014 the \u5224\u4f8b ingest does not\nyet store a structured citation map, so a fuzzy contains-check is\nthe honest signal.",
        "properties": {
          "article_citation": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "e.g. '\u7b2c5\u6761\u7b2c2\u9805'. Optional \u2014 omit for whole-law matches.",
            "title": "Article Citation"
          },
          "law_id": {
            "description": "LAW-<10 hex> unified_id",
            "title": "Law Id",
            "type": "string"
          },
          "limit": {
            "default": 20,
            "maximum": 100.0,
            "minimum": 1.0,
            "title": "Limit",
            "type": "integer"
          },
          "offset": {
            "default": 0,
            "minimum": 0.0,
            "title": "Offset",
            "type": "integer"
          }
        },
        "required": [
          "law_id"
        ],
        "title": "CourtDecisionByStatuteRequest",
        "type": "object"
      },
      "CourtDecisionSearchResponse": {
        "properties": {
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "offset": {
            "title": "Offset",
            "type": "integer"
          },
          "results": {
            "items": {
              "$ref": "#/components/schemas/CourtDecision"
            },
            "title": "Results",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "total",
          "limit",
          "offset",
          "results"
        ],
        "title": "CourtDecisionSearchResponse",
        "type": "object"
      },
      "CoverageResponse": {
        "additionalProperties": true,
        "description": "``GET /v1/stats/coverage`` \u2014 dataset row counts.",
        "properties": {
          "bids": {
            "default": 0,
            "title": "Bids",
            "type": "integer"
          },
          "case_studies": {
            "default": 0,
            "title": "Case Studies",
            "type": "integer"
          },
          "court_decisions": {
            "default": 0,
            "title": "Court Decisions",
            "type": "integer"
          },
          "enforcement_cases": {
            "default": 0,
            "title": "Enforcement Cases",
            "type": "integer"
          },
          "exclusion_rules": {
            "default": 0,
            "title": "Exclusion Rules",
            "type": "integer"
          },
          "generated_at": {
            "title": "Generated At",
            "type": "string"
          },
          "invoice_registrants": {
            "default": 0,
            "title": "Invoice Registrants",
            "type": "integer"
          },
          "laws_jpintel": {
            "default": 0,
            "title": "Laws Jpintel",
            "type": "integer"
          },
          "loan_programs": {
            "default": 0,
            "title": "Loan Programs",
            "type": "integer"
          },
          "programs": {
            "default": 0,
            "title": "Programs",
            "type": "integer"
          },
          "tax_rulesets": {
            "default": 0,
            "title": "Tax Rulesets",
            "type": "integer"
          }
        },
        "required": [
          "generated_at"
        ],
        "title": "CoverageResponse",
        "type": "object"
      },
      "DashboardSummary": {
        "description": "Top-level dashboard payload \u2014 sized for a single render pass.",
        "properties": {
          "cap_remaining_yen": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cap Remaining Yen"
          },
          "current_period_end": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Current Period End"
          },
          "days": {
            "title": "Days",
            "type": "integer"
          },
          "key_hash_prefix": {
            "title": "Key Hash Prefix",
            "type": "string"
          },
          "last_30_amount_yen": {
            "title": "Last 30 Amount Yen",
            "type": "integer"
          },
          "last_30_calls": {
            "title": "Last 30 Calls",
            "type": "integer"
          },
          "last_7_calls": {
            "title": "Last 7 Calls",
            "type": "integer"
          },
          "month_to_date_amount_yen": {
            "title": "Month To Date Amount Yen",
            "type": "integer"
          },
          "month_to_date_calls": {
            "title": "Month To Date Calls",
            "type": "integer"
          },
          "monthly_cap_yen": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Monthly Cap Yen"
          },
          "peak_day": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/jpintel_mcp__api__dashboard__UsageDay"
              },
              {
                "type": "null"
              }
            ]
          },
          "series": {
            "items": {
              "$ref": "#/components/schemas/jpintel_mcp__api__dashboard__UsageDay"
            },
            "title": "Series",
            "type": "array"
          },
          "subscription_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Subscription Status"
          },
          "tier": {
            "title": "Tier",
            "type": "string"
          },
          "today_calls": {
            "title": "Today Calls",
            "type": "integer"
          },
          "unit_price_yen": {
            "default": 3,
            "title": "Unit Price Yen",
            "type": "integer"
          }
        },
        "required": [
          "key_hash_prefix",
          "tier",
          "days",
          "series",
          "today_calls",
          "last_7_calls",
          "last_30_calls",
          "last_30_amount_yen",
          "peak_day",
          "monthly_cap_yen",
          "month_to_date_calls",
          "month_to_date_amount_yen",
          "cap_remaining_yen"
        ],
        "title": "DashboardSummary",
        "type": "object"
      },
      "DataLineage": {
        "properties": {
          "last_fetched_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Fetched At"
          },
          "unique_checksums": {
            "default": 0,
            "title": "Unique Checksums",
            "type": "integer"
          }
        },
        "title": "DataLineage",
        "type": "object"
      },
      "DataQualityResponse": {
        "additionalProperties": true,
        "description": "``GET /v1/stats/data_quality`` \u2014 per-fact uncertainty rollup (O8).\n\nAggregates the `am_uncertainty_view` view into a transparency-grade\nsummary: average per-record_kind score, license breakdown, freshness\ndistribution, and a count of cross-source-agreed facts. Emitted via\nthe same 5-min L4 cache as the other ``/v1/stats/*`` endpoints.",
        "properties": {
          "cross_source_agreement": {
            "additionalProperties": true,
            "title": "Cross Source Agreement",
            "type": "object"
          },
          "fact_count_total": {
            "default": 0,
            "title": "Fact Count Total",
            "type": "integer"
          },
          "field_kind_breakdown": {
            "additionalProperties": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Field Kind Breakdown",
            "type": "object"
          },
          "freshness_buckets": {
            "additionalProperties": {
              "type": "integer"
            },
            "title": "Freshness Buckets",
            "type": "object"
          },
          "generated_at": {
            "title": "Generated At",
            "type": "string"
          },
          "label_histogram": {
            "additionalProperties": {
              "type": "integer"
            },
            "title": "Label Histogram",
            "type": "object"
          },
          "license_breakdown": {
            "additionalProperties": {
              "type": "integer"
            },
            "title": "License Breakdown",
            "type": "object"
          },
          "mean_score": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mean Score"
          },
          "model": {
            "default": "beta_posterior_v1",
            "title": "Model",
            "type": "string"
          }
        },
        "required": [
          "generated_at"
        ],
        "title": "DataQualityResponse",
        "type": "object"
      },
      "DeactivateResponse": {
        "properties": {
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "ok": {
            "title": "Ok",
            "type": "boolean"
          }
        },
        "required": [
          "ok",
          "id"
        ],
        "title": "DeactivateResponse",
        "type": "object"
      },
      "DeadlineEntry": {
        "additionalProperties": false,
        "description": "One program whose submission window ends within the query horizon.",
        "properties": {
          "amount_max_man_yen": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Amount Max Man Yen"
          },
          "application_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Where to send the applicant \u2014 aliases official_url.",
            "title": "Application Url"
          },
          "authority_level": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Authority Level"
          },
          "days_remaining": {
            "description": "Whole days from today (UTC date) to end_date, inclusive of today.",
            "minimum": 0.0,
            "title": "Days Remaining",
            "type": "integer"
          },
          "end_date": {
            "description": "ISO YYYY-MM-DD of the next open-window close date.",
            "title": "End Date",
            "type": "string"
          },
          "prefecture": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prefecture"
          },
          "primary_name": {
            "title": "Primary Name",
            "type": "string"
          },
          "tier": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tier"
          },
          "unified_id": {
            "title": "Unified Id",
            "type": "string"
          }
        },
        "required": [
          "unified_id",
          "primary_name",
          "tier",
          "authority_level",
          "prefecture",
          "end_date",
          "days_remaining",
          "amount_max_man_yen",
          "application_url"
        ],
        "title": "DeadlineEntry",
        "type": "object"
      },
      "DeadlinesResponse": {
        "additionalProperties": false,
        "properties": {
          "as_of": {
            "description": "Today's ISO date (UTC). Makes days_remaining reproducible.",
            "title": "As Of",
            "type": "string"
          },
          "results": {
            "items": {
              "$ref": "#/components/schemas/DeadlineEntry"
            },
            "title": "Results",
            "type": "array"
          },
          "total": {
            "description": "Matching rows before `limit` was applied.",
            "title": "Total",
            "type": "integer"
          },
          "within_days": {
            "title": "Within Days",
            "type": "integer"
          }
        },
        "required": [
          "as_of",
          "within_days",
          "total",
          "results"
        ],
        "title": "DeadlinesResponse",
        "type": "object"
      },
      "DeepHealthResponse": {
        "additionalProperties": true,
        "description": "``GET /v1/am/health/deep`` \u2014 10-check aggregate.",
        "properties": {
          "checks": {
            "additionalProperties": true,
            "title": "Checks",
            "type": "object"
          },
          "generated_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Generated At"
          },
          "status": {
            "description": "ok | degraded | unhealthy",
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "status"
        ],
        "title": "DeepHealthResponse",
        "type": "object"
      },
      "DeletionRequest": {
        "properties": {
          "deletion_reason": {
            "anyOf": [
              {
                "maxLength": 2000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deletion Reason"
          },
          "identity_verification_method": {
            "enum": [
              "drivers_license",
              "my_number_card",
              "passport",
              "residence_card",
              "health_insurance_card",
              "other"
            ],
            "title": "Identity Verification Method",
            "type": "string"
          },
          "requester_email": {
            "format": "email",
            "title": "Requester Email",
            "type": "string"
          },
          "requester_legal_name": {
            "maxLength": 200,
            "minLength": 1,
            "title": "Requester Legal Name",
            "type": "string"
          },
          "target_data_categories": {
            "items": {
              "enum": [
                "representative",
                "address",
                "postal_code",
                "phone",
                "email",
                "company_url",
                "all_personal_data"
              ],
              "type": "string"
            },
            "maxItems": 7,
            "minItems": 1,
            "title": "Target Data Categories",
            "type": "array"
          },
          "target_houjin_bangou": {
            "anyOf": [
              {
                "maxLength": 13,
                "minLength": 13,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Target Houjin Bangou"
          }
        },
        "required": [
          "requester_email",
          "requester_legal_name",
          "target_data_categories",
          "identity_verification_method"
        ],
        "title": "DeletionRequest",
        "type": "object"
      },
      "DeletionResponse": {
        "properties": {
          "contact": {
            "default": "info@bookyou.net",
            "title": "Contact",
            "type": "string"
          },
          "expected_response_within_days": {
            "default": 30,
            "title": "Expected Response Within Days",
            "type": "integer"
          },
          "received_at": {
            "title": "Received At",
            "type": "string"
          },
          "request_id": {
            "title": "Request Id",
            "type": "string"
          }
        },
        "required": [
          "request_id",
          "received_at"
        ],
        "title": "DeletionResponse",
        "type": "object"
      },
      "DisclosureRequest": {
        "properties": {
          "identity_verification_method": {
            "enum": [
              "drivers_license",
              "my_number_card",
              "passport",
              "residence_card",
              "health_insurance_card",
              "other"
            ],
            "title": "Identity Verification Method",
            "type": "string"
          },
          "requester_email": {
            "format": "email",
            "title": "Requester Email",
            "type": "string"
          },
          "requester_legal_name": {
            "maxLength": 200,
            "minLength": 1,
            "title": "Requester Legal Name",
            "type": "string"
          },
          "target_houjin_bangou": {
            "anyOf": [
              {
                "maxLength": 13,
                "minLength": 13,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Target Houjin Bangou"
          }
        },
        "required": [
          "requester_email",
          "requester_legal_name",
          "identity_verification_method"
        ],
        "title": "DisclosureRequest",
        "type": "object"
      },
      "DisclosureResponse": {
        "properties": {
          "contact": {
            "default": "info@bookyou.net",
            "title": "Contact",
            "type": "string"
          },
          "expected_response_within_days": {
            "default": 14,
            "title": "Expected Response Within Days",
            "type": "integer"
          },
          "received_at": {
            "title": "Received At",
            "type": "string"
          },
          "request_id": {
            "title": "Request Id",
            "type": "string"
          }
        },
        "required": [
          "request_id",
          "received_at"
        ],
        "title": "DisclosureResponse",
        "type": "object"
      },
      "EnforcementCase": {
        "description": "A single \u4f1a\u8a08\u691c\u67fb\u9662 (Board of Audit) finding.\n\nBacks /v1/enforcement-cases/*. These are historical records of improper\nsubsidy handling (over-payment, diversion, documentation failure, etc.)\nused for compliance / due-diligence checks before advising a client on a\nprogram with prior clawback history.",
        "properties": {
          "amount_grant_paid_yen": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Amount Grant Paid Yen"
          },
          "amount_improper_grant_yen": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Amount Improper Grant Yen"
          },
          "amount_improper_project_cost_yen": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Amount Improper Project Cost Yen"
          },
          "amount_project_cost_yen": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Amount Project Cost Yen"
          },
          "amount_yen": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Amount Yen"
          },
          "bureau": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bureau"
          },
          "case_id": {
            "title": "Case Id",
            "type": "string"
          },
          "confidence": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Confidence"
          },
          "disclosed_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Disclosed Date"
          },
          "disclosed_until": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Disclosed Until"
          },
          "event_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Event Type"
          },
          "fetched_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fetched At"
          },
          "intermediate_recipient": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Intermediate Recipient"
          },
          "is_sole_proprietor": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Sole Proprietor"
          },
          "legal_basis": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Legal Basis"
          },
          "ministry": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ministry"
          },
          "occurred_fiscal_years": {
            "default": [],
            "items": {
              "type": "integer"
            },
            "title": "Occurred Fiscal Years",
            "type": "array"
          },
          "prefecture": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prefecture"
          },
          "program_name_hint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Program Name Hint"
          },
          "reason_excerpt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason Excerpt"
          },
          "recipient_houjin_bangou": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Recipient Houjin Bangou"
          },
          "recipient_kind": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Recipient Kind"
          },
          "recipient_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Recipient Name"
          },
          "source_section": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Section"
          },
          "source_title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Title"
          },
          "source_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Url"
          }
        },
        "required": [
          "case_id"
        ],
        "title": "EnforcementCase",
        "type": "object"
      },
      "EnforcementCaseSearchResponse": {
        "properties": {
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "offset": {
            "title": "Offset",
            "type": "integer"
          },
          "results": {
            "items": {
              "$ref": "#/components/schemas/EnforcementCase"
            },
            "title": "Results",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "total",
          "limit",
          "offset",
          "results"
        ],
        "title": "EnforcementCaseSearchResponse",
        "type": "object"
      },
      "ErrorBody": {
        "additionalProperties": true,
        "description": "Body of the canonical error envelope.\n\nRequired fields are ``code`` + ``message``. ``request_id`` is always\npresent in production (``make_error`` defaults to the literal ``\"unset\"``\nwhen no request id can be resolved) but is marked optional here so SDK\ngenerators emit a nullable type.\n\nExtras (``retry_after``, ``suggested_paths``, ``field_errors``,\n``severity``, ``documentation``, ``user_message_en``) are tolerated via\n``extra=\"allow\"`` so the OpenAPI schema can stay a stable minimum\ncontract without needing to enumerate per-code keys.",
        "examples": [
          {
            "code": "no_matching_records",
            "details": {
              "hint": "Try removing prefecture or expanding tier to ['S','A','B'].",
              "queried": {
                "prefecture": "\u5bae\u57ce\u770c",
                "tier": [
                  "S"
                ]
              }
            },
            "message": "No rows matched the supplied filters.",
            "request_id": "a3f12c7b9e8d4501"
          }
        ],
        "properties": {
          "code": {
            "description": "Closed-enum machine-readable error code. Agents should branch on this rather than parsing `message`.",
            "enum": [
              "missing_required_arg",
              "invalid_enum",
              "invalid_date_format",
              "out_of_range",
              "no_matching_records",
              "ambiguous_query",
              "seed_not_found",
              "db_locked",
              "db_unavailable",
              "subsystem_unavailable",
              "internal",
              "unknown_query_parameter",
              "auth_required",
              "auth_invalid",
              "rate_limit_exceeded",
              "route_not_found",
              "method_not_allowed",
              "internal_error",
              "service_unavailable",
              "cap_reached"
            ],
            "title": "Code",
            "type": "string"
          },
          "details": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Per-code extras: e.g. `retry_after` seconds for 503, `field_errors` for 422, `suggested_paths` for 404.",
            "title": "Details"
          },
          "message": {
            "description": "Plain-Japanese end-user-readable message. \u2264200 chars. Mirrored in `user_message` extra for legacy clients that read that key.",
            "title": "Message",
            "type": "string"
          },
          "request_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Echoed `x-request-id`. Always populated server-side; literal `'unset'` is used when no upstream id can be resolved.",
            "title": "Request Id"
          }
        },
        "required": [
          "code",
          "message"
        ],
        "title": "ErrorBody",
        "type": "object"
      },
      "ErrorEnvelope": {
        "additionalProperties": true,
        "description": "Top-level wrapper. The JSON body of every 4xx / 5xx is `{ \"error\": {...} }`.\n\nNote: legacy 5xx bodies also include a back-compat `detail` field at the\ntop level alongside `error`; that is documented separately on the route\ndocs and is intentionally omitted from the strict schema so callers\nmigrate to reading `error.code`.",
        "examples": [
          {
            "error": {
              "code": "rate_limit_exceeded",
              "details": {
                "retry_after": 30
              },
              "message": "\u30ec\u30fc\u30c8\u5236\u9650\u3092\u8d85\u904e\u3057\u307e\u3057\u305f\u3002Retry-After \u30d8\u30c3\u30c0\u306e\u79d2\u6570\u3060\u3051\u5f85\u3063\u3066\u304b\u3089\u518d\u8a66\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002",
              "request_id": "a3f12c7b9e8d4501"
            }
          }
        ],
        "properties": {
          "error": {
            "$ref": "#/components/schemas/ErrorBody",
            "description": "Error body \u2014 see ErrorBody."
          }
        },
        "required": [
          "error"
        ],
        "title": "ErrorEnvelope",
        "type": "object"
      },
      "EvaluateRequest": {
        "additionalProperties": false,
        "properties": {
          "business_profile": {
            "additionalProperties": true,
            "description": "Caller-supplied key/value bag. Keys referenced by predicate `field` values are looked up here. Arbitrary schema; the evaluator never fabricates values \u2014 a missing field yields a false condition with an explicit 'field missing' reason.",
            "title": "Business Profile",
            "type": "object"
          },
          "target_ruleset_ids": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional list of TAX-<10hex> ids to evaluate. When omitted, all CURRENT rulesets (effective_until IS NULL OR >= today) are evaluated. Cap: 100 ids per request.",
            "title": "Target Ruleset Ids"
          }
        },
        "required": [
          "business_profile"
        ],
        "title": "EvaluateRequest",
        "type": "object"
      },
      "EvaluateResponse": {
        "additionalProperties": false,
        "properties": {
          "results": {
            "items": {
              "$ref": "#/components/schemas/EvaluateResult"
            },
            "title": "Results",
            "type": "array"
          }
        },
        "required": [
          "results"
        ],
        "title": "EvaluateResponse",
        "type": "object"
      },
      "EvaluateResult": {
        "additionalProperties": false,
        "properties": {
          "applicable": {
            "title": "Applicable",
            "type": "boolean"
          },
          "conditions_matched": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Conditions Matched",
            "type": "array"
          },
          "conditions_unmatched": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Conditions Unmatched",
            "type": "array"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Populated when the ruleset row had malformed JSON or an unsupported predicate op. `applicable` is False in that case and `reasons` carries the parse/eval error.",
            "title": "Error"
          },
          "reasons": {
            "items": {
              "type": "string"
            },
            "title": "Reasons",
            "type": "array"
          },
          "ruleset_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ruleset Name"
          },
          "unified_id": {
            "title": "Unified Id",
            "type": "string"
          }
        },
        "required": [
          "unified_id",
          "applicable",
          "reasons",
          "conditions_matched",
          "conditions_unmatched"
        ],
        "title": "EvaluateResult",
        "type": "object"
      },
      "ExampleProfileDetail": {
        "additionalProperties": true,
        "properties": {
          "id": {
            "title": "Id",
            "type": "string"
          },
          "profile": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Profile"
          }
        },
        "required": [
          "id"
        ],
        "title": "ExampleProfileDetail",
        "type": "object"
      },
      "ExampleProfileItem": {
        "additionalProperties": true,
        "properties": {
          "filename": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Filename"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "size_bytes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Size Bytes"
          }
        },
        "required": [
          "id"
        ],
        "title": "ExampleProfileItem",
        "type": "object"
      },
      "ExampleProfileList": {
        "additionalProperties": true,
        "properties": {
          "results": {
            "items": {
              "$ref": "#/components/schemas/ExampleProfileItem"
            },
            "title": "Results",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "total"
        ],
        "title": "ExampleProfileList",
        "type": "object"
      },
      "ExclusionCheckRequest": {
        "properties": {
          "program_ids": {
            "items": {
              "type": "string"
            },
            "minItems": 1,
            "title": "Program Ids",
            "type": "array"
          }
        },
        "required": [
          "program_ids"
        ],
        "title": "ExclusionCheckRequest",
        "type": "object"
      },
      "ExclusionCheckResponse": {
        "properties": {
          "checked_rules": {
            "title": "Checked Rules",
            "type": "integer"
          },
          "hits": {
            "items": {
              "$ref": "#/components/schemas/ExclusionHit"
            },
            "title": "Hits",
            "type": "array"
          },
          "program_ids": {
            "items": {
              "type": "string"
            },
            "title": "Program Ids",
            "type": "array"
          }
        },
        "required": [
          "program_ids",
          "hits",
          "checked_rules"
        ],
        "title": "ExclusionCheckResponse",
        "type": "object"
      },
      "ExclusionHit": {
        "properties": {
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "kind": {
            "title": "Kind",
            "type": "string"
          },
          "programs_involved": {
            "items": {
              "type": "string"
            },
            "title": "Programs Involved",
            "type": "array"
          },
          "rule_id": {
            "title": "Rule Id",
            "type": "string"
          },
          "severity": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Severity"
          },
          "source_urls": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Source Urls",
            "type": "array"
          }
        },
        "required": [
          "rule_id",
          "kind",
          "severity",
          "programs_involved",
          "description"
        ],
        "title": "ExclusionHit",
        "type": "object"
      },
      "ExclusionRule": {
        "properties": {
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "extra": {
            "additionalProperties": true,
            "default": {},
            "title": "Extra",
            "type": "object"
          },
          "kind": {
            "title": "Kind",
            "type": "string"
          },
          "program_a": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Program A"
          },
          "program_b": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Program B"
          },
          "program_b_group": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Program B Group",
            "type": "array"
          },
          "rule_id": {
            "title": "Rule Id",
            "type": "string"
          },
          "severity": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Severity"
          },
          "source_notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Notes"
          },
          "source_urls": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Source Urls",
            "type": "array"
          }
        },
        "required": [
          "rule_id",
          "kind"
        ],
        "title": "ExclusionRule",
        "type": "object"
      },
      "FeedbackRequest": {
        "properties": {
          "endpoint": {
            "anyOf": [
              {
                "maxLength": 256,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Endpoint"
          },
          "message": {
            "maxLength": 4000,
            "minLength": 1,
            "title": "Message",
            "type": "string"
          },
          "rating": {
            "anyOf": [
              {
                "maximum": 5.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rating"
          },
          "request_id": {
            "anyOf": [
              {
                "maxLength": 128,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Request Id"
          }
        },
        "required": [
          "message"
        ],
        "title": "FeedbackRequest",
        "type": "object"
      },
      "FeedbackResponse": {
        "properties": {
          "feedback_id": {
            "title": "Feedback Id",
            "type": "integer"
          },
          "received": {
            "title": "Received",
            "type": "boolean"
          }
        },
        "required": [
          "received",
          "feedback_id"
        ],
        "title": "FeedbackResponse",
        "type": "object"
      },
      "FreshnessResponse": {
        "additionalProperties": true,
        "description": "``GET /v1/stats/freshness`` \u2014 per-source min/max/avg fetched_at.",
        "properties": {
          "generated_at": {
            "title": "Generated At",
            "type": "string"
          },
          "sources": {
            "additionalProperties": {
              "$ref": "#/components/schemas/FreshnessSourceStat"
            },
            "title": "Sources",
            "type": "object"
          }
        },
        "required": [
          "generated_at"
        ],
        "title": "FreshnessResponse",
        "type": "object"
      },
      "FreshnessSourceStat": {
        "additionalProperties": true,
        "description": "Per-source freshness stats inside ``FreshnessResponse.sources``.",
        "properties": {
          "avg_interval_days": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Avg Interval Days"
          },
          "count": {
            "default": 0,
            "title": "Count",
            "type": "integer"
          },
          "max": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max"
          },
          "min": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Min"
          }
        },
        "title": "FreshnessSourceStat",
        "type": "object"
      },
      "GetResponse": {
        "additionalProperties": false,
        "properties": {
          "attribution": {
            "$ref": "#/components/schemas/AttributionBlock"
          },
          "result": {
            "$ref": "#/components/schemas/InvoiceRegistrantOut"
          }
        },
        "required": [
          "result",
          "attribution"
        ],
        "title": "GetResponse",
        "type": "object"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "title": "Detail",
            "type": "array"
          }
        },
        "title": "HTTPValidationError",
        "type": "object"
      },
      "InvoiceRegistrantOut": {
        "additionalProperties": false,
        "description": "Single \u9069\u683c\u8acb\u6c42\u66f8\u767a\u884c\u4e8b\u696d\u8005 row. Columns map 1:1 onto\n019_invoice_registrants.sql's `invoice_registrants` table.",
        "properties": {
          "address_normalized": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "\u6240\u5728\u5730 (normalized; may be NULL)",
            "title": "Address Normalized"
          },
          "confidence": {
            "description": "0..1 lineage confidence",
            "title": "Confidence",
            "type": "number"
          },
          "expired_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "\u5931\u52b9\u65e5 (NULL = \u672a\u5931\u52b9)",
            "title": "Expired Date"
          },
          "fetched_at": {
            "description": "ISO 8601 UTC when we last successfully fetched this row. Rendered as '\u51fa\u5178\u53d6\u5f97' on public surfaces (not '\u6700\u7d42\u66f4\u65b0').",
            "title": "Fetched At",
            "type": "string"
          },
          "houjin_bangou": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "13-digit \u6cd5\u4eba\u756a\u53f7. NULL for sole proprietors / 'other'. Soft reference to houjin_master (no hard FK).",
            "title": "Houjin Bangou"
          },
          "invoice_registration_number": {
            "description": "'T' + 13 digits (14 chars total). Primary key.",
            "title": "Invoice Registration Number",
            "type": "string"
          },
          "last_updated_nta": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "NTA's timestamp on this record",
            "title": "Last Updated Nta"
          },
          "normalized_name": {
            "description": "\u4e8b\u696d\u8005\u540d (\u516c\u8868\u540d\u79f0)",
            "title": "Normalized Name",
            "type": "string"
          },
          "prefecture": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "\u90fd\u9053\u5e9c\u770c",
            "title": "Prefecture"
          },
          "registered_date": {
            "description": "\u767b\u9332\u65e5 (ISO 8601)",
            "title": "Registered Date",
            "type": "string"
          },
          "registrant_kind": {
            "description": "corporation (\u6cd5\u4eba) | sole_proprietor (\u500b\u4eba\u4e8b\u696d\u4e3b) | other",
            "enum": [
              "corporation",
              "sole_proprietor",
              "other"
            ],
            "title": "Registrant Kind",
            "type": "string"
          },
          "revoked_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "\u53d6\u6d88\u65e5 (NULL = \u672a\u53d6\u6d88)",
            "title": "Revoked Date"
          },
          "source_checksum": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "optional SHA-256 of raw bulk file",
            "title": "Source Checksum"
          },
          "source_url": {
            "description": "primary source URL (https://www.invoice-kohyo.nta.go.jp/download/...)",
            "title": "Source Url",
            "type": "string"
          },
          "trade_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "\u5c4b\u53f7\u7b49 (may be NULL)",
            "title": "Trade Name"
          },
          "updated_at": {
            "description": "ISO 8601 UTC of last row write in our DB",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "invoice_registration_number",
          "normalized_name",
          "registered_date",
          "registrant_kind",
          "source_url",
          "confidence",
          "fetched_at",
          "updated_at"
        ],
        "title": "InvoiceRegistrantOut",
        "type": "object"
      },
      "KeyIssueRequest": {
        "properties": {
          "session_id": {
            "title": "Session Id",
            "type": "string"
          }
        },
        "required": [
          "session_id"
        ],
        "title": "KeyIssueRequest",
        "type": "object"
      },
      "KeyIssueResponse": {
        "properties": {
          "api_key": {
            "title": "Api Key",
            "type": "string"
          },
          "customer_id": {
            "title": "Customer Id",
            "type": "string"
          },
          "tier": {
            "title": "Tier",
            "type": "string"
          }
        },
        "required": [
          "api_key",
          "tier",
          "customer_id"
        ],
        "title": "KeyIssueResponse",
        "type": "object"
      },
      "Law": {
        "properties": {
          "article_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Article Count"
          },
          "confidence": {
            "default": 0.95,
            "title": "Confidence",
            "type": "number"
          },
          "enforced_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Enforced Date"
          },
          "fetched_at": {
            "title": "Fetched At",
            "type": "string"
          },
          "full_text_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Full Text Url"
          },
          "last_amended_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Amended Date"
          },
          "law_number": {
            "title": "Law Number",
            "type": "string"
          },
          "law_short_title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Law Short Title"
          },
          "law_title": {
            "title": "Law Title",
            "type": "string"
          },
          "law_type": {
            "enum": [
              "constitution",
              "act",
              "cabinet_order",
              "imperial_order",
              "ministerial_ordinance",
              "rule",
              "notice",
              "guideline"
            ],
            "title": "Law Type",
            "type": "string"
          },
          "ministry": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ministry"
          },
          "promulgated_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Promulgated Date"
          },
          "revision_status": {
            "default": "current",
            "enum": [
              "current",
              "superseded",
              "repealed"
            ],
            "title": "Revision Status",
            "type": "string"
          },
          "source_checksum": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Checksum"
          },
          "source_url": {
            "title": "Source Url",
            "type": "string"
          },
          "subject_areas": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Subject Areas",
            "type": "array"
          },
          "summary": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Summary"
          },
          "superseded_by_law_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Superseded By Law Id"
          },
          "unified_id": {
            "description": "LAW-<10 lowercase hex>",
            "title": "Unified Id",
            "type": "string"
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          }
        },
        "required": [
          "unified_id",
          "law_number",
          "law_title",
          "law_type",
          "source_url",
          "fetched_at"
        ],
        "title": "Law",
        "type": "object"
      },
      "LawSearchResponse": {
        "properties": {
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "offset": {
            "title": "Offset",
            "type": "integer"
          },
          "results": {
            "items": {
              "$ref": "#/components/schemas/Law"
            },
            "title": "Results",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "total",
          "limit",
          "offset",
          "results"
        ],
        "title": "LawSearchResponse",
        "type": "object"
      },
      "LoanProgram": {
        "description": "A \u878d\u8cc7\u30d7\u30ed\u30b0\u30e9\u30e0 row \u2014 \u65e5\u672c\u653f\u7b56\u91d1\u878d\u516c\u5eab / \u5730\u65b9\u81ea\u6cbb\u4f53 / \u4fe1\u91d1 etc.\n\nBacks /v1/loan-programs/*. Post-2026-04-23 the `security_required` free\ntext has been normalised into three independent axes (collateral,\npersonal guarantor, third-party guarantor) so callers can filter\n\"\u7121\u62c5\u4fdd\u30fb\u7121\u4fdd\u8a3c only\" vs. \"\u62c5\u4fdd\u3042\u308a\uff0b\u4ee3\u8868\u8005\u4fdd\u8a3c\u3042\u308a\" without parsing JP prose.",
        "properties": {
          "amount_max_yen": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Amount Max Yen"
          },
          "collateral_required": {
            "anyOf": [
              {
                "enum": [
                  "required",
                  "not_required",
                  "negotiable",
                  "unknown"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Collateral Required"
          },
          "confidence": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Confidence"
          },
          "fetched_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fetched At"
          },
          "grace_period_years_max": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Grace Period Years Max"
          },
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "interest_rate_base_annual": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Interest Rate Base Annual"
          },
          "interest_rate_special_annual": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Interest Rate Special Annual"
          },
          "loan_period_years_max": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Loan Period Years Max"
          },
          "loan_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Loan Type"
          },
          "official_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Official Url"
          },
          "personal_guarantor_required": {
            "anyOf": [
              {
                "enum": [
                  "required",
                  "not_required",
                  "negotiable",
                  "unknown"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Personal Guarantor Required"
          },
          "program_name": {
            "title": "Program Name",
            "type": "string"
          },
          "provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider"
          },
          "rate_names": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rate Names"
          },
          "security_notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Security Notes"
          },
          "security_required": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Security Required"
          },
          "source_excerpt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Excerpt"
          },
          "target_conditions": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Target Conditions"
          },
          "third_party_guarantor_required": {
            "anyOf": [
              {
                "enum": [
                  "required",
                  "not_required",
                  "negotiable",
                  "unknown"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Third Party Guarantor Required"
          }
        },
        "required": [
          "id",
          "program_name"
        ],
        "title": "LoanProgram",
        "type": "object"
      },
      "LoanProgramSearchResponse": {
        "properties": {
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "offset": {
            "title": "Offset",
            "type": "integer"
          },
          "results": {
            "items": {
              "$ref": "#/components/schemas/LoanProgram"
            },
            "title": "Results",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "total",
          "limit",
          "offset",
          "results"
        ],
        "title": "LoanProgramSearchResponse",
        "type": "object"
      },
      "MatchResponse": {
        "additionalProperties": false,
        "properties": {
          "ranking": {
            "additionalProperties": {
              "type": "string"
            },
            "title": "Ranking",
            "type": "object"
          },
          "results": {
            "items": {
              "$ref": "#/components/schemas/AdvisorOut"
            },
            "title": "Results",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "total",
          "results"
        ],
        "title": "MatchResponse",
        "type": "object"
      },
      "MeResponse": {
        "properties": {
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "customer_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer Id"
          },
          "key_hash_prefix": {
            "title": "Key Hash Prefix",
            "type": "string"
          },
          "subscription_cancel_at_period_end": {
            "title": "Subscription Cancel At Period End",
            "type": "boolean"
          },
          "subscription_current_period_end": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Subscription Current Period End"
          },
          "subscription_status": {
            "title": "Subscription Status",
            "type": "string"
          },
          "tier": {
            "title": "Tier",
            "type": "string"
          }
        },
        "required": [
          "tier",
          "key_hash_prefix",
          "customer_id",
          "created_at",
          "subscription_status",
          "subscription_current_period_end",
          "subscription_cancel_at_period_end"
        ],
        "title": "MeResponse",
        "type": "object"
      },
      "Meta": {
        "properties": {
          "data_as_of": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Data As Of"
          },
          "data_lineage": {
            "$ref": "#/components/schemas/DataLineage",
            "default": {
              "unique_checksums": 0
            }
          },
          "exclusion_rules_count": {
            "title": "Exclusion Rules Count",
            "type": "integer"
          },
          "last_ingested_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Ingested At"
          },
          "prefecture_counts": {
            "additionalProperties": {
              "type": "integer"
            },
            "title": "Prefecture Counts",
            "type": "object"
          },
          "tier_counts": {
            "additionalProperties": {
              "type": "integer"
            },
            "title": "Tier Counts",
            "type": "object"
          },
          "total_programs": {
            "title": "Total Programs",
            "type": "integer"
          }
        },
        "required": [
          "total_programs",
          "tier_counts",
          "prefecture_counts",
          "exclusion_rules_count",
          "last_ingested_at"
        ],
        "title": "Meta",
        "type": "object"
      },
      "MetaFreshnessResponse": {
        "additionalProperties": true,
        "description": "``GET /v1/meta/freshness`` \u2014 public anti-staleness feed.",
        "properties": {
          "generated_at": {
            "title": "Generated At",
            "type": "string"
          },
          "median_fetched_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Median Fetched At"
          },
          "pct_over_180d": {
            "default": 0.0,
            "title": "Pct Over 180D",
            "type": "number"
          },
          "pct_within_30d": {
            "default": 0.0,
            "title": "Pct Within 30D",
            "type": "number"
          },
          "top_rows": {
            "items": {
              "$ref": "#/components/schemas/MetaFreshnessRow"
            },
            "title": "Top Rows",
            "type": "array"
          },
          "total": {
            "default": 0,
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "generated_at"
        ],
        "title": "MetaFreshnessResponse",
        "type": "object"
      },
      "MetaFreshnessRow": {
        "additionalProperties": true,
        "properties": {
          "canonical_id": {
            "title": "Canonical Id",
            "type": "string"
          },
          "days_ago": {
            "default": 0,
            "title": "Days Ago",
            "type": "integer"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "source_fetched_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Fetched At"
          },
          "tier": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tier"
          }
        },
        "required": [
          "canonical_id",
          "name"
        ],
        "title": "MetaFreshnessRow",
        "type": "object"
      },
      "PingResponse": {
        "properties": {
          "authenticated": {
            "title": "Authenticated",
            "type": "boolean"
          },
          "ok": {
            "title": "Ok",
            "type": "boolean"
          },
          "rate_limit_remaining": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rate Limit Remaining"
          },
          "server_time_utc": {
            "title": "Server Time Utc",
            "type": "string"
          },
          "server_version": {
            "title": "Server Version",
            "type": "string"
          },
          "tier": {
            "title": "Tier",
            "type": "string"
          }
        },
        "required": [
          "ok",
          "authenticated",
          "tier",
          "server_time_utc",
          "server_version",
          "rate_limit_remaining"
        ],
        "title": "PingResponse",
        "type": "object"
      },
      "PortalRequest": {
        "properties": {
          "customer_id": {
            "title": "Customer Id",
            "type": "string"
          },
          "return_url": {
            "title": "Return Url",
            "type": "string"
          }
        },
        "required": [
          "customer_id",
          "return_url"
        ],
        "title": "PortalRequest",
        "type": "object"
      },
      "PrescreenMatch": {
        "additionalProperties": false,
        "properties": {
          "amount_max_man_yen": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Amount Max Man Yen"
          },
          "authority_level": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Authority Level"
          },
          "caveats": {
            "description": "Conditions the caller has NOT met or we couldn't verify (e.g., missing \u8a8d\u5b9a\u65b0\u898f\u5c31\u8fb2\u8005 prerequisite, amount_max below planned_investment). Empty list == no known caveats.",
            "items": {
              "type": "string"
            },
            "title": "Caveats",
            "type": "array"
          },
          "fit_score": {
            "description": "Heuristic positive-match count in v1 (higher = better fit). Ranges 0..~5. NOT a probability; compare rows within one response only.",
            "title": "Fit Score",
            "type": "integer"
          },
          "match_reasons": {
            "description": "Human-readable reasons this row scored positively.",
            "items": {
              "type": "string"
            },
            "title": "Match Reasons",
            "type": "array"
          },
          "official_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Official Url"
          },
          "prefecture": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prefecture"
          },
          "primary_name": {
            "title": "Primary Name",
            "type": "string"
          },
          "tier": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tier"
          },
          "unified_id": {
            "title": "Unified Id",
            "type": "string"
          }
        },
        "required": [
          "unified_id",
          "primary_name",
          "tier",
          "authority_level",
          "prefecture",
          "amount_max_man_yen",
          "official_url",
          "fit_score",
          "match_reasons",
          "caveats"
        ],
        "title": "PrescreenMatch",
        "type": "object"
      },
      "PrescreenRequest": {
        "additionalProperties": false,
        "description": "Caller's business profile. All fields optional \u2014 the more you supply,\nthe sharper the scoring. An empty profile returns the same default\nranking search_programs uses (tier first), just wrapped in the prescreen\nenvelope so the caller gets a consistent shape.",
        "properties": {
          "company_url": {
            "anyOf": [
              {
                "maxLength": 500,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Honeypot. Real callers MUST leave this null/empty. The web form hides this field via CSS; only autofilled bots populate it. Any non-empty value is treated as abuse and rejected.",
            "title": "Company Url"
          },
          "declared_certifications": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "maxItems": 20,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Certifications the caller has declared (e.g., '\u8a8d\u5b9a\u65b0\u898f\u5c31\u8fb2\u8005', '\u8a8d\u5b9a\u8fb2\u696d\u8005', '\u7d4c\u55b6\u9769\u65b0\u8a08\u753b\u627f\u8a8d'). Used to suppress 'prerequisite-missing' flags.",
            "title": "Declared Certifications"
          },
          "employee_count": {
            "anyOf": [
              {
                "maximum": 100000.0,
                "minimum": 0.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Number of employees.",
            "title": "Employee Count"
          },
          "founded_year": {
            "anyOf": [
              {
                "maximum": 2100.0,
                "minimum": 1800.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Western calendar year of incorporation / founding.",
            "title": "Founded Year"
          },
          "houjin_bangou": {
            "anyOf": [
              {
                "maxLength": 13,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "13-digit \u56fd\u7a0e\u5e81 \u6cd5\u4eba\u756a\u53f7. Stored for identity only.",
            "title": "Houjin Bangou"
          },
          "industry_jsic": {
            "anyOf": [
              {
                "maxLength": 10,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "JSIC \u5927\u5206\u985e letter (A..T). Accepts JP names ('\u88fd\u9020\u696d', '\u8fb2\u696d'). Used for hints only in v1 \u2014 does not exclude programs because program-level industry tagging coverage is thin.",
            "title": "Industry Jsic"
          },
          "is_sole_proprietor": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "True = \u500b\u4eba\u4e8b\u696d\u4e3b. False = \u6cd5\u4eba (incl. \u682a\u5f0f\u4f1a\u793e/\u5408\u540c\u4f1a\u793e/\u7d44\u5408). None = unspecified (match against both target_types).",
            "title": "Is Sole Proprietor"
          },
          "limit": {
            "default": 10,
            "description": "Max rows to return. Default 10.",
            "maximum": 50.0,
            "minimum": 1.0,
            "title": "Limit",
            "type": "integer"
          },
          "planned_investment_man_yen": {
            "anyOf": [
              {
                "minimum": 0.0,
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Planned project cost in \u4e07\u5186 (NOT \u5186). Used for amount sufficiency check \u2014 programs whose amount_max_man_yen is below this value are flagged as 'undersized'.",
            "title": "Planned Investment Man Yen"
          },
          "prefecture": {
            "anyOf": [
              {
                "maxLength": 40,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Caller's prefecture. Accepts canonical ('\u6771\u4eac\u90fd'), short ('\u6771\u4eac'), or romaji ('Tokyo'). Use '\u5168\u56fd' / 'national' / None to skip the prefecture filter entirely (you still get national programs).",
            "title": "Prefecture"
          },
          "revenue_yen": {
            "anyOf": [
              {
                "minimum": 0.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Annual revenue in JPY (NOT \u4e07\u5186). Used for SME/\u5927\u4f01\u696d split only.",
            "title": "Revenue Yen"
          }
        },
        "title": "PrescreenRequest",
        "type": "object"
      },
      "PrescreenResponse": {
        "additionalProperties": false,
        "properties": {
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "profile_echo": {
            "additionalProperties": true,
            "description": "The normalized profile actually used for matching, so the caller can verify e.g. that 'Tokyo' -> '\u6771\u4eac\u90fd'.",
            "title": "Profile Echo",
            "type": "object"
          },
          "results": {
            "items": {
              "$ref": "#/components/schemas/PrescreenMatch"
            },
            "title": "Results",
            "type": "array"
          },
          "total_considered": {
            "description": "Rows passing the hard prefecture / national filter before ranking. `results` is ranked top-N of this set.",
            "title": "Total Considered",
            "type": "integer"
          }
        },
        "required": [
          "total_considered",
          "limit",
          "results",
          "profile_echo"
        ],
        "title": "PrescreenResponse",
        "type": "object"
      },
      "Program": {
        "properties": {
          "a_to_j_coverage": {
            "additionalProperties": true,
            "default": {},
            "title": "A To J Coverage",
            "type": "object"
          },
          "aliases": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Aliases",
            "type": "array"
          },
          "amount_band": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Amount Band"
          },
          "amount_max_man_yen": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Amount Max Man Yen"
          },
          "amount_min_man_yen": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Amount Min Man Yen"
          },
          "application_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "URL the caller should send an applicant to. Currently aliases official_url; once enriched \u7533\u8acb\u65b9\u6cd5 extraction stabilises this will prefer the dedicated apply page when one exists.",
            "title": "Application Url"
          },
          "application_window": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Application Window"
          },
          "authority_level": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Authority Level"
          },
          "authority_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Authority Name"
          },
          "coverage_score": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Coverage Score"
          },
          "crop_categories": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Crop Categories",
            "type": "array"
          },
          "equipment_category": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Equipment Category"
          },
          "excluded": {
            "default": false,
            "title": "Excluded",
            "type": "boolean"
          },
          "exclusion_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Exclusion Reason"
          },
          "funding_purpose": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Funding Purpose",
            "type": "array"
          },
          "gap_to_tier_s": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Gap To Tier S",
            "type": "array"
          },
          "municipality": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Municipality"
          },
          "next_deadline": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ISO date of the next open-window end_date from application_window, or null when the window is rolling / unknown / already past.",
            "title": "Next Deadline"
          },
          "official_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Official Url"
          },
          "prefecture": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prefecture"
          },
          "primary_name": {
            "title": "Primary Name",
            "type": "string"
          },
          "program_kind": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Program Kind"
          },
          "subsidy_rate": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Subsidy Rate"
          },
          "target_types": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Target Types",
            "type": "array"
          },
          "tier": {
            "anyOf": [
              {
                "enum": [
                  "S",
                  "A",
                  "B",
                  "C",
                  "X"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tier"
          },
          "trust_level": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Trust Level"
          },
          "unified_id": {
            "title": "Unified Id",
            "type": "string"
          }
        },
        "required": [
          "unified_id",
          "primary_name"
        ],
        "title": "Program",
        "type": "object"
      },
      "ProgramDetail": {
        "properties": {
          "a_to_j_coverage": {
            "additionalProperties": true,
            "default": {},
            "title": "A To J Coverage",
            "type": "object"
          },
          "aliases": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Aliases",
            "type": "array"
          },
          "amount_band": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Amount Band"
          },
          "amount_max_man_yen": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Amount Max Man Yen"
          },
          "amount_min_man_yen": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Amount Min Man Yen"
          },
          "application_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "URL the caller should send an applicant to. Currently aliases official_url; once enriched \u7533\u8acb\u65b9\u6cd5 extraction stabilises this will prefer the dedicated apply page when one exists.",
            "title": "Application Url"
          },
          "application_window": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Application Window"
          },
          "authority_level": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Authority Level"
          },
          "authority_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Authority Name"
          },
          "coverage_score": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Coverage Score"
          },
          "crop_categories": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Crop Categories",
            "type": "array"
          },
          "enriched": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Enriched"
          },
          "equipment_category": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Equipment Category"
          },
          "excluded": {
            "default": false,
            "title": "Excluded",
            "type": "boolean"
          },
          "exclusion_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Exclusion Reason"
          },
          "funding_purpose": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Funding Purpose",
            "type": "array"
          },
          "gap_to_tier_s": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Gap To Tier S",
            "type": "array"
          },
          "municipality": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Municipality"
          },
          "next_deadline": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ISO date of the next open-window end_date from application_window, or null when the window is rolling / unknown / already past.",
            "title": "Next Deadline"
          },
          "official_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Official Url"
          },
          "prefecture": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prefecture"
          },
          "primary_name": {
            "title": "Primary Name",
            "type": "string"
          },
          "program_kind": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Program Kind"
          },
          "required_documents": {
            "description": "Best-effort list of required document names extracted from the enriched procedure dimension. Empty list = we haven't extracted documents for this program yet (not 'none needed').",
            "items": {
              "type": "string"
            },
            "title": "Required Documents",
            "type": "array"
          },
          "source_checksum": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Checksum"
          },
          "source_fetched_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Fetched At"
          },
          "source_mentions": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "items": {},
                "type": "array"
              }
            ],
            "default": {},
            "title": "Source Mentions"
          },
          "source_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Url"
          },
          "subsidy_rate": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Subsidy Rate"
          },
          "target_types": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Target Types",
            "type": "array"
          },
          "tier": {
            "anyOf": [
              {
                "enum": [
                  "S",
                  "A",
                  "B",
                  "C",
                  "X"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tier"
          },
          "trust_level": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Trust Level"
          },
          "unified_id": {
            "title": "Unified Id",
            "type": "string"
          }
        },
        "required": [
          "unified_id",
          "primary_name"
        ],
        "title": "ProgramDetail",
        "type": "object"
      },
      "RefundRequest": {
        "properties": {
          "amount_yen": {
            "anyOf": [
              {
                "maximum": 10000000.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Amount Yen"
          },
          "customer_id": {
            "maxLength": 120,
            "minLength": 1,
            "title": "Customer Id",
            "type": "string"
          },
          "reason": {
            "maxLength": 2000,
            "minLength": 1,
            "title": "Reason",
            "type": "string"
          },
          "requester_email": {
            "format": "email",
            "title": "Requester Email",
            "type": "string"
          }
        },
        "required": [
          "requester_email",
          "customer_id",
          "reason"
        ],
        "title": "RefundRequest",
        "type": "object"
      },
      "RefundResponse": {
        "properties": {
          "contact": {
            "default": "info@bookyou.net",
            "title": "Contact",
            "type": "string"
          },
          "expected_response_within_days": {
            "default": 14,
            "title": "Expected Response Within Days",
            "type": "integer"
          },
          "note": {
            "default": "\u8fd4\u91d1\u306f\u624b\u52d5\u5be9\u67fb\u3068\u306a\u308a\u307e\u3059\u3002\u65e2\u306b\u8ab2\u91d1\u6e08\u307f\u306e \u00a53/req \u30e1\u30fc\u30bf\u30ea\u30f3\u30b0\u5206\u306f \u81ea\u52d5\u53d6\u6d88\u3057\u3055\u308c\u307e\u305b\u3093 \u2014 \u5be9\u67fb\u5b8c\u4e86\u5f8c\u3001\u904b\u55b6\u304b\u3089\u500b\u5225\u306b\u3054\u9023\u7d61\u3057\u307e\u3059\u3002",
            "title": "Note",
            "type": "string"
          },
          "received_at": {
            "title": "Received At",
            "type": "string"
          },
          "request_id": {
            "title": "Request Id",
            "type": "string"
          }
        },
        "required": [
          "request_id",
          "received_at"
        ],
        "title": "RefundResponse",
        "type": "object"
      },
      "RelatedProgramRef": {
        "description": "A program citing a given law (reverse lookup via program_law_refs).",
        "properties": {
          "article_citation": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Article Citation"
          },
          "confidence": {
            "default": 0.9,
            "title": "Confidence",
            "type": "number"
          },
          "fetched_at": {
            "title": "Fetched At",
            "type": "string"
          },
          "program_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Program Name"
          },
          "program_unified_id": {
            "title": "Program Unified Id",
            "type": "string"
          },
          "ref_kind": {
            "description": "One of: authority | eligibility | exclusion | reference | penalty",
            "title": "Ref Kind",
            "type": "string"
          },
          "source_url": {
            "title": "Source Url",
            "type": "string"
          }
        },
        "required": [
          "program_unified_id",
          "ref_kind",
          "source_url",
          "fetched_at"
        ],
        "title": "RelatedProgramRef",
        "type": "object"
      },
      "RelatedProgramsResponse": {
        "properties": {
          "law_unified_id": {
            "title": "Law Unified Id",
            "type": "string"
          },
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "offset": {
            "title": "Offset",
            "type": "integer"
          },
          "results": {
            "items": {
              "$ref": "#/components/schemas/RelatedProgramRef"
            },
            "title": "Results",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "law_unified_id",
          "total",
          "limit",
          "offset",
          "results"
        ],
        "title": "RelatedProgramsResponse",
        "type": "object"
      },
      "ReportConversionRequest": {
        "additionalProperties": false,
        "properties": {
          "conversion_value_yen": {
            "anyOf": [
              {
                "minimum": 0.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Conversion Value Yen"
          },
          "evidence_url": {
            "anyOf": [
              {
                "format": "uri",
                "maxLength": 2083,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Evidence Url"
          },
          "referral_token": {
            "title": "Referral Token",
            "type": "string"
          }
        },
        "required": [
          "referral_token"
        ],
        "title": "ReportConversionRequest",
        "type": "object"
      },
      "RotateKeyResponse": {
        "properties": {
          "api_key": {
            "title": "Api Key",
            "type": "string"
          },
          "tier": {
            "title": "Tier",
            "type": "string"
          }
        },
        "required": [
          "api_key",
          "tier"
        ],
        "title": "RotateKeyResponse",
        "type": "object"
      },
      "SessionRequest": {
        "properties": {
          "api_key": {
            "maxLength": 256,
            "minLength": 8,
            "title": "Api Key",
            "type": "string"
          }
        },
        "required": [
          "api_key"
        ],
        "title": "SessionRequest",
        "type": "object"
      },
      "SessionResponse": {
        "properties": {
          "key_hash_prefix": {
            "title": "Key Hash Prefix",
            "type": "string"
          },
          "tier": {
            "title": "Tier",
            "type": "string"
          }
        },
        "required": [
          "tier",
          "key_hash_prefix"
        ],
        "title": "SessionResponse",
        "type": "object"
      },
      "SignupRequest": {
        "additionalProperties": false,
        "properties": {
          "address": {
            "anyOf": [
              {
                "maxLength": 500,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Address"
          },
          "agreed_to_terms": {
            "description": "must be true",
            "title": "Agreed To Terms",
            "type": "boolean"
          },
          "city": {
            "anyOf": [
              {
                "maxLength": 100,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "City"
          },
          "commission_model": {
            "default": "flat",
            "enum": [
              "flat",
              "percent"
            ],
            "title": "Commission Model",
            "type": "string"
          },
          "commission_rate_pct": {
            "default": 5,
            "maximum": 30.0,
            "minimum": 1.0,
            "title": "Commission Rate Pct",
            "type": "integer"
          },
          "commission_yen_per_intro": {
            "default": 3000,
            "maximum": 100000.0,
            "minimum": 100.0,
            "title": "Commission Yen Per Intro",
            "type": "integer"
          },
          "contact_email": {
            "format": "email",
            "title": "Contact Email",
            "type": "string"
          },
          "contact_phone": {
            "anyOf": [
              {
                "maxLength": 30,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Contact Phone"
          },
          "contact_url": {
            "anyOf": [
              {
                "format": "uri",
                "maxLength": 2083,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Contact Url"
          },
          "firm_name": {
            "maxLength": 200,
            "minLength": 1,
            "title": "Firm Name",
            "type": "string"
          },
          "firm_name_kana": {
            "anyOf": [
              {
                "maxLength": 200,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Firm Name Kana"
          },
          "firm_type": {
            "enum": [
              "\u7a0e\u7406\u58eb\u6cd5\u4eba",
              "\u8a8d\u5b9a\u652f\u63f4\u6a5f\u95a2",
              "\u793e\u4f1a\u4fdd\u967a\u52b4\u52d9\u58eb",
              "\u4e2d\u5c0f\u4f01\u696d\u8a3a\u65ad\u58eb",
              "\u884c\u653f\u66f8\u58eb",
              "\u5f01\u8b77\u58eb",
              "\u9280\u884c",
              "\u5546\u5de5\u4f1a\u8b70\u6240",
              "\u305d\u306e\u4ed6"
            ],
            "title": "Firm Type",
            "type": "string"
          },
          "houjin_bangou": {
            "description": "13 digits",
            "title": "Houjin Bangou",
            "type": "string"
          },
          "industries": {
            "anyOf": [
              {
                "items": {
                  "enum": [
                    "agri",
                    "manufacture",
                    "it",
                    "service",
                    "construction",
                    "retail"
                  ],
                  "type": "string"
                },
                "maxItems": 6,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Industries"
          },
          "intro_blurb": {
            "anyOf": [
              {
                "maxLength": 400,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Intro Blurb"
          },
          "prefecture": {
            "description": "canonical ('\u6771\u4eac\u90fd')",
            "title": "Prefecture",
            "type": "string"
          },
          "specialties": {
            "items": {
              "enum": [
                "subsidy",
                "loan",
                "tax",
                "enforcement_defense",
                "invoice",
                "ebook"
              ],
              "type": "string"
            },
            "maxItems": 6,
            "minItems": 1,
            "title": "Specialties",
            "type": "array"
          }
        },
        "required": [
          "firm_name",
          "houjin_bangou",
          "firm_type",
          "specialties",
          "prefecture",
          "contact_email",
          "agreed_to_terms"
        ],
        "title": "SignupRequest",
        "type": "object"
      },
      "SignupResponse": {
        "additionalProperties": false,
        "properties": {
          "advisor_id": {
            "title": "Advisor Id",
            "type": "integer"
          },
          "next_step": {
            "const": "stripe_connect",
            "default": "stripe_connect",
            "title": "Next Step",
            "type": "string"
          },
          "stripe_connect_onboarding_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Returned when STRIPE_SECRET_KEY is set. Null in dev/offline mode \u2014 the signup row is still created so the advisor can retry onboarding.",
            "title": "Stripe Connect Onboarding Url"
          }
        },
        "required": [
          "advisor_id"
        ],
        "title": "SignupResponse",
        "type": "object"
      },
      "StaticResourceDetail": {
        "additionalProperties": true,
        "properties": {
          "content": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "items": {},
                "type": "array"
              },
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Content"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "license": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "License"
          }
        },
        "required": [
          "id"
        ],
        "title": "StaticResourceDetail",
        "type": "object"
      },
      "StaticResourceItem": {
        "additionalProperties": true,
        "properties": {
          "filename": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Filename"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "path_relative": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Path Relative"
          },
          "size_bytes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Size Bytes"
          }
        },
        "required": [
          "id"
        ],
        "title": "StaticResourceItem",
        "type": "object"
      },
      "StaticResourceList": {
        "additionalProperties": true,
        "properties": {
          "results": {
            "items": {
              "$ref": "#/components/schemas/StaticResourceItem"
            },
            "title": "Results",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "total"
        ],
        "title": "StaticResourceList",
        "type": "object"
      },
      "SubscriptionResponse": {
        "properties": {
          "active": {
            "title": "Active",
            "type": "boolean"
          },
          "created_at": {
            "title": "Created At",
            "type": "string"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "filter_type": {
            "title": "Filter Type",
            "type": "string"
          },
          "filter_value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Filter Value"
          },
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "last_triggered": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Triggered"
          },
          "min_severity": {
            "title": "Min Severity",
            "type": "string"
          },
          "updated_at": {
            "title": "Updated At",
            "type": "string"
          },
          "webhook_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Webhook Url"
          }
        },
        "required": [
          "id",
          "filter_type",
          "filter_value",
          "min_severity",
          "webhook_url",
          "email",
          "active",
          "created_at",
          "updated_at",
          "last_triggered"
        ],
        "title": "SubscriptionResponse",
        "type": "object"
      },
      "TaxRulesetOut": {
        "additionalProperties": false,
        "properties": {
          "authority": {
            "title": "Authority",
            "type": "string"
          },
          "authority_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Authority Url"
          },
          "calculation_formula": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Calculation Formula"
          },
          "confidence": {
            "title": "Confidence",
            "type": "number"
          },
          "effective_from": {
            "title": "Effective From",
            "type": "string"
          },
          "effective_until": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Effective Until"
          },
          "eligibility_conditions": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Eligibility Conditions"
          },
          "eligibility_conditions_json": {
            "anyOf": [
              {},
              {
                "type": "null"
              }
            ],
            "description": "Parsed predicate tree (list / dict of {op, field, value, ...}). None if the row has no machine-readable predicates or if the stored JSON is malformed (never 500s \u2014 see evaluator).",
            "title": "Eligibility Conditions Json"
          },
          "fetched_at": {
            "title": "Fetched At",
            "type": "string"
          },
          "filing_requirements": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Filing Requirements"
          },
          "rate_or_amount": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rate Or Amount"
          },
          "related_law_ids": {
            "items": {
              "type": "string"
            },
            "title": "Related Law Ids",
            "type": "array"
          },
          "ruleset_kind": {
            "title": "Ruleset Kind",
            "type": "string"
          },
          "ruleset_name": {
            "title": "Ruleset Name",
            "type": "string"
          },
          "source_checksum": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Checksum"
          },
          "source_excerpt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Excerpt"
          },
          "source_url": {
            "title": "Source Url",
            "type": "string"
          },
          "tax_category": {
            "title": "Tax Category",
            "type": "string"
          },
          "unified_id": {
            "title": "Unified Id",
            "type": "string"
          },
          "updated_at": {
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "unified_id",
          "ruleset_name",
          "tax_category",
          "ruleset_kind",
          "effective_from",
          "effective_until",
          "related_law_ids",
          "eligibility_conditions",
          "eligibility_conditions_json",
          "rate_or_amount",
          "calculation_formula",
          "filing_requirements",
          "authority",
          "authority_url",
          "source_url",
          "source_excerpt",
          "source_checksum",
          "confidence",
          "fetched_at",
          "updated_at"
        ],
        "title": "TaxRulesetOut",
        "type": "object"
      },
      "TaxRulesetSearchResponse": {
        "additionalProperties": false,
        "properties": {
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "offset": {
            "title": "Offset",
            "type": "integer"
          },
          "results": {
            "items": {
              "$ref": "#/components/schemas/TaxRulesetOut"
            },
            "title": "Results",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "total",
          "limit",
          "offset",
          "results"
        ],
        "title": "TaxRulesetSearchResponse",
        "type": "object"
      },
      "TestimonialListResponse": {
        "properties": {
          "rows": {
            "items": {
              "$ref": "#/components/schemas/TestimonialPublic"
            },
            "title": "Rows",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "total",
          "rows"
        ],
        "title": "TestimonialListResponse",
        "type": "object"
      },
      "TestimonialPublic": {
        "properties": {
          "approved_at": {
            "title": "Approved At",
            "type": "string"
          },
          "audience": {
            "title": "Audience",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "linkedin_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Linkedin Url"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "organization": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Organization"
          },
          "text": {
            "title": "Text",
            "type": "string"
          }
        },
        "required": [
          "id",
          "audience",
          "text",
          "name",
          "organization",
          "linkedin_url",
          "approved_at"
        ],
        "title": "TestimonialPublic",
        "type": "object"
      },
      "TestimonialSubmit": {
        "properties": {
          "audience": {
            "enum": [
              "\u7a0e\u7406\u58eb",
              "\u884c\u653f\u66f8\u58eb",
              "SMB",
              "VC",
              "Dev"
            ],
            "title": "Audience",
            "type": "string"
          },
          "linkedin_url": {
            "anyOf": [
              {
                "maxLength": 300,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Linkedin Url"
          },
          "name": {
            "anyOf": [
              {
                "maxLength": 80,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "organization": {
            "anyOf": [
              {
                "maxLength": 120,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Organization"
          },
          "text": {
            "maxLength": 2000,
            "minLength": 10,
            "title": "Text",
            "type": "string"
          }
        },
        "required": [
          "audience",
          "text"
        ],
        "title": "TestimonialSubmit",
        "type": "object"
      },
      "TestimonialSubmitResponse": {
        "properties": {
          "pending_review": {
            "title": "Pending Review",
            "type": "boolean"
          },
          "received": {
            "title": "Received",
            "type": "boolean"
          },
          "testimonial_id": {
            "title": "Testimonial Id",
            "type": "integer"
          }
        },
        "required": [
          "received",
          "testimonial_id",
          "pending_review"
        ],
        "title": "TestimonialSubmitResponse",
        "type": "object"
      },
      "TokenRequest": {
        "properties": {
          "client_id": {
            "default": "autonomath-mcp",
            "title": "Client Id",
            "type": "string"
          },
          "device_code": {
            "title": "Device Code",
            "type": "string"
          },
          "grant_type": {
            "title": "Grant Type",
            "type": "string"
          }
        },
        "required": [
          "grant_type",
          "device_code"
        ],
        "title": "TokenRequest",
        "type": "object"
      },
      "TokenSuccess": {
        "properties": {
          "access_token": {
            "title": "Access Token",
            "type": "string"
          },
          "scope": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scope"
          },
          "token_type": {
            "const": "Bearer",
            "default": "Bearer",
            "title": "Token Type",
            "type": "string"
          }
        },
        "required": [
          "access_token"
        ],
        "title": "TokenSuccess",
        "type": "object"
      },
      "ToolRecommendation": {
        "properties": {
          "confidence": {
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Confidence",
            "type": "number"
          },
          "endpoint": {
            "title": "Endpoint",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "why": {
            "title": "Why",
            "type": "string"
          }
        },
        "required": [
          "endpoint",
          "name",
          "why",
          "confidence"
        ],
        "title": "ToolRecommendation",
        "type": "object"
      },
      "ToolRecommendationResponse": {
        "properties": {
          "fallback_used": {
            "description": "True when no keyword matched and we fell back to the catalog. Mirrors envelope.meta.alternative_intents semantics \u2014 caller can downgrade UI to 'browse all' instead of 'best match'.",
            "title": "Fallback Used",
            "type": "boolean"
          },
          "intent": {
            "title": "Intent",
            "type": "string"
          },
          "tools": {
            "items": {
              "$ref": "#/components/schemas/ToolRecommendation"
            },
            "title": "Tools",
            "type": "array"
          }
        },
        "required": [
          "intent",
          "tools",
          "fallback_used"
        ],
        "title": "ToolRecommendationResponse",
        "type": "object"
      },
      "ToolUsageResponse": {
        "properties": {
          "days": {
            "title": "Days",
            "type": "integer"
          },
          "top": {
            "items": {
              "$ref": "#/components/schemas/ToolUsageRow"
            },
            "title": "Top",
            "type": "array"
          },
          "total_amount_yen": {
            "title": "Total Amount Yen",
            "type": "integer"
          },
          "total_calls": {
            "title": "Total Calls",
            "type": "integer"
          }
        },
        "required": [
          "days",
          "total_calls",
          "total_amount_yen",
          "top"
        ],
        "title": "ToolUsageResponse",
        "type": "object"
      },
      "ToolUsageRow": {
        "properties": {
          "amount_yen": {
            "title": "Amount Yen",
            "type": "integer"
          },
          "avg_latency_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Average request latency for this endpoint over the window, if telemetry is recorded. Currently unused \u2014 usage_events does not persist latency_ms \u2014 so the field is None today.",
            "title": "Avg Latency Ms"
          },
          "calls": {
            "title": "Calls",
            "type": "integer"
          },
          "endpoint": {
            "title": "Endpoint",
            "type": "string"
          }
        },
        "required": [
          "endpoint",
          "calls",
          "amount_yen"
        ],
        "title": "ToolUsageRow",
        "type": "object"
      },
      "TrackRequest": {
        "additionalProperties": false,
        "properties": {
          "advisor_id": {
            "title": "Advisor Id",
            "type": "integer"
          },
          "source_program_id": {
            "anyOf": [
              {
                "maxLength": 120,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Program Id"
          },
          "source_query_hash": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Query Hash"
          }
        },
        "required": [
          "advisor_id"
        ],
        "title": "TrackRequest",
        "type": "object"
      },
      "TrackResponse": {
        "additionalProperties": false,
        "properties": {
          "redirect_url": {
            "title": "Redirect Url",
            "type": "string"
          },
          "token": {
            "title": "Token",
            "type": "string"
          }
        },
        "required": [
          "token",
          "redirect_url"
        ],
        "title": "TrackResponse",
        "type": "object"
      },
      "UnsubscribeResponse": {
        "properties": {
          "at": {
            "title": "At",
            "type": "string"
          },
          "unsubscribed": {
            "title": "Unsubscribed",
            "type": "boolean"
          }
        },
        "required": [
          "unsubscribed",
          "at"
        ],
        "title": "UnsubscribeResponse",
        "type": "object"
      },
      "UsageDayBucket": {
        "additionalProperties": true,
        "properties": {
          "count": {
            "default": 0,
            "title": "Count",
            "type": "integer"
          },
          "cumulative": {
            "default": 0,
            "title": "Cumulative",
            "type": "integer"
          },
          "date": {
            "title": "Date",
            "type": "string"
          }
        },
        "required": [
          "date"
        ],
        "title": "UsageDayBucket",
        "type": "object"
      },
      "UsageResponse": {
        "additionalProperties": true,
        "description": "``GET /v1/stats/usage`` \u2014 past-30d anonymous request counts.",
        "properties": {
          "daily": {
            "items": {
              "$ref": "#/components/schemas/UsageDayBucket"
            },
            "title": "Daily",
            "type": "array"
          },
          "generated_at": {
            "title": "Generated At",
            "type": "string"
          },
          "since": {
            "title": "Since",
            "type": "string"
          },
          "total": {
            "default": 0,
            "title": "Total",
            "type": "integer"
          },
          "until": {
            "title": "Until",
            "type": "string"
          },
          "window_days": {
            "default": 30,
            "title": "Window Days",
            "type": "integer"
          }
        },
        "required": [
          "since",
          "until",
          "generated_at"
        ],
        "title": "UsageResponse",
        "type": "object"
      },
      "UsageStatus": {
        "description": "Single shape covers anonymous + paid + free (dunning) tiers.\n\n`limit` and `remaining` are nullable so the metered (\"paid\") tier can\nreturn both as None \u2014 there is no upper bound on a metered key, the\ncustomer pays \u00a53/req for whatever volume they consume. The dashboard\n(`/v1/me/dashboard`) is the right surface for \"how much will this\ncost me this month\", not /v1/usage.",
        "properties": {
          "limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Limit"
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Note"
          },
          "remaining": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Remaining"
          },
          "reset_at": {
            "title": "Reset At",
            "type": "string"
          },
          "reset_timezone": {
            "title": "Reset Timezone",
            "type": "string"
          },
          "tier": {
            "title": "Tier",
            "type": "string"
          },
          "upgrade_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Upgrade Url"
          },
          "used": {
            "title": "Used",
            "type": "integer"
          }
        },
        "required": [
          "tier",
          "limit",
          "remaining",
          "used",
          "reset_at",
          "reset_timezone"
        ],
        "title": "UsageStatus",
        "type": "object"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "title": "Location",
            "type": "array"
          },
          "msg": {
            "title": "Message",
            "type": "string"
          },
          "type": {
            "title": "Error Type",
            "type": "string"
          }
        },
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError",
        "type": "object"
      },
      "WidgetSignupRequest": {
        "properties": {
          "cancel_url": {
            "title": "Cancel Url",
            "type": "string"
          },
          "email": {
            "format": "email",
            "title": "Email",
            "type": "string"
          },
          "label": {
            "anyOf": [
              {
                "maxLength": 120,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          },
          "origins": {
            "items": {
              "type": "string"
            },
            "maxItems": 20,
            "minItems": 1,
            "title": "Origins",
            "type": "array"
          },
          "plan": {
            "default": "business",
            "title": "Plan",
            "type": "string"
          },
          "success_url": {
            "title": "Success Url",
            "type": "string"
          }
        },
        "required": [
          "email",
          "origins",
          "success_url",
          "cancel_url"
        ],
        "title": "WidgetSignupRequest",
        "type": "object"
      },
      "WidgetSignupResponse": {
        "properties": {
          "checkout_url": {
            "title": "Checkout Url",
            "type": "string"
          },
          "session_id": {
            "title": "Session Id",
            "type": "string"
          }
        },
        "required": [
          "checkout_url",
          "session_id"
        ],
        "title": "WidgetSignupResponse",
        "type": "object"
      },
      "jpintel_mcp__api__alerts__SubscribeRequest": {
        "properties": {
          "email": {
            "anyOf": [
              {
                "format": "email",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "filter_type": {
            "enum": [
              "tool",
              "law_id",
              "program_id",
              "industry_jsic",
              "all"
            ],
            "title": "Filter Type",
            "type": "string"
          },
          "filter_value": {
            "anyOf": [
              {
                "maxLength": 256,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Filter Value"
          },
          "min_severity": {
            "default": "important",
            "enum": [
              "critical",
              "important",
              "info"
            ],
            "title": "Min Severity",
            "type": "string"
          },
          "webhook_url": {
            "anyOf": [
              {
                "maxLength": 2048,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Webhook Url"
          }
        },
        "required": [
          "filter_type"
        ],
        "title": "SubscribeRequest",
        "type": "object"
      },
      "jpintel_mcp__api__billing__CheckoutRequest": {
        "properties": {
          "cancel_url": {
            "title": "Cancel Url",
            "type": "string"
          },
          "customer_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer Email"
          },
          "success_url": {
            "title": "Success Url",
            "type": "string"
          }
        },
        "required": [
          "success_url",
          "cancel_url"
        ],
        "title": "CheckoutRequest",
        "type": "object"
      },
      "jpintel_mcp__api__compliance__CheckoutRequest": {
        "properties": {
          "cancel_url": {
            "default": "https://autonomath.ai/alerts.html?status=canceled",
            "title": "Cancel Url",
            "type": "string"
          },
          "subscriber_id": {
            "title": "Subscriber Id",
            "type": "integer"
          },
          "success_url": {
            "default": "https://autonomath.ai/alerts.html?status=ok",
            "title": "Success Url",
            "type": "string"
          }
        },
        "required": [
          "subscriber_id"
        ],
        "title": "CheckoutRequest",
        "type": "object"
      },
      "jpintel_mcp__api__compliance__CheckoutResponse": {
        "properties": {
          "session_id": {
            "title": "Session Id",
            "type": "string"
          },
          "url": {
            "title": "Url",
            "type": "string"
          }
        },
        "required": [
          "url",
          "session_id"
        ],
        "title": "CheckoutResponse",
        "type": "object"
      },
      "jpintel_mcp__api__compliance__SubscribeRequest": {
        "properties": {
          "areas_of_interest": {
            "items": {
              "type": "string"
            },
            "maxItems": 7,
            "minItems": 1,
            "title": "Areas Of Interest",
            "type": "array"
          },
          "email": {
            "format": "email",
            "title": "Email",
            "type": "string"
          },
          "houjin_bangou": {
            "anyOf": [
              {
                "maxLength": 13,
                "minLength": 13,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Houjin Bangou"
          },
          "industry_codes": {
            "items": {
              "type": "string"
            },
            "maxItems": 12,
            "title": "Industry Codes",
            "type": "array"
          },
          "plan": {
            "default": "free",
            "enum": [
              "free",
              "paid"
            ],
            "title": "Plan",
            "type": "string"
          },
          "prefecture": {
            "anyOf": [
              {
                "maxLength": 16,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prefecture"
          },
          "source_lang": {
            "default": "ja",
            "enum": [
              "ja",
              "en"
            ],
            "title": "Source Lang",
            "type": "string"
          }
        },
        "required": [
          "email",
          "areas_of_interest"
        ],
        "title": "SubscribeRequest",
        "type": "object"
      },
      "jpintel_mcp__api__compliance__SubscribeResponse": {
        "properties": {
          "checkout_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Checkout Url"
          },
          "next_step": {
            "enum": [
              "verify",
              "checkout"
            ],
            "title": "Next Step",
            "type": "string"
          },
          "subscriber_id": {
            "title": "Subscriber Id",
            "type": "integer"
          }
        },
        "required": [
          "subscriber_id",
          "next_step"
        ],
        "title": "SubscribeResponse",
        "type": "object"
      },
      "jpintel_mcp__api__dashboard__UsageDay": {
        "properties": {
          "calls": {
            "title": "Calls",
            "type": "integer"
          },
          "date": {
            "title": "Date",
            "type": "string"
          }
        },
        "required": [
          "date",
          "calls"
        ],
        "title": "UsageDay",
        "type": "object"
      },
      "jpintel_mcp__api__invoice_registrants__SearchResponse": {
        "additionalProperties": false,
        "properties": {
          "attribution": {
            "$ref": "#/components/schemas/AttributionBlock"
          },
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "offset": {
            "title": "Offset",
            "type": "integer"
          },
          "results": {
            "items": {
              "$ref": "#/components/schemas/InvoiceRegistrantOut"
            },
            "title": "Results",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "total",
          "limit",
          "offset",
          "results",
          "attribution"
        ],
        "title": "SearchResponse",
        "type": "object"
      },
      "jpintel_mcp__api__subscribers__SubscribeRequest": {
        "properties": {
          "email": {
            "format": "email",
            "title": "Email",
            "type": "string"
          },
          "source": {
            "anyOf": [
              {
                "maxLength": 64,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source"
          }
        },
        "required": [
          "email"
        ],
        "title": "SubscribeRequest",
        "type": "object"
      },
      "jpintel_mcp__api__subscribers__SubscribeResponse": {
        "properties": {
          "subscribed": {
            "title": "Subscribed",
            "type": "boolean"
          }
        },
        "required": [
          "subscribed"
        ],
        "title": "SubscribeResponse",
        "type": "object"
      },
      "jpintel_mcp__models__SearchResponse": {
        "properties": {
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "offset": {
            "title": "Offset",
            "type": "integer"
          },
          "results": {
            "items": {
              "$ref": "#/components/schemas/Program"
            },
            "title": "Results",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "total",
          "limit",
          "offset",
          "results"
        ],
        "title": "SearchResponse",
        "type": "object"
      }
    },
    "securitySchemes": {
      "ApiKeyAuth": {
        "description": "Customer API key issued via Stripe Checkout. Anonymous tier (no key) gets 50 req/\u6708 per IP.",
        "in": "header",
        "name": "X-API-Key",
        "type": "apiKey"
      }
    }
  },
  "info": {
    "contact": {
      "email": "info@bookyou.net",
      "name": "AutonoMath Support"
    },
    "description": "AutonoMath \u2014 \u65e5\u672c\u306e\u5236\u5ea6\u60c5\u5831 (\u88dc\u52a9\u91d1 / \u878d\u8cc7 / \u7a0e\u5236 / \u5171\u6e08) API + MCP server. Operated by Bookyou Inc. (T8010001213708).",
    "license": {
      "name": "Proprietary - see termsOfService"
    },
    "termsOfService": "https://autonomath.ai/terms.html",
    "title": "AutonoMath",
    "version": "0.3.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/healthz": {
      "get": {
        "operationId": "healthz_healthz_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "title": "Response Healthz Healthz Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Healthz",
        "tags": [
          "meta"
        ]
      }
    },
    "/readyz": {
      "get": {
        "operationId": "readyz_readyz_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Readyz"
      }
    },
    "/v1/advisors/match": {
      "get": {
        "description": "Top ``limit`` advisors matching the supplied filters.\n\nIntentionally doesn't go through the digest whitelist (ctx.log_usage\nis called with no params): advisor match responses are not a retention\nsignal, and the params (esp. prefecture) carry enough geographic info\nthat hashing them into a digest starts to smell PII-adjacent.",
        "operationId": "match_advisors_v1_advisors_match_get",
        "parameters": [
          {
            "description": "\u90fd\u9053\u5e9c\u770c. Accepts canonical, short, or romaji.",
            "in": "query",
            "name": "prefecture",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "\u90fd\u9053\u5e9c\u770c. Accepts canonical, short, or romaji.",
              "title": "Prefecture"
            }
          },
          {
            "in": "query",
            "name": "specialty",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "subsidy",
                    "loan",
                    "tax",
                    "enforcement_defense",
                    "invoice",
                    "ebook"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Specialty"
            }
          },
          {
            "in": "query",
            "name": "industry",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "agri",
                    "manufacture",
                    "it",
                    "service",
                    "construction",
                    "retail"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Industry"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 3,
              "maximum": 10,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MatchResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Match Advisors",
        "tags": [
          "advisors"
        ]
      }
    },
    "/v1/advisors/report-conversion": {
      "post": {
        "description": "Advisor marks a referral as converted. Commission computed + queued.\n\nAuthentication model: authentication is provided by possession of the\n``referral_token`` (treat as a bearer secret for that single referral)\ncombined with the advisor later being able to verify via Stripe Connect.\nA stronger model would require the advisor's API key \u2014 deferred to the\ndashboard login flow.",
        "operationId": "report_conversion_v1_advisors_report_conversion_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportConversionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "conversion recorded"
          },
          "404": {
            "description": "token unknown"
          },
          "409": {
            "description": "already converted"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Report Conversion",
        "tags": [
          "advisors"
        ]
      }
    },
    "/v1/advisors/signup": {
      "post": {
        "description": "Create an unverified advisor profile + return Stripe Connect onboarding URL.\n\nSelf-serve, no API key required (prospective advisors don't have one\nyet). verified_at stays NULL until both:\n  (a) /verify-houjin/{id} succeeds against invoice_registrants, AND\n  (b) Stripe Connect account.updated webhook reports capabilities.transfers=active.\n\nFor advisors seeded from the \u4e2d\u5c0f\u4f01\u696d\u5e81 \u8a8d\u5b9a\u652f\u63f4\u6a5f\u95a2 public list,\nscripts/seed_advisors.py sets verified_at directly at seed time \u2014 this\nhandler path is for self-serve signups only.",
        "operationId": "signup_advisor_v1_advisors_signup_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SignupRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignupResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "409": {
            "description": "houjin_bangou already registered"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Signup Advisor",
        "tags": [
          "advisors"
        ]
      }
    },
    "/v1/advisors/track": {
      "post": {
        "description": "Record a referral click and mint a single-use redirect token.\n\nThe returned ``redirect_url`` is ``advisor.contact_url`` with\n``?ref=<token>`` appended, or a fallback to an in-domain contact page\nwhen the advisor didn't supply one. 5% or \u00a53,000 commission (model\ndependent) is resolved at conversion time, not click time.",
        "operationId": "track_click_v1_advisors_track_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrackRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrackResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Track Click",
        "tags": [
          "advisors"
        ]
      }
    },
    "/v1/advisors/verify-houjin/{advisor_id}": {
      "post": {
        "description": "Confirm the advisor's \u6cd5\u4eba\u756a\u53f7 exists in invoice_registrants (migration 019).\n\nProvisional verification: sets advisors.verified_at to the current\ntimestamp when the \u6cd5\u4eba\u756a\u53f7 is found. Full verification still waits\non Stripe Connect webhook reporting capabilities.transfers=active \u2014\nquery_matching_advisors() filters on verified_at alone today, so this\nprovisional gate is the public-visibility switch.\n\nFor \u8a8d\u5b9a\u652f\u63f4\u6a5f\u95a2 rows seeded from the \u4e2d\u5c0f\u4f01\u696d\u5e81 public list,\nseed_advisors.py sets verified_at directly and this endpoint is a\nno-op idempotent success.",
        "operationId": "verify_houjin_v1_advisors_verify_houjin__advisor_id__post",
        "parameters": [
          {
            "in": "path",
            "name": "advisor_id",
            "required": true,
            "schema": {
              "title": "Advisor Id",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "verified"
          },
          "404": {
            "description": "advisor not found"
          },
          "422": {
            "description": "houjin_bangou not found in NTA registry"
          }
        },
        "summary": "Verify Houjin",
        "tags": [
          "advisors"
        ]
      }
    },
    "/v1/advisors/{advisor_id}/dashboard-data": {
      "get": {
        "description": "Self-serve dashboard backing data: referrals + earnings summary.\n\nAuthentication: intentionally light today \u2014 the dashboard HTML is\nexpected to be reached via the Stripe Connect Express portal return\nURL (or via magic-link email). Adding API-key auth here would block\nthe simplest flow where the advisor arrives from Stripe's own\ndashboard. If this becomes abused, add a signed HMAC\n``?token=...`` in the URL and verify here.",
        "operationId": "dashboard_data_v1_advisors__advisor_id__dashboard_data_get",
        "parameters": [
          {
            "in": "path",
            "name": "advisor_id",
            "required": true,
            "schema": {
              "title": "Advisor Id",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvisorDashboardResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Dashboard Data",
        "tags": [
          "advisors"
        ]
      }
    },
    "/v1/am/acceptance_stats": {
      "get": {
        "description": "\u63a1\u629e\u7387 / \u63a1\u629e\u4e8b\u4f8b statistics from am_entities (supersedes cross-DB acceptance_stats_tool).",
        "operationId": "rest_search_acceptance_stats_v1_am_acceptance_stats_get",
        "parameters": [
          {
            "in": "query",
            "name": "program_name",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 200,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Program Name"
            }
          },
          {
            "in": "query",
            "name": "year",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maximum": 2099,
                  "minimum": 1988,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Year"
            }
          },
          {
            "in": "query",
            "name": "region",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 100,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Region"
            }
          },
          {
            "in": "query",
            "name": "industry",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 100,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Industry"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AMSearchResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Rest Search Acceptance Stats",
        "tags": [
          "autonomath"
        ]
      }
    },
    "/v1/am/active_at": {
      "get": {
        "description": "Point-in-time snapshot: programs whose effective window covered a given date.",
        "operationId": "rest_active_programs_at_v1_am_active_at_get",
        "parameters": [
          {
            "description": "ISO YYYY-MM-DD",
            "in": "query",
            "name": "date",
            "required": true,
            "schema": {
              "description": "ISO YYYY-MM-DD",
              "maxLength": 10,
              "minLength": 10,
              "title": "Date",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "region",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 100,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Region"
            }
          },
          {
            "in": "query",
            "name": "industry",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 100,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Industry"
            }
          },
          {
            "in": "query",
            "name": "size",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "sole",
                    "small",
                    "sme",
                    "mid",
                    "large"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Size"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AMActiveAtResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Rest Active Programs At",
        "tags": [
          "autonomath"
        ]
      }
    },
    "/v1/am/annotations/{entity_id}": {
      "get": {
        "description": "am_entity_annotation \u9006\u5f15\u304d \u2014 examiner feedback / quality score / ML \u63a8\u8ad6 \u7b49\u3092 1 \u30b3\u30fc\u30eb (16,474 \u884c).",
        "operationId": "rest_get_annotations_v1_am_annotations__entity_id__get",
        "parameters": [
          {
            "description": "am_entities.canonical_id (TEXT)",
            "in": "path",
            "name": "entity_id",
            "required": true,
            "schema": {
              "description": "am_entities.canonical_id (TEXT)",
              "maxLength": 200,
              "minLength": 1,
              "title": "Entity Id",
              "type": "string"
            }
          },
          {
            "description": "Filter on annotation kind (examiner_warning / examiner_correction / quality_score / validation_failure / ml_inference / manual_note). Repeat the param to OR-combine.",
            "in": "query",
            "name": "kinds",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter on annotation kind (examiner_warning / examiner_correction / quality_score / validation_failure / ml_inference / manual_note). Repeat the param to OR-combine.",
              "title": "Kinds"
            }
          },
          {
            "description": "Include visibility='internal' rows (default False = public only). 'private' is never returned.",
            "in": "query",
            "name": "include_internal",
            "required": false,
            "schema": {
              "default": false,
              "description": "Include visibility='internal' rows (default False = public only). 'private' is never returned.",
              "title": "Include Internal",
              "type": "boolean"
            }
          },
          {
            "description": "Include superseded / expired annotations (default False = currently-live only).",
            "in": "query",
            "name": "include_superseded",
            "required": false,
            "schema": {
              "default": false,
              "description": "Include superseded / expired annotations (default False = currently-live only).",
              "title": "Include Superseded",
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 500,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AMAnnotationsResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Rest Get Annotations",
        "tags": [
          "autonomath"
        ]
      }
    },
    "/v1/am/by_law": {
      "get": {
        "description": "Programs / tax rules / certifications linked to a specific law (fuzzy name match).",
        "operationId": "rest_search_by_law_v1_am_by_law_get",
        "parameters": [
          {
            "in": "query",
            "name": "law_name",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "title": "Law Name",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "article",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 40,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Article"
            }
          },
          {
            "in": "query",
            "name": "amendment_date",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 10,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Amendment Date"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AMByLawResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Rest Search By Law",
        "tags": [
          "autonomath"
        ]
      }
    },
    "/v1/am/certifications": {
      "get": {
        "description": "\u8a8d\u5b9a\u30fb\u8a8d\u8a3c\u5236\u5ea6 (\u5065\u5eb7\u7d4c\u55b6 / \u3048\u308b\u307c\u3057 / \u304f\u308b\u307f\u3093 / SDGs / \u7d4c\u55b6\u9769\u65b0 \u7b49) search.",
        "operationId": "rest_search_certifications_v1_am_certifications_get",
        "parameters": [
          {
            "in": "query",
            "name": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 200,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Query"
            }
          },
          {
            "in": "query",
            "name": "authority",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "\u7d4c\u6e08\u7523\u696d\u7701",
                    "\u65e5\u672c\u5065\u5eb7\u4f1a\u8b70",
                    "\u539a\u751f\u52b4\u50cd\u7701",
                    "\u5185\u95a3\u5e9c",
                    "\u90fd\u9053\u5e9c\u770c",
                    "\u5e02\u753a\u6751",
                    "\u8fb2\u6797\u6c34\u7523\u7701",
                    "\u56fd\u571f\u4ea4\u901a\u7701",
                    "\u305d\u306e\u4ed6"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authority"
            }
          },
          {
            "in": "query",
            "name": "size",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "sole",
                    "small",
                    "sme",
                    "mid",
                    "large"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Size"
            }
          },
          {
            "in": "query",
            "name": "industry",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 100,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Industry"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AMSearchResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Rest Search Certifications",
        "tags": [
          "autonomath"
        ]
      }
    },
    "/v1/am/enforcement": {
      "get": {
        "description": "Is this entity currently barred from \u88dc\u52a9\u91d1 / \u52a9\u6210\u91d1 (\u884c\u653f\u51e6\u5206 \u6392\u9664\u671f\u9593 check)?",
        "operationId": "rest_check_enforcement_v1_am_enforcement_get",
        "parameters": [
          {
            "in": "query",
            "name": "houjin_bangou",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 20,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Houjin Bangou"
            }
          },
          {
            "in": "query",
            "name": "target_name",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 200,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Target Name"
            }
          },
          {
            "in": "query",
            "name": "as_of_date",
            "required": false,
            "schema": {
              "default": "today",
              "maxLength": 10,
              "title": "As Of Date",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AMEnforcementCheckResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Rest Check Enforcement",
        "tags": [
          "autonomath"
        ]
      }
    },
    "/v1/am/enums/{enum_name}": {
      "get": {
        "description": "List canonical enum values + frequency for a given enum_name.",
        "operationId": "rest_enum_values_v1_am_enums__enum_name__get",
        "parameters": [
          {
            "in": "path",
            "name": "enum_name",
            "required": true,
            "schema": {
              "enum": [
                "authority",
                "tier",
                "industry",
                "funding_purpose",
                "target_type",
                "region",
                "tax_category",
                "program_kind",
                "loan_type",
                "event_type",
                "ministry",
                "certification_authority"
              ],
              "title": "Enum Name",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AMEnumValuesResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Rest Enum Values",
        "tags": [
          "autonomath"
        ]
      }
    },
    "/v1/am/example_profiles": {
      "get": {
        "description": "List 5 canonical client-intake example payloads (PII-clean).",
        "operationId": "rest_list_example_profiles_v1_am_example_profiles_get",
        "parameters": [
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExampleProfileList"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Rest List Example Profiles",
        "tags": [
          "autonomath"
        ]
      }
    },
    "/v1/am/example_profiles/{profile_id}": {
      "get": {
        "description": "Return one canonical client profile JSON as a complete-payload example.",
        "operationId": "rest_get_example_profile_v1_am_example_profiles__profile_id__get",
        "parameters": [
          {
            "description": "Profile id; see /v1/am/example_profiles.",
            "in": "path",
            "name": "profile_id",
            "required": true,
            "schema": {
              "description": "Profile id; see /v1/am/example_profiles.",
              "maxLength": 64,
              "minLength": 1,
              "title": "Profile Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExampleProfileDetail"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Rest Get Example Profile",
        "tags": [
          "autonomath"
        ]
      }
    },
    "/v1/am/gx_programs": {
      "get": {
        "description": "GX / \u8131\u70ad\u7d20 / \u518d\u30a8\u30cd / EV / ZEB-ZEH curated \u88dc\u52a9\u91d1 programs.",
        "operationId": "rest_search_gx_programs_v1_am_gx_programs_get",
        "parameters": [
          {
            "in": "query",
            "name": "theme",
            "required": false,
            "schema": {
              "default": "ghg_reduction",
              "enum": [
                "ghg_reduction",
                "ev",
                "renewable",
                "zeb_zeh",
                "carbon_credit"
              ],
              "title": "Theme",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "company_size",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "sme",
                    "midsize",
                    "large",
                    "individual",
                    "municipality",
                    "farmer"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Company Size"
            }
          },
          {
            "in": "query",
            "name": "region",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 100,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Region"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AMSimpleSearchResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Rest Search Gx Programs",
        "tags": [
          "autonomath"
        ]
      }
    },
    "/v1/am/health/deep": {
      "get": {
        "description": "10-check aggregate health (db + freshness + license + provenance + bundle + WAL).\n\nUnbilled, unlogged, no anonymous-IP rate limit \u2014 heartbeat surface for\nuptime monitors. Returns ``status`` \u2208 {ok, degraded, unhealthy}.\n\nResponses are cached for 30 seconds; pass ``?force=true`` to bypass for\ndebugging or post-deploy verification.",
        "operationId": "rest_deep_health_v1_am_health_deep_get",
        "parameters": [
          {
            "in": "query",
            "name": "force",
            "required": false,
            "schema": {
              "default": false,
              "title": "Force",
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeepHealthResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Rest Deep Health",
        "tags": [
          "autonomath-health"
        ]
      }
    },
    "/v1/am/intent": {
      "get": {
        "description": "Route a natural-language query to the best-fit tool + extracted slots (query_rewrite layer).",
        "operationId": "rest_intent_of_v1_am_intent_get",
        "parameters": [
          {
            "in": "query",
            "name": "query",
            "required": true,
            "schema": {
              "maxLength": 500,
              "minLength": 1,
              "title": "Query",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AMIntentResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Rest Intent Of",
        "tags": [
          "autonomath"
        ]
      }
    },
    "/v1/am/law_article": {
      "get": {
        "description": "Exact \u6761\u6587 lookup: '\u79df\u7a0e\u7279\u5225\u63aa\u7f6e\u6cd5' + '41\u306e19' \u2192 full article text + amendment history.",
        "operationId": "rest_get_law_article_v1_am_law_article_get",
        "parameters": [
          {
            "in": "query",
            "name": "law_name_or_canonical_id",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "title": "Law Name Or Canonical Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "article_number",
            "required": true,
            "schema": {
              "maxLength": 40,
              "minLength": 1,
              "title": "Article Number",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AMLawArticleResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Rest Get Law Article",
        "tags": [
          "autonomath"
        ]
      }
    },
    "/v1/am/loans": {
      "get": {
        "description": "am_loan_product query \u2014 \u516c\u5eab / \u5546\u5de5\u4e2d\u91d1 / \u81ea\u6cbb\u4f53\u5236\u5ea6\u878d\u8cc7 with 3-axis guarantor filter.",
        "operationId": "rest_search_loans_v1_am_loans_get",
        "parameters": [
          {
            "in": "query",
            "name": "loan_kind",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "ippan",
                    "trou",
                    "seirei",
                    "sanko",
                    "sogyo",
                    "rinsei",
                    "saigai",
                    "shingiseikyu",
                    "kiki",
                    "other"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Loan Kind"
            }
          },
          {
            "in": "query",
            "name": "no_collateral",
            "required": false,
            "schema": {
              "default": false,
              "title": "No Collateral",
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "no_personal_guarantor",
            "required": false,
            "schema": {
              "default": false,
              "title": "No Personal Guarantor",
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "no_third_party_guarantor",
            "required": false,
            "schema": {
              "default": false,
              "title": "No Third Party Guarantor",
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "max_amount_yen",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "minimum": 0,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Max Amount Yen"
            }
          },
          {
            "in": "query",
            "name": "min_amount_yen",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "minimum": 0,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Min Amount Yen"
            }
          },
          {
            "in": "query",
            "name": "lender_entity_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 100,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Lender Entity Id"
            }
          },
          {
            "in": "query",
            "name": "name_query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 200,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Name Query"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 10,
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AMLoanSearchResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Rest Search Loans",
        "tags": [
          "autonomath"
        ]
      }
    },
    "/v1/am/mutual_plans": {
      "get": {
        "description": "\u5171\u6e08 / \u5e74\u91d1 / \u52b4\u707d cross-search (\u5c0f\u898f\u6a21\u4f01\u696d\u5171\u6e08 / iDeCo+ / DB / DC / \u52b4\u707d\u7279\u5225\u52a0\u5165).",
        "operationId": "rest_search_mutual_plans_v1_am_mutual_plans_get",
        "parameters": [
          {
            "in": "query",
            "name": "plan_kind",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "retirement_mutual",
                    "bankruptcy_mutual",
                    "dc_pension",
                    "db_pension",
                    "industry_pension",
                    "welfare_insurance",
                    "health_insurance",
                    "other"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Plan Kind"
            }
          },
          {
            "in": "query",
            "name": "premium_monthly_yen",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "minimum": 0,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Premium Monthly Yen"
            }
          },
          {
            "in": "query",
            "name": "tax_deduction_type",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "small_enterprise_deduction",
                    "idekodc",
                    "group_retirement",
                    "corp_expense",
                    "none"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Tax Deduction Type"
            }
          },
          {
            "in": "query",
            "name": "provider_entity_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 100,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Provider Entity Id"
            }
          },
          {
            "in": "query",
            "name": "name_query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 200,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Name Query"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 10,
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AMLoanSearchResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Rest Search Mutual Plans",
        "tags": [
          "autonomath"
        ]
      }
    },
    "/v1/am/open_programs": {
      "get": {
        "description": "Currently-open (\u516c\u52df\u4e2d) program rounds on a target date.",
        "operationId": "rest_list_open_programs_v1_am_open_programs_get",
        "parameters": [
          {
            "description": "ISO YYYY-MM-DD. Default = today.",
            "in": "query",
            "name": "on_date",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 10,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "ISO YYYY-MM-DD. Default = today.",
              "title": "On Date"
            }
          },
          {
            "in": "query",
            "name": "region",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 100,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Region"
            }
          },
          {
            "in": "query",
            "name": "industry",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 100,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Industry"
            }
          },
          {
            "in": "query",
            "name": "size",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "sole",
                    "small",
                    "sme",
                    "mid",
                    "large"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Size"
            }
          },
          {
            "in": "query",
            "name": "natural_query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 500,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Natural Query"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AMOpenProgramsResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Rest List Open Programs",
        "tags": [
          "autonomath"
        ]
      }
    },
    "/v1/am/programs/active_v2": {
      "get": {
        "description": "Three-axis active-at: effective window + application_open + application_close in one query.\n\nBacked by view `programs_active_at_v2`. Returns programs that:\n  - are effective on `as_of` (effective_from <= as_of < effective_until,\n    with `effective_from_source` provenance hint), AND\n  - have an application round whose open_date <= `application_open_by`\n    (when provided), AND\n  - have an application round whose close_date >= `application_close_by`\n    (when provided), AND\n  - match `prefecture` (when provided).\n\nCaveat: `am_amendment_snapshot` carries a uniform `eligibility_hash`\nacross all (v1, v2) pairs \u2014 the table is a point-in-time snapshot,\nnot a real time-series. The response carries `_lifecycle_caveat` so\ncallers do not infer per-version eligibility drift.",
        "operationId": "rest_programs_active_at_v2_v1_am_programs_active_v2_get",
        "parameters": [
          {
            "description": "ISO YYYY-MM-DD. effective window pivot. Defaults to today (JST date as ISO).",
            "in": "query",
            "name": "as_of",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 10,
                  "minLength": 10,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "ISO YYYY-MM-DD. effective window pivot. Defaults to today (JST date as ISO).",
              "title": "As Of"
            }
          },
          {
            "description": "Filter to rounds whose application_open_date <= this date.",
            "in": "query",
            "name": "application_open_by",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 10,
                  "minLength": 10,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter to rounds whose application_open_date <= this date.",
              "title": "Application Open By"
            }
          },
          {
            "description": "Filter to rounds whose application_close_date >= this date (\u7de0\u5207\u304c\u3053\u306e\u65e5\u4ee5\u964d).",
            "in": "query",
            "name": "application_close_by",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 10,
                  "minLength": 10,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter to rounds whose application_close_date >= this date (\u7de0\u5207\u304c\u3053\u306e\u65e5\u4ee5\u964d).",
              "title": "Application Close By"
            }
          },
          {
            "description": "Optional prefecture filter (e.g. '\u6771\u4eac\u90fd').",
            "in": "query",
            "name": "prefecture",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 20,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Optional prefecture filter (e.g. '\u6771\u4eac\u90fd').",
              "title": "Prefecture"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Rest Programs Active At V2",
        "tags": [
          "autonomath"
        ]
      }
    },
    "/v1/am/provenance/fact/{fact_id}": {
      "get": {
        "description": "am_entity_facts.source_id \u2192 am_source 1 \u4ef6 (NULL \u306a\u3089 entity-level am_entity_source \u306e\u5019\u88dc list \u306b fallback).",
        "operationId": "rest_get_provenance_for_fact_v1_am_provenance_fact__fact_id__get",
        "parameters": [
          {
            "description": "am_entity_facts.id (INTEGER PK)",
            "in": "path",
            "name": "fact_id",
            "required": true,
            "schema": {
              "description": "am_entity_facts.id (INTEGER PK)",
              "minimum": 1,
              "title": "Fact Id",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AMProvenanceResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Rest Get Provenance For Fact",
        "tags": [
          "autonomath"
        ]
      }
    },
    "/v1/am/provenance/{entity_id}": {
      "get": {
        "description": "am_entity_source \u00d7 am_source \u4e00\u62ec\u8fd4\u5374 \u2014 \u51fa\u5178 URL / license / role / fetched_at + license_summary \u3092 1 \u30b3\u30fc\u30eb (migration 049, 99.17% license filled).",
        "operationId": "rest_get_provenance_v1_am_provenance__entity_id__get",
        "parameters": [
          {
            "description": "am_entities.canonical_id (TEXT)",
            "in": "path",
            "name": "entity_id",
            "required": true,
            "schema": {
              "description": "am_entities.canonical_id (TEXT)",
              "maxLength": 200,
              "minLength": 1,
              "title": "Entity Id",
              "type": "string"
            }
          },
          {
            "description": "If True, also return per-fact provenance via am_entity_facts.source_id (NULL on legacy rows pre-2026-04-25 \u2014 those facts are skipped). Default False = entity-level sources only.",
            "in": "query",
            "name": "include_facts",
            "required": false,
            "schema": {
              "default": false,
              "description": "If True, also return per-fact provenance via am_entity_facts.source_id (NULL on legacy rows pre-2026-04-25 \u2014 those facts are skipped). Default False = entity-level sources only.",
              "title": "Include Facts",
              "type": "boolean"
            }
          },
          {
            "description": "Max facts when include_facts=True (default 200).",
            "in": "query",
            "name": "fact_limit",
            "required": false,
            "schema": {
              "default": 200,
              "description": "Max facts when include_facts=True (default 200).",
              "maximum": 1000,
              "minimum": 1,
              "title": "Fact Limit",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AMProvenanceResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Rest Get Provenance",
        "tags": [
          "autonomath"
        ]
      }
    },
    "/v1/am/reason": {
      "get": {
        "description": "Return a citation-backed narrative answer (source_url + snippet per claim).",
        "operationId": "rest_reason_answer_v1_am_reason_get",
        "parameters": [
          {
            "in": "query",
            "name": "query",
            "required": true,
            "schema": {
              "maxLength": 500,
              "minLength": 1,
              "title": "Query",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "persona",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 100,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Persona"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AMReasonResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Rest Reason Answer",
        "tags": [
          "autonomath"
        ]
      }
    },
    "/v1/am/related/{program_id}": {
      "get": {
        "description": "Graph walk over am_relation (prerequisite / compatible / incompatible / replaces / amends / related / references_law etc.).",
        "operationId": "rest_related_programs_v1_am_related__program_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "program_id",
            "required": true,
            "schema": {
              "title": "Program Id",
              "type": "string"
            }
          },
          {
            "description": "Filter edge types (prerequisite / compatible / incompatible / replaces / \u2026).",
            "in": "query",
            "name": "relation_types",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter edge types (prerequisite / compatible / incompatible / replaces / \u2026).",
              "title": "Relation Types"
            }
          },
          {
            "in": "query",
            "name": "depth",
            "required": false,
            "schema": {
              "default": 1,
              "maximum": 3,
              "minimum": 1,
              "title": "Depth",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "max_edges",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 500,
              "minimum": 1,
              "title": "Max Edges",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AMRelatedResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Rest Related Programs",
        "tags": [
          "autonomath"
        ]
      }
    },
    "/v1/am/static": {
      "get": {
        "description": "List 8 curated AutonoMath taxonomies (seido / glossary / money_types / obligations / dealbreakers / sector_combos / crop_library / exclusion_rules).",
        "operationId": "rest_list_static_resources_v1_am_static_get",
        "parameters": [
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StaticResourceList"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Rest List Static Resources",
        "tags": [
          "autonomath"
        ]
      }
    },
    "/v1/am/static/{resource_id}": {
      "get": {
        "description": "Load one taxonomy/lookup file. Returns full JSON content + license.",
        "operationId": "rest_get_static_resource_v1_am_static__resource_id__get",
        "parameters": [
          {
            "description": "Resource id; see /v1/am/static for the catalog.",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "description": "Resource id; see /v1/am/static for the catalog.",
              "maxLength": 64,
              "minLength": 1,
              "title": "Resource Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StaticResourceDetail"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Rest Get Static Resource",
        "tags": [
          "autonomath"
        ]
      }
    },
    "/v1/am/tax_incentives": {
      "get": {
        "description": "\u7a0e\u5236\u7279\u4f8b (\u7279\u5225\u511f\u5374 / \u7a0e\u984d\u63a7\u9664 / \u7e70\u8d8a\u6b20\u640d\u91d1 / \u975e\u8ab2\u7a0e\u63aa\u7f6e) search across ~285 rows.",
        "operationId": "rest_search_tax_incentives_v1_am_tax_incentives_get",
        "parameters": [
          {
            "in": "query",
            "name": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 200,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Query"
            }
          },
          {
            "in": "query",
            "name": "authority",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "\u56fd\u7a0e\u5e81",
                    "\u8ca1\u52d9\u7701",
                    "\u7d4c\u6e08\u7523\u696d\u7701",
                    "\u4e2d\u5c0f\u4f01\u696d\u5e81",
                    "\u8fb2\u6797\u6c34\u7523\u7701",
                    "\u7dcf\u52d9\u7701",
                    "\u56fd\u571f\u4ea4\u901a\u7701",
                    "\u539a\u751f\u52b4\u50cd\u7701",
                    "\u81ea\u6cbb\u4f53"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authority"
            }
          },
          {
            "in": "query",
            "name": "industry",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 100,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Industry"
            }
          },
          {
            "in": "query",
            "name": "target_year",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maximum": 2099,
                  "minimum": 1988,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Target Year"
            }
          },
          {
            "in": "query",
            "name": "target_entity",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "\u4e2d\u5c0f\u4f01\u696d",
                    "\u5c0f\u898f\u6a21\u4e8b\u696d\u8005",
                    "\u500b\u4eba\u4e8b\u696d\u4e3b",
                    "\u5927\u4f01\u696d",
                    "\u8a8d\u5b9a\u4e8b\u696d\u8005",
                    "\u9752\u8272\u7533\u544a\u8005",
                    "\u8fb2\u696d\u6cd5\u4eba",
                    "\u7279\u5b9a\u4e8b\u696d\u8005\u7b49"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Target Entity"
            }
          },
          {
            "in": "query",
            "name": "natural_query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 500,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Natural Query"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AMSearchResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Rest Search Tax Incentives",
        "tags": [
          "autonomath"
        ]
      }
    },
    "/v1/am/tax_rule": {
      "get": {
        "description": "Single tax measure lookup against am_tax_rule with root_law + rate + applicability window.",
        "operationId": "rest_get_tax_rule_v1_am_tax_rule_get",
        "parameters": [
          {
            "in": "query",
            "name": "measure_name_or_id",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "title": "Measure Name Or Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "rule_type",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 60,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Rule Type"
            }
          },
          {
            "description": "ISO YYYY-MM-DD (default today)",
            "in": "query",
            "name": "as_of",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 10,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "ISO YYYY-MM-DD (default today)",
              "title": "As Of"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AMTaxRuleResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Rest Get Tax Rule",
        "tags": [
          "autonomath"
        ]
      }
    },
    "/v1/am/validate": {
      "post": {
        "description": "\u6c4e\u7528 intake \u691c\u8a3c \u2014 am_validation_rule \u306e active \u8ff0\u8a9e\u3092 applicant_data \u306b\u5bfe\u3057\u3066\u8a55\u4fa1\u3057\nrule \u5358\u4f4d\u306e passed/failed/deferred \u3092\u8fd4\u3059 (deferred = jpintel \u5185\u3067\u8a55\u4fa1\u3067\u304d\u306a\u3044\u5916\u90e8\u4f9d\u5b58\u8ff0\u8a9e).",
        "operationId": "rest_validate_v1_am_validate_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Body_rest_validate_v1_am_validate_post"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AMValidateResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Rest Validate",
        "tags": [
          "autonomath"
        ]
      }
    },
    "/v1/bids/search": {
      "get": {
        "description": "Search bids (\u5165\u672d\u6848\u4ef6). FTS match when `q` is given, else most recently\npublished first.",
        "operationId": "search_bids_v1_bids_search_get",
        "parameters": [
          {
            "description": "Free-text search across bid_title + bid_description + procuring_entity + winner_name (FTS5 with quoted-phrase workaround for 2+ character kanji compounds). Terms shorter than 3 characters will not match \u2014 trigram tokenizer limitation; use a longer phrase or the structured filters instead.",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 200,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Free-text search across bid_title + bid_description + procuring_entity + winner_name (FTS5 with quoted-phrase workaround for 2+ character kanji compounds). Terms shorter than 3 characters will not match \u2014 trigram tokenizer limitation; use a longer phrase or the structured filters instead.",
              "title": "Q"
            }
          },
          {
            "description": "Filter by bid_kind. One of: open | selective | negotiated | kobo_subsidy.",
            "in": "query",
            "name": "bid_kind",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "open",
                    "selective",
                    "negotiated",
                    "kobo_subsidy"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by bid_kind. One of: open | selective | negotiated | kobo_subsidy.",
              "title": "Bid Kind"
            }
          },
          {
            "description": "Exact 13-digit \u6cd5\u4eba\u756a\u53f7 of the procuring entity.",
            "in": "query",
            "name": "procuring_houjin_bangou",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^\\d{13}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Exact 13-digit \u6cd5\u4eba\u756a\u53f7 of the procuring entity.",
              "title": "Procuring Houjin Bangou"
            }
          },
          {
            "description": "Exact 13-digit \u6cd5\u4eba\u756a\u53f7 of the\u843d\u672d\u8005.",
            "in": "query",
            "name": "winner_houjin_bangou",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^\\d{13}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Exact 13-digit \u6cd5\u4eba\u756a\u53f7 of the\u843d\u672d\u8005.",
              "title": "Winner Houjin Bangou"
            }
          },
          {
            "description": "Exact programs.unified_id (UNI-* / TAX-* / LAW-* etc.) \u2014 returns bids linked to that program via ingest matchers.",
            "in": "query",
            "name": "program_id_hint",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 64,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Exact programs.unified_id (UNI-* / TAX-* / LAW-* etc.) \u2014 returns bids linked to that program via ingest matchers.",
              "title": "Program Id Hint"
            }
          },
          {
            "description": "Inclusive lower bound on awarded_amount_yen (JPY). Rows with NULL awarded_amount_yen are excluded from the filtered set when this is set.",
            "in": "query",
            "name": "min_amount",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "minimum": 0,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Inclusive lower bound on awarded_amount_yen (JPY). Rows with NULL awarded_amount_yen are excluded from the filtered set when this is set.",
              "title": "Min Amount"
            }
          },
          {
            "description": "Inclusive upper bound on awarded_amount_yen (JPY). Rows with NULL awarded_amount_yen are excluded from the filtered set when this is set.",
            "in": "query",
            "name": "max_amount",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "minimum": 0,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Inclusive upper bound on awarded_amount_yen (JPY). Rows with NULL awarded_amount_yen are excluded from the filtered set when this is set.",
              "title": "Max Amount"
            }
          },
          {
            "description": "ISO date (YYYY-MM-DD) \u2014 inclusive lower bound on bid_deadline. Useful for 'still-open' queries.",
            "in": "query",
            "name": "deadline_after",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "ISO date (YYYY-MM-DD) \u2014 inclusive lower bound on bid_deadline. Useful for 'still-open' queries.",
              "title": "Deadline After"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BidsSearchResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Search Bids",
        "tags": [
          "bids"
        ]
      }
    },
    "/v1/bids/{unified_id}": {
      "get": {
        "description": "Return a single \u5165\u672d\u6848\u4ef6 by BID-<10 hex> unified_id.",
        "operationId": "get_bid_v1_bids__unified_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "unified_id",
            "required": true,
            "schema": {
              "title": "Unified Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BidOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Bid",
        "tags": [
          "bids"
        ]
      }
    },
    "/v1/billing/checkout": {
      "post": {
        "operationId": "create_checkout_v1_billing_checkout_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/jpintel_mcp__api__billing__CheckoutRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/jpintel_mcp__api__compliance__CheckoutResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Checkout",
        "tags": [
          "billing"
        ]
      }
    },
    "/v1/billing/keys/from-checkout": {
      "post": {
        "description": "Issue an API key after checkout completion.\n\nThe client holds a session_id from Stripe Checkout. Metered subscriptions\nreturn `payment_status=\"no_payment_required\"` at session completion (no\nupfront charge \u2014 Stripe bills the first invoice at the first cycle).\nNon-paid statuses (e.g. \"unpaid\") are rejected.",
        "operationId": "issue_from_checkout_v1_billing_keys_from_checkout_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KeyIssueRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KeyIssueResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Issue From Checkout",
        "tags": [
          "billing"
        ]
      }
    },
    "/v1/billing/portal": {
      "post": {
        "operationId": "create_portal_v1_billing_portal_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PortalRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "title": "Response Create Portal V1 Billing Portal Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Portal",
        "tags": [
          "billing"
        ]
      }
    },
    "/v1/billing/refund_request": {
      "post": {
        "description": "Stripe \u3067\u8ab2\u91d1\u3055\u308c\u305f \u00a53/req \u30e1\u30fc\u30bf\u30ea\u30f3\u30b0\u5206\u306e\u8fd4\u91d1\u3092\u9867\u5ba2\u304c\u8acb\u6c42\u3059\u308b \u305f\u3081\u306e\u30a8\u30f3\u30c9\u30dd\u30a4\u30f3\u30c8\u3002\u904b\u55b6\u5074\u3067 14 \u65e5\u4ee5\u5185\u306b\u624b\u52d5\u5be9\u67fb\u3092\u884c\u3044\u307e\u3059\u3002 \u3053\u306e\u30a8\u30f3\u30c9\u30dd\u30a4\u30f3\u30c8\u306f\u53d7\u4ed8\u756a\u53f7\u306e\u767a\u884c\u3068\u901a\u77e5\u306e\u307f\u3067\u3001\u81ea\u52d5\u7684\u306a\u8fd4\u91d1\u3084 API \u30ad\u30fc\u5931\u52b9\u306f\u884c\u3044\u307e\u305b\u3093\u3002\u65e2\u306b\u8ab2\u91d1\u6e08\u307f\u306e\u5206\u3082\u5be9\u67fb\u5b8c\u4e86\u307e\u3067\u305d\u306e\u307e\u307e \u6b8b\u308a\u307e\u3059\u3002",
        "operationId": "submit_refund_request_v1_billing_refund_request_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RefundRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RefundResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "\u9867\u5ba2\u767a\u306e\u8fd4\u91d1\u8acb\u6c42\u53d7\u4ed8 (manual review)",
        "tags": [
          "billing"
        ]
      }
    },
    "/v1/billing/webhook": {
      "post": {
        "description": "Stripe webhook endpoint.\n\nP1 perf fix (audit a9fd80e134b538a32, 2026-04-25): outbound HTTP\n(Stripe.modify, Stripe.retrieve, Postmark sends) is scheduled via\n`BackgroundTasks` so it fires AFTER the 200 has been sent. Stripe\nexpects 200 within 5s; the previous inline path could exceed that\non Stripe API or Postmark slow-paths and trigger redelivery.\n\nOrder on the request path (all fast, all in-process / SQLite):\n  1. Content-Length guard\n  2. Read body + signature verify\n  3. Livemode guard\n  4. Dedup INSERT into `stripe_webhook_events` (BEGIN IMMEDIATE)\n  5. Synchronous DB writes (issue_key, update_tier, revoke_subscription,\n     update_subscription_status_*) \u2014 all SQLite, sub-millisecond\n  6. COMMIT\n  7. Schedule slow ops via background_tasks (Stripe API + Postmark)\n  8. Return 200\n\nBackground tasks open their OWN DB connection where needed \u2014 the\nrequest-scoped `conn` is closed by FastAPI before BackgroundTasks\nfire.",
        "operationId": "webhook_v1_billing_webhook_post",
        "parameters": [
          {
            "in": "header",
            "name": "stripe-signature",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Stripe-Signature"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "title": "Response Webhook V1 Billing Webhook Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Webhook",
        "tags": [
          "billing"
        ]
      }
    },
    "/v1/calendar/deadlines": {
      "get": {
        "description": "List upcoming submission deadlines.\n\nAnswers \"what's due in the next 30 days for \u6771\u4eac SMBs?\" in one call so\ncallers don't stitch together N search_programs requests. Programs\nwithout a structured end_date are silently excluded \u2014 they are not\n\"no deadline\", they are \"we couldn't extract one\" and need case-by-case\nlookup via get_program.",
        "operationId": "get_deadlines_v1_calendar_deadlines_get",
        "parameters": [
          {
            "description": "Only return programs whose end_date falls between today and today + within_days (inclusive). Default 30.",
            "in": "query",
            "name": "within_days",
            "required": false,
            "schema": {
              "default": 30,
              "description": "Only return programs whose end_date falls between today and today + within_days (inclusive). Default 30.",
              "maximum": 180,
              "minimum": 1,
              "title": "Within Days",
              "type": "integer"
            }
          },
          {
            "description": "Prefecture filter. Canonical kanji ('\u6771\u4eac\u90fd'), short ('\u6771\u4eac'), romaji ('Tokyo'), or '\u5168\u56fd' / 'national'. Nationwide programs and prefecture-unassigned rows are always included.",
            "in": "query",
            "name": "prefecture",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 40,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Prefecture filter. Canonical kanji ('\u6771\u4eac\u90fd'), short ('\u6771\u4eac'), romaji ('Tokyo'), or '\u5168\u56fd' / 'national'. Nationwide programs and prefecture-unassigned rows are always included.",
              "title": "Prefecture"
            }
          },
          {
            "description": "Authority level filter. Canonical EN: national / prefecture / municipality / financial. Also accepts JP (\u56fd / \u90fd\u9053\u5e9c\u770c / \u5e02\u533a\u753a\u6751).",
            "in": "query",
            "name": "authority_level",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 20,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Authority level filter. Canonical EN: national / prefecture / municipality / financial. Also accepts JP (\u56fd / \u90fd\u9053\u5e9c\u770c / \u5e02\u533a\u753a\u6751).",
              "title": "Authority Level"
            }
          },
          {
            "description": "Repeat to OR across tiers (e.g. tier=S&tier=A).",
            "in": "query",
            "name": "tier",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Repeat to OR across tiers (e.g. tier=S&tier=A).",
              "title": "Tier"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeadlinesResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Deadlines",
        "tags": [
          "calendar"
        ]
      }
    },
    "/v1/case-studies/search": {
      "get": {
        "description": "Search \u63a1\u629e\u4e8b\u4f8b case studies.",
        "operationId": "search_case_studies_v1_case_studies_search_get",
        "parameters": [
          {
            "description": "Free-text search over company_name + case_title + case_summary + source_excerpt. Backed by FTS5 trigram (case_studies_fts) for queries of length >= 2; falls back to LIKE for single-char or 0-result short-ASCII queries.",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 200,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Free-text search over company_name + case_title + case_summary + source_excerpt. Backed by FTS5 trigram (case_studies_fts) for queries of length >= 2; falls back to LIKE for single-char or 0-result short-ASCII queries.",
              "title": "Q"
            }
          },
          {
            "in": "query",
            "name": "prefecture",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 80,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Prefecture"
            }
          },
          {
            "description": "JSIC industry code prefix (e.g. 'A' for \u8fb2\u6797\u6c34\u7523\u696d, '05' for \u98df\u6599\u54c1\u88fd\u9020\u696d).",
            "in": "query",
            "name": "industry_jsic",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 10,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "JSIC industry code prefix (e.g. 'A' for \u8fb2\u6797\u6c34\u7523\u696d, '05' for \u98df\u6599\u54c1\u88fd\u9020\u696d).",
              "title": "Industry Jsic"
            }
          },
          {
            "description": "13-digit \u6cd5\u4eba\u756a\u53f7 exact match. NOTE: only ~19% of case studies carry \u6cd5\u4eba\u756a\u53f7 (427 / 2,286 rows) \u2014 most \u63a1\u629e announcements publish \u793e\u540d only. Prefer `q=<company_name>` for substring search when the \u6cd5\u4eba\u756a\u53f7 is unknown.",
            "in": "query",
            "name": "houjin_bangou",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 13,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "13-digit \u6cd5\u4eba\u756a\u53f7 exact match. NOTE: only ~19% of case studies carry \u6cd5\u4eba\u756a\u53f7 (427 / 2,286 rows) \u2014 most \u63a1\u629e announcements publish \u793e\u540d only. Prefer `q=<company_name>` for substring search when the \u6cd5\u4eba\u756a\u53f7 is unknown.",
              "title": "Houjin Bangou"
            }
          },
          {
            "description": "Match rows whose programs_used_json list contains this program name or unified_id substring.",
            "in": "query",
            "name": "program_used",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 200,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Match rows whose programs_used_json list contains this program name or unified_id substring.",
              "title": "Program Used"
            }
          },
          {
            "description": "Lower bound on total_subsidy_received_yen (JPY). WARNING: only 4 / 2,286 rows (<1%) carry an amount \u2014 ministries publish \u63a1\u629e without \u4ea4\u4ed8\u984d. Filtering here silently drops ~99% of matches.",
            "in": "query",
            "name": "min_subsidy_yen",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "minimum": 0,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Lower bound on total_subsidy_received_yen (JPY). WARNING: only 4 / 2,286 rows (<1%) carry an amount \u2014 ministries publish \u63a1\u629e without \u4ea4\u4ed8\u984d. Filtering here silently drops ~99% of matches.",
              "title": "Min Subsidy Yen"
            }
          },
          {
            "description": "Upper bound on total_subsidy_received_yen (JPY). Same <1% sparsity as min_subsidy_yen \u2014 avoid unless the user explicitly asked for a ceiling.",
            "in": "query",
            "name": "max_subsidy_yen",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "minimum": 0,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Upper bound on total_subsidy_received_yen (JPY). Same <1% sparsity as min_subsidy_yen \u2014 avoid unless the user explicitly asked for a ceiling.",
              "title": "Max Subsidy Yen"
            }
          },
          {
            "in": "query",
            "name": "min_employees",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "minimum": 0,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Min Employees"
            }
          },
          {
            "in": "query",
            "name": "max_employees",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "minimum": 0,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Max Employees"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "limit": 20,
                  "offset": 0,
                  "results": [
                    {
                      "amount_received_man_yen": 150,
                      "case_id": "CS-meti-jizokuka-2024-00123",
                      "case_summary": "EC \u30b5\u30a4\u30c8\u69cb\u7bc9\u8cbb 200 \u4e07\u5186\u88dc\u52a9\u3067\u58f2\u4e0a 1.4 \u500d\u3002",
                      "case_title": "\u6301\u7d9a\u5316\u88dc\u52a9\u91d1\u3067\u65b0\u898f\u8ca9\u8def\u958b\u62d3\u306b\u6210\u529f",
                      "company_name": "\u682a\u5f0f\u4f1a\u793e\u30e4\u30de\u30c0\u88fd\u4f5c\u6240",
                      "confidence": 0.92,
                      "fetched_at": "2026-04-20T05:14:33Z",
                      "fiscal_year": 2024,
                      "houjin_bangou": "1234567890123",
                      "industry_jsic": "29",
                      "prefecture": "\u7fa4\u99ac\u770c",
                      "program_used": "\u5c0f\u898f\u6a21\u4e8b\u696d\u8005\u6301\u7d9a\u5316\u88dc\u52a9\u91d1",
                      "source_url": "https://www.jizokukahojokin.info/case/123"
                    }
                  ],
                  "total": 1
                },
                "schema": {
                  "$ref": "#/components/schemas/CaseStudySearchResponse"
                }
              }
            },
            "description": "Paginated case_studies. Search via FTS5 trigram on company_name + case_title + summary."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Validation error \u2014 `code` \u2208 {invalid_enum, invalid_date_format, missing_required_arg, out_of_range, ambiguous_query}."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Authentication required \u2014 `code='auth_required'`. Send `X-API-Key`."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not found \u2014 `code` \u2208 {no_matching_records, seed_not_found, route_not_found}."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable entity \u2014 Pydantic validation failure (`code='invalid_enum'`)."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate limit \u2014 `code='rate_limit_exceeded'`. Honour `Retry-After`."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Internal error \u2014 `code` \u2208 {internal, internal_error, db_locked, db_unavailable}."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Subsystem unavailable \u2014 `code` \u2208 {subsystem_unavailable, service_unavailable, cap_reached}."
          }
        },
        "summary": "Search Case Studies",
        "tags": [
          "case-studies"
        ]
      }
    },
    "/v1/case-studies/{case_id}": {
      "get": {
        "description": "Single case study lookup by `case_id`.",
        "operationId": "get_case_study_v1_case_studies__case_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "title": "Case Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaseStudy"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Validation error \u2014 `code` \u2208 {invalid_enum, invalid_date_format, missing_required_arg, out_of_range, ambiguous_query}."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Authentication required \u2014 `code='auth_required'`. Send `X-API-Key`."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "case study not found \u2014 `error.code='no_matching_records'`."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable entity \u2014 Pydantic validation failure (`code='invalid_enum'`)."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate limit \u2014 `code='rate_limit_exceeded'`. Honour `Retry-After`."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Internal error \u2014 `code` \u2208 {internal, internal_error, db_locked, db_unavailable}."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Subsystem unavailable \u2014 `code` \u2208 {subsystem_unavailable, service_unavailable, cap_reached}."
          }
        },
        "summary": "Get Case Study",
        "tags": [
          "case-studies"
        ]
      }
    },
    "/v1/compliance/stripe-checkout": {
      "post": {
        "description": "Create a Stripe Checkout Session for a verified paid subscriber.\n\nRequires the subscriber row to already exist and be verified. The\nsession's `client_reference_id` is the subscriber_id so the webhook\ncan tie the Stripe subscription back to our row.",
        "operationId": "stripe_checkout_v1_compliance_stripe_checkout_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/jpintel_mcp__api__compliance__CheckoutRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/jpintel_mcp__api__compliance__CheckoutResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Stripe Checkout",
        "tags": [
          "compliance"
        ]
      }
    },
    "/v1/compliance/stripe-webhook": {
      "post": {
        "description": "Handle customer.subscription.created/.deleted for the alert product.\n\nOn `created` we persist stripe_customer_id / stripe_subscription_id +\nflip plan to 'paid' if it wasn't already.\nOn `deleted` we mark canceled_at (same effect as a customer clicking\nthe unsubscribe link \u2014 Stripe Customer Portal cancel path).",
        "operationId": "stripe_webhook_v1_compliance_stripe_webhook_post",
        "parameters": [
          {
            "in": "header",
            "name": "stripe-signature",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Stripe-Signature"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "title": "Response Stripe Webhook V1 Compliance Stripe Webhook Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Stripe Webhook",
        "tags": [
          "compliance"
        ]
      }
    },
    "/v1/compliance/subscribe": {
      "post": {
        "description": "Create a new pending subscription + send verification email.\n\nFlow:\n    1. Insert row with `verification_token` set, `verified_at=NULL`.\n    2. Send verification email (async best-effort via Postmark).\n    3. If plan='paid', return `next_step='checkout'` + a placeholder\n       response \u2014 the caller should then POST /stripe-checkout.\n       (The caller must verify FIRST; the verify GET redirects to\n       the checkout for paid plans \u2014 see below.)\n    4. If plan='free', return `next_step='verify'`.\n\nDuplicate email behaviour: we return the SAME response shape whether\nthis is a fresh signup or an already-existing email \u2014 no enumeration\nleak. A second subscribe with the same email re-sends the verification\nmail (an attacker cannot see `verified_at` from the endpoint; worst\ncase they can DoS our Postmark budget, which the anon rate limit\ncovers).",
        "operationId": "subscribe_v1_compliance_subscribe_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/jpintel_mcp__api__compliance__SubscribeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/jpintel_mcp__api__compliance__SubscribeResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Subscribe",
        "tags": [
          "compliance"
        ]
      }
    },
    "/v1/compliance/unsubscribe/{unsubscribe_token}": {
      "post": {
        "description": "Cancel the subscription.\n\n- For `plan='paid'`: also cancels the Stripe subscription (best-effort;\n  if Stripe is down we still mark canceled_at locally so no more\n  emails go out).\n- For `plan='free'`: just marks `canceled_at`.\nReturns HTML so the static unsubscribe landing page can call this\nvia fetch + show the body.",
        "operationId": "unsubscribe_v1_compliance_unsubscribe__unsubscribe_token__post",
        "parameters": [
          {
            "in": "path",
            "name": "unsubscribe_token",
            "required": true,
            "schema": {
              "title": "Unsubscribe Token",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Unsubscribe",
        "tags": [
          "compliance"
        ]
      }
    },
    "/v1/compliance/verify/{verification_token}": {
      "get": {
        "description": "Mark a subscriber as verified. Renders a minimal HTML page.\n\nA valid token flips `verified_at = now()` and clears\n`verification_token`. Idempotent \u2014 a second click shows the same\nsuccess page (we look up by email after the clear, so the row is\nstill findable by unsubscribe_token but not by verification_token).\n\nFor paid subscribers, the page nudges the user to the Stripe checkout\npage (link to `/alerts.html#checkout`).",
        "operationId": "verify_v1_compliance_verify__verification_token__get",
        "parameters": [
          {
            "in": "path",
            "name": "verification_token",
            "required": true,
            "schema": {
              "title": "Verification Token",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Verify",
        "tags": [
          "compliance"
        ]
      }
    },
    "/v1/court-decisions/by-statute": {
      "post": {
        "description": "Return court decisions citing a given LAW-<10 hex> statute.\n\nTRACE endpoint: resolves the statute\u2192ruling edge via\n`related_law_ids_json`. When `article_citation` is supplied, we\nadditionally require the article string to appear in `key_ruling` or\n`source_excerpt` \u2014 the ingest does not yet write a structured\n(law_id, article) map, so this is a honest contains-check, not a\nfalse-precision exact join. Callers should treat `article_citation`\nnarrowing as best-effort.",
        "operationId": "decisions_by_statute_v1_court_decisions_by_statute_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CourtDecisionByStatuteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtDecisionSearchResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Decisions By Statute",
        "tags": [
          "court-decisions"
        ]
      }
    },
    "/v1/court-decisions/search": {
      "get": {
        "description": "Search court decisions (\u5224\u6c7a / \u6c7a\u5b9a / \u547d\u4ee4).",
        "operationId": "search_court_decisions_v1_court_decisions_search_get",
        "parameters": [
          {
            "description": "Free-text search across case_name + subject_area + key_ruling + impact_on_business (FTS5 with quoted-phrase workaround for 2+ character kanji compounds).",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 200,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Free-text search across case_name + subject_area + key_ruling + impact_on_business (FTS5 with quoted-phrase workaround for 2+ character kanji compounds).",
              "title": "Q"
            }
          },
          {
            "description": "Filter by \u88c1\u5224\u6240\u540d (exact match, e.g. '\u6700\u9ad8\u88c1\u5224\u6240\u7b2c\u4e09\u5c0f\u6cd5\u5ef7').",
            "in": "query",
            "name": "court",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 160,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by \u88c1\u5224\u6240\u540d (exact match, e.g. '\u6700\u9ad8\u88c1\u5224\u6240\u7b2c\u4e09\u5c0f\u6cd5\u5ef7').",
              "title": "Court"
            }
          },
          {
            "description": "Filter by court tier. One of: supreme | high | district | summary | family.",
            "in": "query",
            "name": "court_level",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "supreme",
                    "high",
                    "district",
                    "summary",
                    "family"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by court tier. One of: supreme | high | district | summary | family.",
              "title": "Court Level"
            }
          },
          {
            "description": "Filter by decision shape. One of: \u5224\u6c7a | \u6c7a\u5b9a | \u547d\u4ee4.",
            "in": "query",
            "name": "decision_type",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "\u5224\u6c7a",
                    "\u6c7a\u5b9a",
                    "\u547d\u4ee4"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by decision shape. One of: \u5224\u6c7a | \u6c7a\u5b9a | \u547d\u4ee4.",
              "title": "Decision Type"
            }
          },
          {
            "description": "Filter by \u5206\u91ce (substring LIKE \u2014 the column is free-text and varies by \u5224\u4f8b\u96c6, so exact-match is too brittle).",
            "in": "query",
            "name": "subject_area",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 120,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by \u5206\u91ce (substring LIKE \u2014 the column is free-text and varies by \u5224\u4f8b\u96c6, so exact-match is too brittle).",
              "title": "Subject Area"
            }
          },
          {
            "description": "Filter rows whose `related_law_ids_json` contains this LAW-<10 hex> unified_id. JSON-array substring LIKE \u2014 accurate because unified_ids are fixed-width and have a distinctive `LAW-` prefix.",
            "in": "query",
            "name": "references_law_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^LAW-[0-9a-f]{10}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter rows whose `related_law_ids_json` contains this LAW-<10 hex> unified_id. JSON-array substring LIKE \u2014 accurate because unified_ids are fixed-width and have a distinctive `LAW-` prefix.",
              "title": "References Law Id"
            }
          },
          {
            "description": "ISO date (YYYY-MM-DD) \u2014 inclusive lower bound on decision_date.",
            "in": "query",
            "name": "decided_from",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "ISO date (YYYY-MM-DD) \u2014 inclusive lower bound on decision_date.",
              "title": "Decided From"
            }
          },
          {
            "description": "ISO date (YYYY-MM-DD) \u2014 inclusive upper bound on decision_date.",
            "in": "query",
            "name": "decided_to",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "ISO date (YYYY-MM-DD) \u2014 inclusive upper bound on decision_date.",
              "title": "Decided To"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtDecisionSearchResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Search Court Decisions",
        "tags": [
          "court-decisions"
        ]
      }
    },
    "/v1/court-decisions/{unified_id}": {
      "get": {
        "description": "Return a single court decision with full source lineage.",
        "operationId": "get_court_decision_v1_court_decisions__unified_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "unified_id",
            "required": true,
            "schema": {
              "title": "Unified Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtDecision"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Court Decision",
        "tags": [
          "court-decisions"
        ]
      }
    },
    "/v1/device/authorize": {
      "post": {
        "description": "Mint a fresh (device_code, user_code) pair (RFC 8628 \u00a73.1).",
        "operationId": "authorize_v1_device_authorize_post",
        "parameters": [
          {
            "in": "header",
            "name": "user-agent",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "User-Agent"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AuthorizeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthorizeResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Authorize",
        "tags": [
          "device"
        ]
      }
    },
    "/v1/device/complete": {
      "post": {
        "description": "Called by /go after Stripe Checkout succeeds.\n\n1. Verifies the Stripe session is paid (or metered \u2014 no_payment_required).\n2. Marks device_code activated.\n3. Issues an api_keys row prefixed 'am_device_' and links it.\n4. Stashes the raw key in the in-process pickup map so the MCP's\n   next /token poll picks it up.",
        "operationId": "complete_v1_device_complete_post",
        "parameters": [
          {
            "in": "header",
            "name": "origin",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Origin"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompleteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompleteResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Complete",
        "tags": [
          "device"
        ]
      }
    },
    "/v1/device/token": {
      "post": {
        "description": "Device-flow poll endpoint (RFC 8628 \u00a73.4).\n\nSuccess \u2192 {access_token, token_type, scope} + 200.\nPending \u2192 authorization_pending (400).\nPolling too fast \u2192 slow_down (400).\nExpired \u2192 expired_token (400).\nDenied \u2192 access_denied (400).\nInvalid grant_type / device_code \u2192 invalid_grant (400).",
        "operationId": "token_v1_device_token_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TokenRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenSuccess"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Token",
        "tags": [
          "device"
        ]
      }
    },
    "/v1/email/unsubscribe": {
      "get": {
        "description": "HTML variant \u2014 clicked from a footer link.\n\nMail clients and corporate scanners pre-fetch GET links to scan for\nmalware. To keep that from auto-unsubscribing, we ONLY honour the\nGET when the token verifies AND the user explicitly hits the page.\nToken verification is the same HMAC check as POST so a bot-fetch with\na stolen-but-real token would still unsubscribe \u2014 that's by design;\na real token implies real user intent.",
        "operationId": "unsubscribe_get_v1_email_unsubscribe_get",
        "parameters": [
          {
            "in": "query",
            "name": "email",
            "required": true,
            "schema": {
              "maxLength": 320,
              "minLength": 3,
              "title": "Email",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "token",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 16,
              "title": "Token",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Unsubscribe Get",
        "tags": [
          "email"
        ]
      },
      "post": {
        "description": "Idempotent self-serve master-list opt-out.\n\nOn invalid token we DO NOT raise 401 \u2014 that would let an attacker\nenumerate which addresses are valid. We return the success shape\nwith a fixed timestamp instead. The internal write is silently\nskipped.",
        "operationId": "unsubscribe_post_v1_email_unsubscribe_post",
        "parameters": [
          {
            "in": "query",
            "name": "email",
            "required": true,
            "schema": {
              "maxLength": 320,
              "minLength": 3,
              "title": "Email",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "token",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 16,
              "title": "Token",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "reason",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 64,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Reason"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnsubscribeResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Unsubscribe Post",
        "tags": [
          "email"
        ]
      }
    },
    "/v1/email/webhook": {
      "post": {
        "operationId": "postmark_webhook_v1_email_webhook_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Postmark-Signature",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Postmark-Signature"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "title": "Response Postmark Webhook V1 Email Webhook Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Postmark Webhook",
        "tags": [
          "email"
        ]
      }
    },
    "/v1/enforcement-cases/search": {
      "get": {
        "description": "Search enforcement cases for compliance / DD lookup.",
        "operationId": "search_enforcement_cases_v1_enforcement_cases_search_get",
        "parameters": [
          {
            "description": "Free-text search over program_name_hint + reason_excerpt + source_title (LIKE, case-insensitive).",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 200,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Free-text search over program_name_hint + reason_excerpt + source_title (LIKE, case-insensitive).",
              "title": "Q"
            }
          },
          {
            "in": "query",
            "name": "event_type",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 80,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Event Type"
            }
          },
          {
            "in": "query",
            "name": "ministry",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 120,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Ministry"
            }
          },
          {
            "in": "query",
            "name": "prefecture",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 80,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Prefecture"
            }
          },
          {
            "in": "query",
            "name": "legal_basis",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 200,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Legal Basis"
            }
          },
          {
            "in": "query",
            "name": "program_name_hint",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 200,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Program Name Hint"
            }
          },
          {
            "description": "13-digit \u6cd5\u4eba\u756a\u53f7 filter. NOTE: this column is 100% NULL across all 1,185 enforcement cases because \u4f1a\u8a08\u691c\u67fb\u9662 does not publish \u6cd5\u4eba\u756a\u53f7. Filtering by this parameter will always return 0 rows. Use `q=<company_name>` or `q=<houjin_bangou_digits>` for substring search over source_title / reason_excerpt / program_name_hint instead.",
            "in": "query",
            "name": "recipient_houjin_bangou",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 13,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "13-digit \u6cd5\u4eba\u756a\u53f7 filter. NOTE: this column is 100% NULL across all 1,185 enforcement cases because \u4f1a\u8a08\u691c\u67fb\u9662 does not publish \u6cd5\u4eba\u756a\u53f7. Filtering by this parameter will always return 0 rows. Use `q=<company_name>` or `q=<houjin_bangou_digits>` for substring search over source_title / reason_excerpt / program_name_hint instead.",
              "title": "Recipient Houjin Bangou"
            }
          },
          {
            "in": "query",
            "name": "min_improper_grant_yen",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "minimum": 0,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Min Improper Grant Yen"
            }
          },
          {
            "in": "query",
            "name": "max_improper_grant_yen",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "minimum": 0,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Max Improper Grant Yen"
            }
          },
          {
            "description": "ISO date (YYYY-MM-DD) \u2014 inclusive lower bound on disclosed_date.",
            "in": "query",
            "name": "disclosed_from",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "ISO date (YYYY-MM-DD) \u2014 inclusive lower bound on disclosed_date.",
              "title": "Disclosed From"
            }
          },
          {
            "description": "ISO date (YYYY-MM-DD) \u2014 inclusive upper bound on disclosed_date.",
            "in": "query",
            "name": "disclosed_until",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "ISO date (YYYY-MM-DD) \u2014 inclusive upper bound on disclosed_date.",
              "title": "Disclosed Until"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "limit": 20,
                  "offset": 0,
                  "results": [
                    {
                      "amount_yen": 12500000,
                      "case_id": "ENF-jftc-2024-00045",
                      "confidence": 0.98,
                      "disclosed_date": "2024-02-15",
                      "event_type": "\u6392\u9664\u63aa\u7f6e\u547d\u4ee4",
                      "fetched_at": "2026-04-22T08:11:00Z",
                      "ministry": "\u516c\u6b63\u53d6\u5f15\u59d4\u54e1\u4f1a",
                      "prefecture": "\u5927\u962a\u5e9c",
                      "reason_excerpt": "\u516c\u5171\u5de5\u4e8b\u5165\u672d\u8ac7\u5408\u306e\u4e8b\u5b9f\u3092\u8a8d\u5b9a\u3002",
                      "recipient_houjin_bangou": "9876543210987",
                      "recipient_kind": "houjin",
                      "recipient_name": "\u682a\u5f0f\u4f1a\u793e\u30b5\u30f3\u30d7\u30eb\u5efa\u8a2d",
                      "source_title": "\u6392\u9664\u63aa\u7f6e\u547d\u4ee4\u53ca\u3073\u8ab2\u5fb4\u91d1\u7d0d\u4ed8\u547d\u4ee4\u306b\u3064\u3044\u3066",
                      "source_url": "https://www.jftc.go.jp/houdou/pressrelease/2024/feb/..."
                    }
                  ],
                  "total": 1
                },
                "schema": {
                  "$ref": "#/components/schemas/EnforcementCaseSearchResponse"
                }
              }
            },
            "description": "Paginated \u884c\u653f\u51e6\u5206 / \u4f1a\u8a08\u691c\u67fb\u9662 indications. Use this for compliance / due-diligence on a recipient or program."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Validation error \u2014 `code` \u2208 {invalid_enum, invalid_date_format, missing_required_arg, out_of_range, ambiguous_query}."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Authentication required \u2014 `code='auth_required'`. Send `X-API-Key`."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not found \u2014 `code` \u2208 {no_matching_records, seed_not_found, route_not_found}."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable entity \u2014 Pydantic validation failure (`code='invalid_enum'`)."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate limit \u2014 `code='rate_limit_exceeded'`. Honour `Retry-After`."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Internal error \u2014 `code` \u2208 {internal, internal_error, db_locked, db_unavailable}."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Subsystem unavailable \u2014 `code` \u2208 {subsystem_unavailable, service_unavailable, cap_reached}."
          }
        },
        "summary": "Search Enforcement Cases",
        "tags": [
          "enforcement-cases"
        ]
      }
    },
    "/v1/enforcement-cases/{case_id}": {
      "get": {
        "operationId": "get_enforcement_case_v1_enforcement_cases__case_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "title": "Case Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnforcementCase"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Validation error \u2014 `code` \u2208 {invalid_enum, invalid_date_format, missing_required_arg, out_of_range, ambiguous_query}."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Authentication required \u2014 `code='auth_required'`. Send `X-API-Key`."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "case not found \u2014 `error.code='no_matching_records'`."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable entity \u2014 Pydantic validation failure (`code='invalid_enum'`)."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate limit \u2014 `code='rate_limit_exceeded'`. Honour `Retry-After`."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Internal error \u2014 `code` \u2208 {internal, internal_error, db_locked, db_unavailable}."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Subsystem unavailable \u2014 `code` \u2208 {subsystem_unavailable, service_unavailable, cap_reached}."
          }
        },
        "summary": "Get Enforcement Case",
        "tags": [
          "enforcement-cases"
        ]
      }
    },
    "/v1/exclusions/check": {
      "post": {
        "operationId": "check_exclusions_v1_exclusions_check_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExclusionCheckRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExclusionCheckResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Check Exclusions",
        "tags": [
          "exclusions"
        ]
      }
    },
    "/v1/exclusions/rules": {
      "get": {
        "operationId": "list_rules_v1_exclusions_rules_get",
        "parameters": [
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ExclusionRule"
                  },
                  "title": "Response List Rules V1 Exclusions Rules Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Rules",
        "tags": [
          "exclusions"
        ]
      }
    },
    "/v1/feedback": {
      "post": {
        "operationId": "submit_feedback_v1_feedback_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FeedbackRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeedbackResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Submit Feedback",
        "tags": [
          "feedback"
        ]
      }
    },
    "/v1/invoice_registrants/search": {
      "get": {
        "description": "Search \u9069\u683c\u8acb\u6c42\u66f8\u767a\u884c\u4e8b\u696d\u8005 by name / \u6cd5\u4eba\u756a\u53f7 / location / status.\n\nThis endpoint is lookup-only. Bulk-style queries (empty q + empty\nfilters paging through the full table) work but return exactly one\npage at a time; the PDL v1.0 attribution is repeated on every page to\nkeep \u51fa\u5178\u660e\u8a18 + \u7de8\u96c6\u30fb\u52a0\u5de5\u6ce8\u8a18 visible across paginated reads.",
        "operationId": "search_invoice_registrants_v1_invoice_registrants_search_get",
        "parameters": [
          {
            "description": "Prefix match on \u4e8b\u696d\u8005\u540d (normalized_name). Index-eligible LIKE \u2014 not FTS. Short queries (< 2 chars) are rejected to keep the match selective.",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 200,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Prefix match on \u4e8b\u696d\u8005\u540d (normalized_name). Index-eligible LIKE \u2014 not FTS. Short queries (< 2 chars) are rejected to keep the match selective.",
              "title": "Q"
            }
          },
          {
            "description": "Exact 13-digit \u6cd5\u4eba\u756a\u53f7 filter. Returns only rows where houjin_bangou matches (sole-proprietor rows excluded).",
            "in": "query",
            "name": "houjin_bangou",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^\\d{13}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Exact 13-digit \u6cd5\u4eba\u756a\u53f7 filter. Returns only rows where houjin_bangou matches (sole-proprietor rows excluded).",
              "title": "Houjin Bangou"
            }
          },
          {
            "description": "corporate = \u6cd5\u4eba (registrant_kind='corporation'); individual = \u500b\u4eba\u4e8b\u696d\u4e3b (registrant_kind='sole_proprietor'). Omit to include both plus 'other'.",
            "in": "query",
            "name": "kind",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "corporate",
                    "individual"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "corporate = \u6cd5\u4eba (registrant_kind='corporation'); individual = \u500b\u4eba\u4e8b\u696d\u4e3b (registrant_kind='sole_proprietor'). Omit to include both plus 'other'.",
              "title": "Kind"
            }
          },
          {
            "description": "Prefecture name. Canonical = full-suffix kanji ('\u6771\u4eac\u90fd'); short form ('\u6771\u4eac') and romaji also accepted.",
            "in": "query",
            "name": "prefecture",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 20,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Prefecture name. Canonical = full-suffix kanji ('\u6771\u4eac\u90fd'); short form ('\u6771\u4eac') and romaji also accepted.",
              "title": "Prefecture"
            }
          },
          {
            "description": "ISO date (YYYY-MM-DD) \u2014 inclusive lower bound on registered_date.",
            "in": "query",
            "name": "registered_after",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "ISO date (YYYY-MM-DD) \u2014 inclusive lower bound on registered_date.",
              "title": "Registered After"
            }
          },
          {
            "description": "ISO date (YYYY-MM-DD) \u2014 inclusive upper bound on registered_date.",
            "in": "query",
            "name": "registered_before",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "ISO date (YYYY-MM-DD) \u2014 inclusive upper bound on registered_date.",
              "title": "Registered Before"
            }
          },
          {
            "description": "When true (default), excludes revoked (revoked_date IS NOT NULL) and expired (expired_date IS NOT NULL) rows. Flip to false for historical/audit research.",
            "in": "query",
            "name": "active_only",
            "required": false,
            "schema": {
              "default": true,
              "description": "When true (default), excludes revoked (revoked_date IS NOT NULL) and expired (expired_date IS NOT NULL) rows. Flip to false for historical/audit research.",
              "title": "Active Only",
              "type": "boolean"
            }
          },
          {
            "description": "Page size. Default 50, hard cap 100. No wildcard bulk export \u2014 point consumers at NTA's own download URL for full snapshots.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Page size. Default 50, hard cap 100. No wildcard bulk export \u2014 point consumers at NTA's own download URL for full snapshots.",
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/jpintel_mcp__api__invoice_registrants__SearchResponse"
                }
              }
            },
            "description": "SearchResponse. Every 2xx body carries a PDL v1.0 `attribution` block \u2014 required by \u516c\u5171\u30c7\u30fc\u30bf\u5229\u7528\u898f\u7d04 \u7b2c1.0\u7248."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Search Invoice Registrants",
        "tags": [
          "invoice_registrants"
        ]
      }
    },
    "/v1/invoice_registrants/{invoice_registration_number}": {
      "get": {
        "description": "Exact lookup by \u9069\u683c\u8acb\u6c42\u66f8\u767a\u884c\u4e8b\u696d\u8005\u767b\u9332\u756a\u53f7 ('T' + 13 digits).\n\nOn miss we do NOT raise a bare 404. The 4M-row \u9069\u683c\u4e8b\u696d\u8005 population\nonly lands in our mirror at the post-launch monthly bulk refresh, so\na launch-week miss frequently means \"your T-number is real, we just\nhaven't ingested it yet\" \u2014 not \"this T-number is invalid\". The\nenriched 404 body distinguishes the two cases for the caller and\npoints them at NTA's authoritative lookup as the immediate fallback.",
        "operationId": "get_invoice_registrant_v1_invoice_registrants__invoice_registration_number__get",
        "parameters": [
          {
            "in": "path",
            "name": "invoice_registration_number",
            "required": true,
            "schema": {
              "title": "Invoice Registration Number",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetResponse"
                }
              }
            },
            "description": "GetResponse. Every 2xx body carries a PDL v1.0 `attribution` block \u2014 required by \u516c\u5171\u30c7\u30fc\u30bf\u5229\u7528\u898f\u7d04 \u7b2c1.0\u7248."
          },
          "404": {
            "description": "registrant not found in the current snapshot. The 404 body is structured (not a bare `detail` string): it reports `snapshot_size` of the partial mirror we currently serve, the `full_population_estimate` for context, an `alternative` URL pointing at NTA's official lookup, plus the same PDL v1.0 `attribution` block carried by 2xx responses so \u51fa\u5178\u660e\u8a18 + \u7de8\u96c6\u30fb\u52a0\u5de5\u6ce8\u8a18 stay attached even on miss. This shape is contractual \u2014 see tests/test_invoice_registrants_404.py."
          },
          "422": {
            "description": "invoice_registration_number malformed (must match '^T\\d{13}$')"
          }
        },
        "summary": "Get Invoice Registrant",
        "tags": [
          "invoice_registrants"
        ]
      }
    },
    "/v1/laws/search": {
      "get": {
        "description": "Search laws (statutes, ordinances, ministerial rules).",
        "operationId": "search_laws_v1_laws_search_get",
        "parameters": [
          {
            "description": "Free-text search across law_title + law_short_title + law_number + summary (FTS5 with quoted-phrase workaround for 2+ character kanji compounds). Terms shorter than 3 characters fall through to LIKE to dodge trigram zero-match.",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 200,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Free-text search across law_title + law_short_title + law_number + summary (FTS5 with quoted-phrase workaround for 2+ character kanji compounds). Terms shorter than 3 characters fall through to LIKE to dodge trigram zero-match.",
              "title": "Q"
            }
          },
          {
            "description": "Filter by law_type. One of: constitution | act | cabinet_order | imperial_order | ministerial_ordinance | rule | notice | guideline.",
            "in": "query",
            "name": "law_type",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "constitution",
                    "act",
                    "cabinet_order",
                    "imperial_order",
                    "ministerial_ordinance",
                    "rule",
                    "notice",
                    "guideline"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by law_type. One of: constitution | act | cabinet_order | imperial_order | ministerial_ordinance | rule | notice | guideline.",
              "title": "Law Type"
            }
          },
          {
            "description": "Filter by \u6240\u7ba1\u5e9c\u7701 (exact match).",
            "in": "query",
            "name": "ministry",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 120,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by \u6240\u7ba1\u5e9c\u7701 (exact match).",
              "title": "Ministry"
            }
          },
          {
            "description": "When true (default), only `revision_status='current'` rows are returned. Flip to false to include 'superseded' rows.",
            "in": "query",
            "name": "currently_effective_only",
            "required": false,
            "schema": {
              "default": true,
              "description": "When true (default), only `revision_status='current'` rows are returned. Flip to false to include 'superseded' rows.",
              "title": "Currently Effective Only",
              "type": "boolean"
            }
          },
          {
            "description": "When false (default), `revision_status='repealed'` rows are excluded. Flip to true for historical research.",
            "in": "query",
            "name": "include_repealed",
            "required": false,
            "schema": {
              "default": false,
              "description": "When false (default), `revision_status='repealed'` rows are excluded. Flip to true for historical research.",
              "title": "Include Repealed",
              "type": "boolean"
            }
          },
          {
            "description": "ISO date (YYYY-MM-DD) \u2014 inclusive lower bound on promulgated_date.",
            "in": "query",
            "name": "promulgated_from",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "ISO date (YYYY-MM-DD) \u2014 inclusive lower bound on promulgated_date.",
              "title": "Promulgated From"
            }
          },
          {
            "description": "ISO date (YYYY-MM-DD) \u2014 inclusive upper bound on promulgated_date.",
            "in": "query",
            "name": "promulgated_to",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "ISO date (YYYY-MM-DD) \u2014 inclusive upper bound on promulgated_date.",
              "title": "Promulgated To"
            }
          },
          {
            "description": "ISO date (YYYY-MM-DD) \u2014 inclusive lower bound on enforced_date.",
            "in": "query",
            "name": "enforced_from",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "ISO date (YYYY-MM-DD) \u2014 inclusive lower bound on enforced_date.",
              "title": "Enforced From"
            }
          },
          {
            "description": "ISO date (YYYY-MM-DD) \u2014 inclusive upper bound on enforced_date.",
            "in": "query",
            "name": "enforced_to",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "ISO date (YYYY-MM-DD) \u2014 inclusive upper bound on enforced_date.",
              "title": "Enforced To"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "limit": 20,
                  "offset": 0,
                  "results": [
                    {
                      "article_count": 245,
                      "confidence": 1.0,
                      "enforced_date": "1965-04-01",
                      "fetched_at": "2026-04-20T05:14:33Z",
                      "full_text_url": "https://laws.e-gov.go.jp/law/340AC0000000033",
                      "last_amended_date": "2025-03-31",
                      "law_number": "\u662d\u548c\u56db\u5341\u5e74\u6cd5\u5f8b\u7b2c\u4e09\u5341\u4e09\u53f7",
                      "law_short_title": "\u6240\u5f97\u7a0e\u6cd5",
                      "law_title": "\u6240\u5f97\u7a0e\u6cd5",
                      "law_type": "act",
                      "ministry": "\u8ca1\u52d9\u7701",
                      "promulgated_date": "1965-03-31",
                      "revision_status": "current",
                      "source_url": "https://laws.e-gov.go.jp/law/340AC0000000033",
                      "subject_areas": [
                        "\u7a0e\u6cd5",
                        "\u6240\u5f97\u7a0e"
                      ],
                      "unified_id": "LAW-jp-shotokuzeiho"
                    }
                  ],
                  "total": 1
                },
                "schema": {
                  "$ref": "#/components/schemas/LawSearchResponse"
                }
              }
            },
            "description": "Paginated laws (e-Gov \u6cd5\u4ee4 catalog, CC-BY 4.0)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Validation error \u2014 `code` \u2208 {invalid_enum, invalid_date_format, missing_required_arg, out_of_range, ambiguous_query}."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Authentication required \u2014 `code='auth_required'`. Send `X-API-Key`."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not found \u2014 `code` \u2208 {no_matching_records, seed_not_found, route_not_found}."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable entity \u2014 Pydantic validation failure (`code='invalid_enum'`)."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate limit \u2014 `code='rate_limit_exceeded'`. Honour `Retry-After`."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Internal error \u2014 `code` \u2208 {internal, internal_error, db_locked, db_unavailable}."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Subsystem unavailable \u2014 `code` \u2208 {subsystem_unavailable, service_unavailable, cap_reached}."
          }
        },
        "summary": "Search Laws",
        "tags": [
          "laws"
        ]
      }
    },
    "/v1/laws/{unified_id}": {
      "get": {
        "description": "Return a single law including summary, article_count, and lineage.",
        "operationId": "get_law_v1_laws__unified_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "unified_id",
            "required": true,
            "schema": {
              "title": "Unified Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Law"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Validation error \u2014 `code` \u2208 {invalid_enum, invalid_date_format, missing_required_arg, out_of_range, ambiguous_query}."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Authentication required \u2014 `code='auth_required'`. Send `X-API-Key`."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "law not found \u2014 `error.code='no_matching_records'`."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable entity \u2014 Pydantic validation failure (`code='invalid_enum'`)."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate limit \u2014 `code='rate_limit_exceeded'`. Honour `Retry-After`."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Internal error \u2014 `code` \u2208 {internal, internal_error, db_locked, db_unavailable}."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Subsystem unavailable \u2014 `code` \u2208 {subsystem_unavailable, service_unavailable, cap_reached}."
          }
        },
        "summary": "Get Law",
        "tags": [
          "laws"
        ]
      }
    },
    "/v1/laws/{unified_id}/related-programs": {
      "get": {
        "description": "Reverse lookup: which programs cite this law via program_law_refs.",
        "operationId": "get_related_programs_v1_laws__unified_id__related_programs_get",
        "parameters": [
          {
            "in": "path",
            "name": "unified_id",
            "required": true,
            "schema": {
              "title": "Unified Id",
              "type": "string"
            }
          },
          {
            "description": "Filter by citation kind. One of: authority | eligibility | exclusion | reference | penalty. Omit to return all kinds.",
            "in": "query",
            "name": "ref_kind",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 20,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by citation kind. One of: authority | eligibility | exclusion | reference | penalty. Omit to return all kinds.",
              "title": "Ref Kind"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RelatedProgramsResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Validation error \u2014 `code` \u2208 {invalid_enum, invalid_date_format, missing_required_arg, out_of_range, ambiguous_query}."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Authentication required \u2014 `code='auth_required'`. Send `X-API-Key`."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "law not found \u2014 `error.code='no_matching_records'`."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable entity \u2014 Pydantic validation failure (`code='invalid_enum'`)."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate limit \u2014 `code='rate_limit_exceeded'`. Honour `Retry-After`."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Internal error \u2014 `code` \u2208 {internal, internal_error, db_locked, db_unavailable}."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Subsystem unavailable \u2014 `code` \u2208 {subsystem_unavailable, service_unavailable, cap_reached}."
          }
        },
        "summary": "Get Related Programs",
        "tags": [
          "laws"
        ]
      }
    },
    "/v1/loan-programs/search": {
      "get": {
        "description": "Search loan programs with three-axis risk filters.",
        "operationId": "search_loan_programs_v1_loan_programs_search_get",
        "parameters": [
          {
            "description": "Free-text search over program_name + provider + target_conditions.",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 200,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Free-text search over program_name + provider + target_conditions.",
              "title": "Q"
            }
          },
          {
            "in": "query",
            "name": "provider",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 200,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Provider"
            }
          },
          {
            "in": "query",
            "name": "loan_type",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 80,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Loan Type"
            }
          },
          {
            "description": "Risk axis 1 (\u7269\u7684\u62c5\u4fdd). One of: required | not_required | negotiable | unknown.",
            "in": "query",
            "name": "collateral_required",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 20,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Risk axis 1 (\u7269\u7684\u62c5\u4fdd). One of: required | not_required | negotiable | unknown.",
              "title": "Collateral Required"
            }
          },
          {
            "description": "Risk axis 2 (\u4ee3\u8868\u8005/\u5f79\u54e1/\u5bb6\u65cf\u4fdd\u8a3c). One of: required | not_required | negotiable | unknown.",
            "in": "query",
            "name": "personal_guarantor_required",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 20,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Risk axis 2 (\u4ee3\u8868\u8005/\u5f79\u54e1/\u5bb6\u65cf\u4fdd\u8a3c). One of: required | not_required | negotiable | unknown.",
              "title": "Personal Guarantor Required"
            }
          },
          {
            "description": "Risk axis 3 (\u7b2c\u4e09\u8005\u4fdd\u8a3c). One of: required | not_required | negotiable | unknown.",
            "in": "query",
            "name": "third_party_guarantor_required",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 20,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Risk axis 3 (\u7b2c\u4e09\u8005\u4fdd\u8a3c). One of: required | not_required | negotiable | unknown.",
              "title": "Third Party Guarantor Required"
            }
          },
          {
            "in": "query",
            "name": "min_amount_yen",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "minimum": 0,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Min Amount Yen"
            }
          },
          {
            "in": "query",
            "name": "max_amount_yen",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "minimum": 0,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Max Amount Yen"
            }
          },
          {
            "description": "Upper bound on interest_rate_base_annual (e.g. 0.015 for 1.5%).",
            "in": "query",
            "name": "max_interest_rate",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "minimum": 0.0,
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Upper bound on interest_rate_base_annual (e.g. 0.015 for 1.5%).",
              "title": "Max Interest Rate"
            }
          },
          {
            "in": "query",
            "name": "min_loan_period_years",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "minimum": 0,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Min Loan Period Years"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "limit": 20,
                  "offset": 0,
                  "results": [
                    {
                      "amount_max_yen": 72000000,
                      "collateral_required": "negotiable",
                      "confidence": 0.95,
                      "fetched_at": "2026-04-22T08:11:00Z",
                      "grace_period_years_max": 2,
                      "id": 12,
                      "interest_rate_base_annual": 1.5,
                      "interest_rate_special_annual": 0.95,
                      "loan_period_years_max": 20,
                      "loan_type": "\u56fd\u6c11\u751f\u6d3b\u4e8b\u696d",
                      "official_url": "https://www.jfc.go.jp/n/finance/search/02_kaigyou_m.html",
                      "personal_guarantor_required": "negotiable",
                      "program_name": "\u65b0\u898f\u958b\u696d\u8cc7\u91d1\uff08\u5973\u6027\u3001\u82e5\u8005/\u30b7\u30cb\u30a2\u8d77\u696d\u5bb6\u652f\u63f4\u95a2\u9023\uff09",
                      "provider": "\u65e5\u672c\u653f\u7b56\u91d1\u878d\u516c\u5eab",
                      "rate_names": "\u57fa\u6e96\u5229\u7387/\u7279\u5225\u5229\u7387A",
                      "security_notes": "\u4ee3\u8868\u8005\u4fdd\u8a3c\u306f\u5e0c\u671b\u306b\u5fdc\u3058\u3066. \u7b2c\u4e09\u8005\u4fdd\u8a3c\u4eba\u306f\u539f\u5247\u4e0d\u8981.",
                      "third_party_guarantor_required": "not_required"
                    }
                  ],
                  "total": 1
                },
                "schema": {
                  "$ref": "#/components/schemas/LoanProgramSearchResponse"
                }
              }
            },
            "description": "Three-axis loan search. Filter on collateral / personal_guarantor / third_party_guarantor independently \u2014 see migration 013 for the axis split."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Validation error \u2014 `code` \u2208 {invalid_enum, invalid_date_format, missing_required_arg, out_of_range, ambiguous_query}."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Authentication required \u2014 `code='auth_required'`. Send `X-API-Key`."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not found \u2014 `code` \u2208 {no_matching_records, seed_not_found, route_not_found}."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable entity \u2014 Pydantic validation failure (`code='invalid_enum'`)."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate limit \u2014 `code='rate_limit_exceeded'`. Honour `Retry-After`."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Internal error \u2014 `code` \u2208 {internal, internal_error, db_locked, db_unavailable}."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Subsystem unavailable \u2014 `code` \u2208 {subsystem_unavailable, service_unavailable, cap_reached}."
          }
        },
        "summary": "Search Loan Programs",
        "tags": [
          "loan-programs"
        ]
      }
    },
    "/v1/loan-programs/{loan_id}": {
      "get": {
        "operationId": "get_loan_program_v1_loan_programs__loan_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "loan_id",
            "required": true,
            "schema": {
              "title": "Loan Id",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoanProgram"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Validation error \u2014 `code` \u2208 {invalid_enum, invalid_date_format, missing_required_arg, out_of_range, ambiguous_query}."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Authentication required \u2014 `code='auth_required'`. Send `X-API-Key`."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "loan program not found \u2014 `error.code='no_matching_records'`."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable entity \u2014 Pydantic validation failure (`code='invalid_enum'`)."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate limit \u2014 `code='rate_limit_exceeded'`. Honour `Retry-After`."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Internal error \u2014 `code` \u2208 {internal, internal_error, db_locked, db_unavailable}."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Subsystem unavailable \u2014 `code` \u2208 {subsystem_unavailable, service_unavailable, cap_reached}."
          }
        },
        "summary": "Get Loan Program",
        "tags": [
          "loan-programs"
        ]
      }
    },
    "/v1/me": {
      "get": {
        "operationId": "get_me_v1_me_get",
        "parameters": [
          {
            "in": "cookie",
            "name": "am_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Am Session"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MeResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Me",
        "tags": [
          "me"
        ]
      }
    },
    "/v1/me/alerts/subscribe": {
      "post": {
        "description": "Create a new alert subscription on the calling key.\n\nAt least one delivery channel is required: webhook_url OR email. A\nsubscription with neither is meaningless (the cron has nowhere to send).\n\n`filter_value` is required for every filter_type EXCEPT 'all'. For 'all'\nit is silently ignored (we set NULL on disk for clarity).",
        "operationId": "create_subscription_v1_me_alerts_subscribe_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/jpintel_mcp__api__alerts__SubscribeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Subscription",
        "tags": [
          "alerts"
        ]
      }
    },
    "/v1/me/alerts/subscriptions": {
      "get": {
        "description": "List the calling key's active subscriptions.\n\nInactive (deactivated) rows are NOT returned by default \u2014 they are kept\non disk for audit but are noise on the read path. There is no\n`?include_inactive=true` flag in MVP; the customer who wants to inspect\nhistory can hit the DB directly via support.",
        "operationId": "list_subscriptions_v1_me_alerts_subscriptions_get",
        "parameters": [
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/SubscriptionResponse"
                  },
                  "title": "Response List Subscriptions V1 Me Alerts Subscriptions Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Subscriptions",
        "tags": [
          "alerts"
        ]
      }
    },
    "/v1/me/alerts/subscriptions/{sub_id}": {
      "delete": {
        "description": "Deactivate (soft-delete) the subscription.\n\nThe row stays on disk with active=0 so audit trails remain intact. A\nre-subscribe creates a fresh row rather than reviving the old one \u2014 this\nkeeps `created_at` semantically honest.\n\n404 when the id does not belong to this key OR when it is already\ninactive (so callers cannot probe the id-space of other keys).",
        "operationId": "deactivate_subscription_v1_me_alerts_subscriptions__sub_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "sub_id",
            "required": true,
            "schema": {
              "title": "Sub Id",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeactivateResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Deactivate Subscription",
        "tags": [
          "alerts"
        ]
      }
    },
    "/v1/me/billing-portal": {
      "post": {
        "operationId": "billing_portal_v1_me_billing_portal_post",
        "parameters": [
          {
            "in": "cookie",
            "name": "am_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Am Session"
            }
          },
          {
            "in": "cookie",
            "name": "am_csrf",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Am Csrf"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingPortalResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Billing Portal",
        "tags": [
          "me"
        ]
      }
    },
    "/v1/me/billing_history": {
      "get": {
        "description": "Most-recent Stripe invoices for the calling key's customer.\n\nUses a 5-minute in-process cache keyed by `customer_id`. Empty list when\nStripe is unconfigured or the customer has no invoices yet \u2014 this is not\nan error, just a cold-start state.",
        "operationId": "get_billing_history_v1_me_billing_history_get",
        "parameters": [
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingHistoryResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Billing History",
        "tags": [
          "dashboard"
        ]
      }
    },
    "/v1/me/cap": {
      "post": {
        "description": "Set the customer's self-serve monthly spend cap (P3-W).\n\nAuthenticated via require_key (X-API-Key header or Authorization: Bearer).\nAnonymous callers (no key) cannot set a cap because the anonymous tier is\nalready gated by the 50 req/\u6708 free quota \u2014 there is nothing to cap.\n\nThe unit price stays \u00a53/req (immutable per\nproject_autonomath_business_model). `monthly_cap_yen` is purely a client\nbudget control: at cap-reached the middleware returns 503 with\n`cap_reached: true` and Stripe usage is NOT recorded for the rejected\nrequest, so the cap is hard.",
        "operationId": "set_monthly_cap_v1_me_cap_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CapRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CapResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Set Monthly Cap",
        "tags": [
          "me"
        ]
      }
    },
    "/v1/me/dashboard": {
      "get": {
        "description": "30-day usage summary for the calling key.\n\nBearer-authenticated. The series is filled with zeros for days with no\nusage so the UI can render a contiguous bar chart without client-side\ngap-filling.",
        "operationId": "get_dashboard_v1_me_dashboard_get",
        "parameters": [
          {
            "in": "query",
            "name": "days",
            "required": false,
            "schema": {
              "default": 30,
              "maximum": 90,
              "minimum": 1,
              "title": "Days",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardSummary"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Dashboard",
        "tags": [
          "dashboard"
        ]
      }
    },
    "/v1/me/rotate-key": {
      "post": {
        "description": "Revoke the current key and issue a new one in a single atomic txn.\n\nP0 fixes from audit a4298e454aab2aa43:\n  - P0-1: BEGIN IMMEDIATE / COMMIT around the revoke + insert. Without\n    this the connection runs in autocommit (db.session.connect uses\n    isolation_level=None), so a crash between the UPDATE and the INSERT\n    leaves the customer with neither a working old key nor a new key.\n    BEGIN IMMEDIATE acquires the writer lock up-front, which also serves\n    as the lock for the concurrent-rotation race (only one writer at\n    a time; the loser gets SQLITE_BUSY and bubbles up as 5xx).\n  - P0-3: carry forward `monthly_cap_yen` so the customer's spend cap\n    is not silently reset to NULL (unlimited) on rotation. Also migrate\n    any `alert_subscriptions` rows from old key_hash to new \u2014 otherwise\n    the customer's amendment alerts go silent on rotation.\n  - Bonus: re-issue the session cookie bound to the NEW key_hash so the\n    dashboard stays logged in. With P0-2 in place, the OLD cookie now\n    401s on next /v1/me, so without this the user gets bounced to\n    /login the moment they rotate.",
        "operationId": "rotate_key_v1_me_rotate_key_post",
        "parameters": [
          {
            "in": "cookie",
            "name": "am_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Am Session"
            }
          },
          {
            "in": "cookie",
            "name": "am_csrf",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Am Csrf"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RotateKeyResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Rotate Key",
        "tags": [
          "me"
        ]
      }
    },
    "/v1/me/testimonials": {
      "post": {
        "operationId": "submit_testimonial_v1_me_testimonials_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TestimonialSubmit"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TestimonialSubmitResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Submit Testimonial",
        "tags": [
          "testimonials",
          "me"
        ]
      }
    },
    "/v1/me/testimonials/{testimonial_id}": {
      "delete": {
        "operationId": "delete_my_testimonial_v1_me_testimonials__testimonial_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "testimonial_id",
            "required": true,
            "schema": {
              "title": "Testimonial Id",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete My Testimonial",
        "tags": [
          "testimonials",
          "me"
        ]
      }
    },
    "/v1/me/tool_recommendation": {
      "get": {
        "description": "Map a free-text intent to ranked tool candidates.\n\nPure keyword scoring \u2014 no LLM call (memory: feedback_autonomath_no_api_use).\nThe caller is expected to be an LLM agent; we return signal, the caller\ncomposes the next request.",
        "operationId": "get_tool_recommendation_v1_me_tool_recommendation_get",
        "parameters": [
          {
            "in": "query",
            "name": "intent",
            "required": true,
            "schema": {
              "maxLength": 500,
              "minLength": 1,
              "title": "Intent",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 5,
              "maximum": 10,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolRecommendationResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Tool Recommendation",
        "tags": [
          "dashboard"
        ]
      }
    },
    "/v1/me/usage": {
      "get": {
        "operationId": "get_me_usage_v1_me_usage_get",
        "parameters": [
          {
            "in": "query",
            "name": "days",
            "required": false,
            "schema": {
              "default": 30,
              "title": "Days",
              "type": "integer"
            }
          },
          {
            "in": "cookie",
            "name": "am_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Am Session"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/jpintel_mcp__api__dashboard__UsageDay"
                  },
                  "title": "Response Get Me Usage V1 Me Usage Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Me Usage",
        "tags": [
          "me"
        ]
      }
    },
    "/v1/me/usage_by_tool": {
      "get": {
        "description": "Top N endpoints by call count over the requested window.",
        "operationId": "get_usage_by_tool_v1_me_usage_by_tool_get",
        "parameters": [
          {
            "in": "query",
            "name": "days",
            "required": false,
            "schema": {
              "default": 30,
              "maximum": 90,
              "minimum": 1,
              "title": "Days",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 10,
              "maximum": 50,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolUsageResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Usage By Tool",
        "tags": [
          "dashboard"
        ]
      }
    },
    "/v1/meta": {
      "get": {
        "operationId": "get_meta_v1_meta_get",
        "parameters": [
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Meta"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Meta",
        "tags": [
          "meta"
        ]
      }
    },
    "/v1/meta/freshness": {
      "get": {
        "operationId": "meta_freshness_v1_meta_freshness_get",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 500,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "sort_by",
            "required": false,
            "schema": {
              "default": "fetched_at_desc",
              "pattern": "^(fetched_at_desc|fetched_at_asc|tier)$",
              "title": "Sort By",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tier",
            "required": false,
            "schema": {
              "default": "all",
              "pattern": "^(all|S|A|B|C)$",
              "title": "Tier",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MetaFreshnessResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Meta Freshness",
        "tags": [
          "meta",
          "transparency"
        ]
      }
    },
    "/v1/ping": {
      "get": {
        "operationId": "ping_v1_ping_get",
        "parameters": [
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PingResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Ping",
        "tags": [
          "meta"
        ]
      }
    },
    "/v1/privacy/deletion_request": {
      "post": {
        "description": "\u500b\u4eba\u60c5\u5831\u306e\u4fdd\u8b77\u306b\u95a2\u3059\u308b\u6cd5\u5f8b \u7b2c33\u6761 \u306b\u57fa\u3065\u304f\u524a\u9664\u8acb\u6c42\u3092\u53d7\u4ed8\u3051\u307e\u3059\u3002 \u3053\u306e\u30a8\u30f3\u30c9\u30dd\u30a4\u30f3\u30c8\u306f\u53d7\u4ed8\u756a\u53f7\u306e\u767a\u884c\u3068\u904b\u55b6\u5b9b\u901a\u77e5\u306e\u307f\u3092\u884c\u3044\u3001 \u5b9f\u969b\u306e\u524a\u9664\u306f 30 \u65e5\u4ee5\u5185\u306b\u904b\u55b6\u5074\u3067\u672c\u4eba\u78ba\u8a8d\u306e\u4e0a\u3067\u5225\u9014\u5bfe\u5fdc\u3057\u307e\u3059 (\u00a733-3 \u6cd5\u5b9a\u4e0a\u9650)\u3002 \u500b\u4eba\u60c5\u5831\u305d\u306e\u3082\u306e\u306f\u3053\u306e\u30ec\u30b9\u30dd\u30f3\u30b9\u3067\u306f\u8fd4\u5374\u30fb \u64cd\u4f5c\u3057\u307e\u305b\u3093\u3002",
        "operationId": "submit_deletion_request_v1_privacy_deletion_request_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeletionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletionResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "APPI \u00a733 \u500b\u4eba\u60c5\u5831\u524a\u9664\u8acb\u6c42\u306e\u53d7\u4ed8",
        "tags": [
          "privacy"
        ]
      }
    },
    "/v1/privacy/disclosure_request": {
      "post": {
        "description": "\u500b\u4eba\u60c5\u5831\u306e\u4fdd\u8b77\u306b\u95a2\u3059\u308b\u6cd5\u5f8b \u7b2c31\u6761 \u306b\u57fa\u3065\u304f\u958b\u793a\u8acb\u6c42\u3092\u53d7\u4ed8\u3051\u307e\u3059\u3002 \u3053\u306e\u30a8\u30f3\u30c9\u30dd\u30a4\u30f3\u30c8\u306f\u53d7\u4ed8\u756a\u53f7\u306e\u767a\u884c\u3068\u904b\u55b6\u5b9b\u901a\u77e5\u306e\u307f\u3092\u884c\u3044\u3001 \u5b9f\u969b\u306e\u958b\u793a\u306f 14 \u65e5\u4ee5\u5185\u306b\u904b\u55b6\u5074\u3067\u672c\u4eba\u78ba\u8a8d\u306e\u4e0a\u3067\u5225\u9014\u5bfe\u5fdc\u3057\u307e\u3059\u3002 \u500b\u4eba\u60c5\u5831\u305d\u306e\u3082\u306e\u306f\u3053\u306e\u30ec\u30b9\u30dd\u30f3\u30b9\u3067\u306f\u8fd4\u5374\u3057\u307e\u305b\u3093\u3002",
        "operationId": "submit_disclosure_request_v1_privacy_disclosure_request_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DisclosureRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DisclosureResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "APPI \u00a731 \u500b\u4eba\u60c5\u5831\u958b\u793a\u8acb\u6c42\u306e\u53d7\u4ed8",
        "tags": [
          "privacy"
        ]
      }
    },
    "/v1/programs/batch": {
      "post": {
        "description": "Resolve up to 50 unified_ids in a single round-trip.\n\nShape parity with GET /v1/programs/{unified_id} (same ProgramDetail per\nresult), so SDK callers can chunk(ids, 50) and stitch locally without\nper-id round trips. The 50-cap IS the pagination; do not add a paging\nenvelope.\n\nOrder contract: `results[i]` corresponds to the i-th element of the\n*deduped* input list (first occurrence wins). Missing ids go to\n`not_found`, NOT a 404 \u2014 partial success is the whole point.\n\n# Quota accounting \u2014 TODO(W2):\n# Batch counts as 1 \"get_program\" unit against the per-key daily quota\n# today (log_usage inserts a single usage_events row). Spec calls for\n# N units per N-id batch. The existing accounting model is \"one row\n# per request\" (see api/deps._enforce_quota + usage_events schema). A\n# credits / weight column is a separate ticket \u2014 out of scope here.\n# When credits lands, swap the single log_usage call below for an\n# N-weighted accounting path.",
        "operationId": "batch_get_programs_v1_programs_batch_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BatchGetProgramsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchGetProgramsResponse"
                }
              }
            },
            "description": "Batch ProgramDetail lookup. `results[]` is ordered by the deduped input `unified_ids`. Ids not found in the DB go to `not_found` \u2014 this is NOT a 404, because partial success is the point of batch."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Validation error \u2014 `code` \u2208 {invalid_enum, invalid_date_format, missing_required_arg, out_of_range, ambiguous_query}."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Authentication required \u2014 `code='auth_required'`. Send `X-API-Key`."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not found \u2014 `code` \u2208 {no_matching_records, seed_not_found, route_not_found}."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "input validation failed (empty list, >50 ids, bad shape). `error.code='invalid_enum'`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate limit \u2014 `code='rate_limit_exceeded'`. Honour `Retry-After`."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Internal error \u2014 `code` \u2208 {internal, internal_error, db_locked, db_unavailable}."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Subsystem unavailable \u2014 `code` \u2208 {subsystem_unavailable, service_unavailable, cap_reached}."
          }
        },
        "summary": "Batch Get Programs",
        "tags": [
          "programs"
        ]
      }
    },
    "/v1/programs/prescreen": {
      "post": {
        "description": "Rank programs by fit to a caller business profile.\n\nThis is the \"judgment\" complement to `/v1/programs/search`'s \"discovery\".\nSee `src/jpintel_mcp/api/prescreen.py` module docstring for scope.",
        "operationId": "prescreen_programs_v1_programs_prescreen_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PrescreenRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrescreenResponse"
                }
              }
            },
            "description": "Ranked prescreen matches with reasons + caveats."
          },
          "400": {
            "description": "Malformed profile."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Prescreen Programs",
        "tags": [
          "programs"
        ]
      }
    },
    "/v1/programs/search": {
      "get": {
        "operationId": "search_programs_v1_programs_search_get",
        "parameters": [
          {
            "description": "free-text search across name/aliases/enriched",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 200,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "free-text search across name/aliases/enriched",
              "title": "Q"
            }
          },
          {
            "description": "filter tier, repeat for OR",
            "in": "query",
            "name": "tier",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "items": {
                    "enum": [
                      "S",
                      "A",
                      "B",
                      "C",
                      "X"
                    ],
                    "type": "string"
                  },
                  "type": "array"
                },
                {
                  "type": "null"
                }
              ],
              "description": "filter tier, repeat for OR",
              "title": "Tier"
            }
          },
          {
            "description": "Prefecture name. Canonical = full-suffix kanji ('\u6771\u4eac\u90fd'). Also accepts short ('\u6771\u4eac') and romaji ('Tokyo'/'tokyo'); normalized server-side. Use '\u5168\u56fd' (or 'national'/'all') for nationwide programs.",
            "in": "query",
            "name": "prefecture",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 20,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Prefecture name. Canonical = full-suffix kanji ('\u6771\u4eac\u90fd'). Also accepts short ('\u6771\u4eac') and romaji ('Tokyo'/'tokyo'); normalized server-side. Use '\u5168\u56fd' (or 'national'/'all') for nationwide programs.",
              "title": "Prefecture"
            }
          },
          {
            "description": "Authority level. Canonical (English): `national` / `prefecture` / `municipality` / `financial`. Also accepts Japanese: `\u56fd` / `\u90fd\u9053\u5e9c\u770c` / `\u5e02\u533a\u753a\u6751` (normalized server-side).",
            "in": "query",
            "name": "authority_level",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 20,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Authority level. Canonical (English): `national` / `prefecture` / `municipality` / `financial`. Also accepts Japanese: `\u56fd` / `\u90fd\u9053\u5e9c\u770c` / `\u5e02\u533a\u753a\u6751` (normalized server-side).",
              "title": "Authority Level"
            }
          },
          {
            "in": "query",
            "name": "funding_purpose",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 64,
                  "type": "array"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Funding Purpose"
            }
          },
          {
            "in": "query",
            "name": "target_type",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 64,
                  "type": "array"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Target Type"
            }
          },
          {
            "in": "query",
            "name": "amount_min",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "minimum": 0,
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Amount Min"
            }
          },
          {
            "in": "query",
            "name": "amount_max",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "minimum": 0,
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Amount Max"
            }
          },
          {
            "in": "query",
            "name": "include_excluded",
            "required": false,
            "schema": {
              "default": false,
              "title": "Include Excluded",
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "description": "Payload size knob. minimal = 7-key whitelist (~300 B/row). default = full Program shape (current behavior). full = Program + enriched + source_mentions + lineage.",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "default": "default",
              "description": "Payload size knob. minimal = 7-key whitelist (~300 B/row). default = full Program shape (current behavior). full = Program + enriched + source_mentions + lineage.",
              "enum": [
                "minimal",
                "default",
                "full"
              ],
              "title": "Fields",
              "type": "string"
            }
          },
          {
            "description": "When true, attach up to 3 matching \u58eb\u696d/\u8a8d\u5b9a\u652f\u63f4\u6a5f\u95a2 advisors under `matched_advisors` on the response envelope. Additive \u2014 the `results[]` shape is unchanged for callers that leave this false (default). Match ranks on prefecture + target_type.",
            "in": "query",
            "name": "include_advisors",
            "required": false,
            "schema": {
              "default": false,
              "description": "When true, attach up to 3 matching \u58eb\u696d/\u8a8d\u5b9a\u652f\u63f4\u6a5f\u95a2 advisors under `matched_advisors` on the response envelope. Additive \u2014 the `results[]` shape is unchanged for callers that leave this false (default). Match ranks on prefecture + target_type.",
              "title": "Include Advisors",
              "type": "boolean"
            }
          },
          {
            "description": "R8 dataset versioning \u2014 pin the result set to the dataset state at YYYY-MM-DD (ISO-8601 date). Predicate: `valid_from <= as_of_date AND (valid_until IS NULL OR valid_until > as_of_date)`. Omit / null = live (today). Used by tax accountants / \u884c\u653f\u66f8\u58eb to fix \u7533\u544a\u6642\u70b9\u306e\u5236\u5ea6\u72b6\u614b for audit. Returns 422 on malformed date.",
            "in": "query",
            "name": "as_of_date",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 10,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "R8 dataset versioning \u2014 pin the result set to the dataset state at YYYY-MM-DD (ISO-8601 date). Predicate: `valid_from <= as_of_date AND (valid_until IS NULL OR valid_until > as_of_date)`. Omit / null = live (today). Used by tax accountants / \u884c\u653f\u66f8\u58eb to fix \u7533\u544a\u6642\u70b9\u306e\u5236\u5ea6\u72b6\u614b for audit. Returns 422 on malformed date.",
              "title": "As Of Date"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "limit": 20,
                  "offset": 0,
                  "results": [
                    {
                      "amount_max_man_yen": 450,
                      "authority_level": "national",
                      "authority_name": "\u7d4c\u6e08\u7523\u696d\u7701",
                      "funding_purpose": [
                        "DX",
                        "\u30c7\u30b8\u30bf\u30eb\u5316"
                      ],
                      "next_deadline": "2026-06-30",
                      "official_url": "https://www.it-hojo.jp/",
                      "prefecture": "\u5168\u56fd",
                      "primary_name": "IT\u5c0e\u5165\u88dc\u52a9\u91d12026",
                      "program_kind": "\u88dc\u52a9\u91d1",
                      "source_fetched_at": "2026-04-20T05:14:33Z",
                      "source_url": "https://www.it-hojo.jp/",
                      "subsidy_rate": "1/2 \u301c 3/4",
                      "target_types": [
                        "sme",
                        "sole_proprietor"
                      ],
                      "tier": "S",
                      "unified_id": "UNI-meti-it-2026"
                    }
                  ],
                  "total": 1
                },
                "schema": {
                  "$ref": "#/components/schemas/jpintel_mcp__models__SearchResponse"
                }
              }
            },
            "description": "SearchResponse. `results[]` shape depends on `fields`: minimal = 7-key whitelist, default = Program, full = ProgramDetail."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Validation error \u2014 `code` \u2208 {invalid_enum, invalid_date_format, missing_required_arg, out_of_range, ambiguous_query}."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Authentication required \u2014 `code='auth_required'`. Send `X-API-Key`."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not found \u2014 `code` \u2208 {no_matching_records, seed_not_found, route_not_found}."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable entity \u2014 Pydantic validation failure (`code='invalid_enum'`)."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate limit \u2014 `code='rate_limit_exceeded'`. Honour `Retry-After`."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Internal error \u2014 `code` \u2208 {internal, internal_error, db_locked, db_unavailable}."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Subsystem unavailable \u2014 `code` \u2208 {subsystem_unavailable, service_unavailable, cap_reached}."
          }
        },
        "summary": "Search Programs",
        "tags": [
          "programs"
        ]
      }
    },
    "/v1/programs/{unified_id}": {
      "get": {
        "operationId": "get_program_v1_programs__unified_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "unified_id",
            "required": true,
            "schema": {
              "title": "Unified Id",
              "type": "string"
            }
          },
          {
            "description": "Payload size knob. minimal = 7-key whitelist. default = Program + enriched + source_mentions + lineage (current behavior \u2014 this endpoint has always returned ProgramDetail, so default == full in shape; the two values differ only in the guarantee that full's enriched/source_mentions keys are present even when null).",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "default": "default",
              "description": "Payload size knob. minimal = 7-key whitelist. default = Program + enriched + source_mentions + lineage (current behavior \u2014 this endpoint has always returned ProgramDetail, so default == full in shape; the two values differ only in the guarantee that full's enriched/source_mentions keys are present even when null).",
              "enum": [
                "minimal",
                "default",
                "full"
              ],
              "title": "Fields",
              "type": "string"
            }
          },
          {
            "description": "R8 dataset versioning \u2014 pin lookup to dataset state at YYYY-MM-DD (ISO-8601). When set, the row is filtered with `valid_from <= as_of_date AND (valid_until IS NULL OR valid_until > as_of_date)`. Omit / null = live (today).",
            "in": "query",
            "name": "as_of_date",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 10,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "R8 dataset versioning \u2014 pin lookup to dataset state at YYYY-MM-DD (ISO-8601). When set, the row is filtered with `valid_from <= as_of_date AND (valid_until IS NULL OR valid_until > as_of_date)`. Omit / null = live (today).",
              "title": "As Of Date"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "amount_max_man_yen": 200,
                  "authority_level": "national",
                  "authority_name": "\u5168\u56fd\u5546\u5de5\u4f1a\u9023\u5408\u4f1a",
                  "funding_purpose": [
                    "\u8ca9\u8def\u958b\u62d3",
                    "\u696d\u52d9\u52b9\u7387\u5316"
                  ],
                  "next_deadline": "2026-06-12",
                  "official_url": "https://r3.jizokukahojokin.info/",
                  "prefecture": "\u5168\u56fd",
                  "primary_name": "\u5c0f\u898f\u6a21\u4e8b\u696d\u8005\u6301\u7d9a\u5316\u88dc\u52a9\u91d1",
                  "program_kind": "\u88dc\u52a9\u91d1",
                  "required_documents": [
                    "\u4e8b\u696d\u8a08\u753b\u66f8",
                    "\u7d4c\u8cbb\u660e\u7d30\u66f8"
                  ],
                  "source_checksum": "sha256:abc123",
                  "source_fetched_at": "2026-04-20T05:14:33Z",
                  "source_mentions": {},
                  "source_url": "https://r3.jizokukahojokin.info/",
                  "subsidy_rate": "2/3",
                  "target_types": [
                    "sole_proprietor",
                    "sme"
                  ],
                  "tier": "S",
                  "unified_id": "UNI-meti-jizokuka-2026"
                },
                "schema": {
                  "$ref": "#/components/schemas/ProgramDetail"
                }
              }
            },
            "description": "ProgramDetail. Shape depends on `fields`: minimal = 7-key whitelist, default = Program shape, full = Program + enriched + source_mentions + lineage (keys always present, may be null)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Validation error \u2014 `code` \u2208 {invalid_enum, invalid_date_format, missing_required_arg, out_of_range, ambiguous_query}."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Authentication required \u2014 `code='auth_required'`. Send `X-API-Key`."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "program not found \u2014 `error.code='no_matching_records'`."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable entity \u2014 Pydantic validation failure (`code='invalid_enum'`)."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate limit \u2014 `code='rate_limit_exceeded'`. Honour `Retry-After`."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Internal error \u2014 `code` \u2208 {internal, internal_error, db_locked, db_unavailable}."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Subsystem unavailable \u2014 `code` \u2208 {subsystem_unavailable, service_unavailable, cap_reached}."
          }
        },
        "summary": "Get Program",
        "tags": [
          "programs"
        ]
      }
    },
    "/v1/session": {
      "post": {
        "operationId": "create_session_v1_session_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SessionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Session",
        "tags": [
          "me"
        ]
      }
    },
    "/v1/session/logout": {
      "post": {
        "operationId": "logout_v1_session_logout_post",
        "parameters": [
          {
            "in": "cookie",
            "name": "am_csrf",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Am Csrf"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Logout",
        "tags": [
          "me"
        ]
      }
    },
    "/v1/stats/confidence": {
      "get": {
        "description": "Live Bayesian Discovery + Use posteriors per tool, last 30 days.",
        "operationId": "stats_confidence_v1_stats_confidence_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfidenceResponse"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Stats Confidence",
        "tags": [
          "stats",
          "transparency"
        ]
      }
    },
    "/v1/stats/coverage": {
      "get": {
        "operationId": "stats_coverage_v1_stats_coverage_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoverageResponse"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Stats Coverage",
        "tags": [
          "stats",
          "transparency"
        ]
      }
    },
    "/v1/stats/data_quality": {
      "get": {
        "operationId": "stats_data_quality_v1_stats_data_quality_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataQualityResponse"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Stats Data Quality",
        "tags": [
          "stats",
          "transparency"
        ]
      }
    },
    "/v1/stats/freshness": {
      "get": {
        "operationId": "stats_freshness_v1_stats_freshness_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreshnessResponse"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Stats Freshness",
        "tags": [
          "stats",
          "transparency"
        ]
      }
    },
    "/v1/stats/usage": {
      "get": {
        "operationId": "stats_usage_v1_stats_usage_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageResponse"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Stats Usage",
        "tags": [
          "stats",
          "transparency"
        ]
      }
    },
    "/v1/subscribers": {
      "post": {
        "operationId": "subscribe_v1_subscribers_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/jpintel_mcp__api__subscribers__SubscribeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/jpintel_mcp__api__subscribers__SubscribeResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Subscribe",
        "tags": [
          "subscribers"
        ]
      }
    },
    "/v1/subscribers/unsubscribe": {
      "get": {
        "operationId": "unsubscribe_v1_subscribers_unsubscribe_get",
        "parameters": [
          {
            "in": "query",
            "name": "token",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 16,
              "title": "Token",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "email",
            "required": true,
            "schema": {
              "maxLength": 320,
              "minLength": 3,
              "title": "Email",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Unsubscribe",
        "tags": [
          "subscribers"
        ]
      }
    },
    "/v1/tax_rulesets/evaluate": {
      "post": {
        "description": "Evaluate one or more rulesets against a caller business_profile.\n\nWalks `eligibility_conditions_json` for each selected row and returns\nper-ruleset `applicable` + matched / unmatched predicate lists. Never\ninterprets tax law \u2014 pure JSON predicate matching.\n\ntarget_ruleset_ids omitted -> evaluates all CURRENT rulesets\n(effective_until IS NULL OR effective_until >= today). Use /search with\neffective_on + explicit ids list to evaluate historical snapshots.",
        "operationId": "evaluate_tax_rulesets_v1_tax_rulesets_evaluate_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EvaluateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvaluateResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Evaluate Tax Rulesets",
        "tags": [
          "tax_rulesets"
        ]
      }
    },
    "/v1/tax_rulesets/search": {
      "get": {
        "description": "Search \u7a0e\u52d9\u5224\u5b9a\u30eb\u30fc\u30eb\u30bb\u30c3\u30c8 (tax_rulesets).",
        "operationId": "search_tax_rulesets_v1_tax_rulesets_search_get",
        "parameters": [
          {
            "description": "Free-text search across ruleset_name + eligibility_conditions + calculation_formula (FTS5 with quoted-phrase workaround for 2+ character kanji compounds). Terms shorter than 3 characters fall through to LIKE to dodge trigram zero-match.",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 200,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Free-text search across ruleset_name + eligibility_conditions + calculation_formula (FTS5 with quoted-phrase workaround for 2+ character kanji compounds). Terms shorter than 3 characters fall through to LIKE to dodge trigram zero-match.",
              "title": "Q"
            }
          },
          {
            "description": "Filter by tax_category. One of: consumption | corporate | income | property | local | inheritance.",
            "in": "query",
            "name": "tax_category",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 20,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by tax_category. One of: consumption | corporate | income | property | local | inheritance.",
              "title": "Tax Category"
            }
          },
          {
            "description": "Filter by ruleset_kind. One of: registration | credit | deduction | special_depreciation | exemption | preservation | other.",
            "in": "query",
            "name": "ruleset_kind",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 30,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by ruleset_kind. One of: registration | credit | deduction | special_depreciation | exemption | preservation | other.",
              "title": "Ruleset Kind"
            }
          },
          {
            "description": "ISO 8601 date (YYYY-MM-DD). Returns only rulesets whose effective_from <= date AND (effective_until IS NULL OR effective_until >= date). Use this to ask 'which rules applied on date X?' \u2014 critical around cliff dates (2026-09-30 / 2027-09-30 / 2029-09-30).",
            "in": "query",
            "name": "effective_on",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 10,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "ISO 8601 date (YYYY-MM-DD). Returns only rulesets whose effective_from <= date AND (effective_until IS NULL OR effective_until >= date). Use this to ask 'which rules applied on date X?' \u2014 critical around cliff dates (2026-09-30 / 2027-09-30 / 2029-09-30).",
              "title": "Effective On"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaxRulesetSearchResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Search Tax Rulesets",
        "tags": [
          "tax_rulesets"
        ]
      }
    },
    "/v1/tax_rulesets/{unified_id}": {
      "get": {
        "description": "Return a single \u7a0e\u52d9\u5224\u5b9a\u30eb\u30fc\u30eb\u30bb\u30c3\u30c8 by TAX-<10hex> id.",
        "operationId": "get_tax_ruleset_v1_tax_rulesets__unified_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "unified_id",
            "required": true,
            "schema": {
              "title": "Unified Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaxRulesetOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Tax Ruleset",
        "tags": [
          "tax_rulesets"
        ]
      }
    },
    "/v1/testimonials": {
      "get": {
        "operationId": "list_testimonials_v1_testimonials_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TestimonialListResponse"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List Testimonials",
        "tags": [
          "testimonials"
        ]
      }
    },
    "/v1/usage": {
      "get": {
        "description": "Probe the caller's current quota state without consuming a slot.\n\nThe handler is *not* attached to ``AnonIpLimitDep`` so anonymous\ncallers can call it freely \u2014 the whole point of the tool is to\navoid burning the bucket while checking it.",
        "operationId": "get_usage_v1_usage_get",
        "parameters": [
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageStatus"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Usage",
        "tags": [
          "usage"
        ]
      }
    },
    "/v1/widget/enum_values": {
      "get": {
        "description": "Return filter enum vocab for widget dropdowns \u2014 prefectures, industries,\nauthority_levels, and a short target_types list drawn from programs.",
        "operationId": "widget_enum_values_v1_widget_enum_values_get",
        "parameters": [
          {
            "in": "query",
            "name": "key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 64,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Key"
            }
          },
          {
            "in": "header",
            "name": "X-Widget-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Widget-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Widget Enum Values",
        "tags": [
          "widget"
        ]
      }
    },
    "/v1/widget/search": {
      "get": {
        "description": "Search programs restricted to the widget surface.\n\nProxies to the existing `/v1/programs/search` logic via direct function\nimport \u2014 there is no internal HTTP hop so the widget path stays under\nthe tight latency budget (TTFB matters on a 3rd-party's site).",
        "operationId": "widget_search_v1_widget_search_get",
        "parameters": [
          {
            "description": "widget key; wgt_live_...",
            "in": "query",
            "name": "key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 64,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "widget key; wgt_live_...",
              "title": "Key"
            }
          },
          {
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 200,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Q"
            }
          },
          {
            "in": "query",
            "name": "prefecture",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 20,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Prefecture"
            }
          },
          {
            "in": "query",
            "name": "authority_level",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 20,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authority Level"
            }
          },
          {
            "in": "query",
            "name": "industry",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 20,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Industry"
            }
          },
          {
            "in": "query",
            "name": "target",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 64,
                  "type": "array"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Target"
            }
          },
          {
            "in": "query",
            "name": "funding_purpose",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 64,
                  "type": "array"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Funding Purpose"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 5,
              "maximum": 20,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-Widget-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Widget-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Widget Search",
        "tags": [
          "widget"
        ]
      }
    },
    "/v1/widget/signup": {
      "post": {
        "description": "Create a Stripe Checkout session for the widget plan.\n\nThe actual `widget_keys` row is provisioned later, in the\n`checkout.session.completed` webhook handler. The Checkout session\ncarries `metadata.autonomath_product = 'widget'` so our webhook\nknows to look up widget-specific price ids and persist to widget_keys\n(not api_keys).",
        "operationId": "widget_signup_v1_widget_signup_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WidgetSignupRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSignupResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Widget Signup",
        "tags": [
          "widget"
        ]
      }
    },
    "/v1/widget/stripe-webhook": {
      "post": {
        "description": "Handle widget-product Stripe events.\n\nKey lifecycle events:\n  checkout.session.completed        -> provision widget_keys row\n  customer.subscription.deleted     -> disabled_at = now()\n  invoice.payment_failed            -> disabled_at = now() (widget is\n    not dunning-tolerant like the main API \u2014 a widget on a public\n    site stays disabled through dunning rather than billing overage\n    nobody will ever pay for).",
        "operationId": "widget_stripe_webhook_v1_widget_stripe_webhook_post",
        "parameters": [
          {
            "in": "header",
            "name": "stripe-signature",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Stripe-Signature"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "title": "Response Widget Stripe Webhook V1 Widget Stripe Webhook Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Widget Stripe Webhook",
        "tags": [
          "widget"
        ]
      }
    },
    "/v1/widget/{key_id}/usage": {
      "get": {
        "description": "Owner-visible usage for their widget key. Bearer admin required.\n\nSparse on purpose: the dashboard consumes this via a scheduled fetch\nso we return stable, JSON-first fields. A full dashboard UI is a\nlater ticket \u2014 this stub is enough for \"how many reqs this month?\".",
        "operationId": "widget_usage_v1_widget__key_id__usage_get",
        "parameters": [
          {
            "in": "path",
            "name": "key_id",
            "required": true,
            "schema": {
              "title": "Key Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Widget Usage",
        "tags": [
          "widget"
        ]
      }
    }
  },
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "servers": [
    {
      "description": "Production",
      "url": "https://api.autonomath.ai"
    },
    {
      "description": "Local development",
      "url": "http://localhost:8080"
    }
  ]
}
