{
  "components": {
    "schemas": {
      "Problem": {
        "description": "A refused or failed call (RFC 9457 problem details).",
        "properties": {
          "code": {
            "enum": [
              "invalid_request",
              "unauthorized",
              "forbidden",
              "not_found",
              "idempotency_key_reused",
              "request_in_progress",
              "limit_reached",
              "out_of_credits",
              "at_capacity",
              "internal",
              "unavailable",
              "timed_out"
            ],
            "title": "Code",
            "type": "string"
          },
          "detail": {
            "description": "What happened and what to change.",
            "title": "Detail",
            "type": "string"
          },
          "field": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "The field to change.",
            "title": "Field"
          },
          "meta": {
            "description": "What every reply says about the call itself.",
            "properties": {
              "cost_usd": {
                "description": "What the request was charged, in US dollars; 0.00 when it was not charged.",
                "title": "Cost Usd",
                "type": "string"
              },
              "limit": {
                "anyOf": [
                  {
                    "description": "What is left of one allowance.",
                    "properties": {
                      "limit": {
                        "description": "Calls the allowance holds.",
                        "title": "Limit",
                        "type": "integer"
                      },
                      "remaining": {
                        "description": "Calls left in it.",
                        "title": "Remaining",
                        "type": "integer"
                      },
                      "resets_in_seconds": {
                        "description": "Seconds until it starts again.",
                        "title": "Resets In Seconds",
                        "type": "integer"
                      }
                    },
                    "required": [
                      "limit",
                      "remaining",
                      "resets_in_seconds"
                    ],
                    "title": "LimitLeft",
                    "type": "object"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The caller's per-minute calls left."
              },
              "narrow": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "How to get the rest, when truncated.",
                "title": "Narrow"
              },
              "replayed": {
                "default": false,
                "description": "True when this is the stored reply to an earlier request with the same Idempotency-Key, not charged again.",
                "title": "Replayed",
                "type": "boolean"
              },
              "request_id": {
                "description": "Names the request to MAIA; quote it in a feedback report.",
                "title": "Request Id",
                "type": "string"
              },
              "truncated": {
                "default": false,
                "description": "True when the reply holds less than matched.",
                "title": "Truncated",
                "type": "boolean"
              }
            },
            "required": [
              "request_id",
              "cost_usd"
            ],
            "title": "CallMeta",
            "type": "object"
          },
          "request_id": {
            "title": "Request Id",
            "type": "string"
          },
          "retry_after": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Seconds to wait before sending it again.",
            "title": "Retry After"
          },
          "status": {
            "description": "The HTTP status.",
            "title": "Status",
            "type": "integer"
          },
          "title": {
            "description": "The code in words.",
            "title": "Title",
            "type": "string"
          },
          "type": {
            "description": "tag:maia-analytics.com,2026:error: and the code (RFC 4151).",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "type",
          "title",
          "status",
          "detail",
          "code",
          "request_id",
          "meta"
        ],
        "title": "Problem",
        "type": "object"
      }
    },
    "securitySchemes": {
      "key": {
        "description": "A MAIA API key, `maia_sk_…`.",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "externalDocs": {
    "url": "https://maia-analytics.com/docs/api/reference"
  },
  "info": {
    "description": "Search MAIA's index of public records about places. Covers San Francisco County, CA for now. The guide is at https://maia-analytics.com/docs/api/reference.",
    "title": "MAIA API",
    "version": "v1"
  },
  "openapi": "3.1.0",
  "paths": {
    "/feedback": {
      "post": {
        "description": "The MAIA team reads the report with the key's name and workspace. The\nteam does not reply through the API.",
        "operationId": "feedback",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "impact": {
                    "anyOf": [
                      {
                        "enum": [
                          "blocked",
                          "worked_around",
                          "minor"
                        ],
                        "title": "FeedbackImpact",
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "kind": {
                    "enum": [
                      "wrong_result",
                      "error",
                      "missing_capability",
                      "feature_request",
                      "confusing",
                      "slow",
                      "praise",
                      "other"
                    ],
                    "title": "FeedbackKind",
                    "type": "string"
                  },
                  "message": {
                    "description": "What was expected and what happened. Name the call by its reply's meta.request_id. Leave out personal information.",
                    "maxLength": 2000,
                    "minLength": 1,
                    "title": "Message",
                    "type": "string"
                  },
                  "user_asked": {
                    "default": false,
                    "description": "True when a person asked for this report to be sent.",
                    "title": "User Asked",
                    "type": "boolean"
                  }
                },
                "required": [
                  "kind",
                  "message"
                ],
                "title": "FeedbackRequest",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "meta": {
                      "anyOf": [
                        {
                          "description": "What every reply says about the call itself.",
                          "properties": {
                            "cost_usd": {
                              "description": "What the request was charged, in US dollars; 0.00 when it was not charged.",
                              "title": "Cost Usd",
                              "type": "string"
                            },
                            "limit": {
                              "anyOf": [
                                {
                                  "description": "What is left of one allowance.",
                                  "properties": {
                                    "limit": {
                                      "description": "Calls the allowance holds.",
                                      "title": "Limit",
                                      "type": "integer"
                                    },
                                    "remaining": {
                                      "description": "Calls left in it.",
                                      "title": "Remaining",
                                      "type": "integer"
                                    },
                                    "resets_in_seconds": {
                                      "description": "Seconds until it starts again.",
                                      "title": "Resets In Seconds",
                                      "type": "integer"
                                    }
                                  },
                                  "required": [
                                    "limit",
                                    "remaining",
                                    "resets_in_seconds"
                                  ],
                                  "title": "LimitLeft",
                                  "type": "object"
                                },
                                {
                                  "type": "null"
                                }
                              ],
                              "default": null,
                              "description": "The caller's per-minute calls left."
                            },
                            "narrow": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ],
                              "default": null,
                              "description": "How to get the rest, when truncated.",
                              "title": "Narrow"
                            },
                            "replayed": {
                              "default": false,
                              "description": "True when this is the stored reply to an earlier request with the same Idempotency-Key, not charged again.",
                              "title": "Replayed",
                              "type": "boolean"
                            },
                            "request_id": {
                              "description": "Names the request to MAIA; quote it in a feedback report.",
                              "title": "Request Id",
                              "type": "string"
                            },
                            "truncated": {
                              "default": false,
                              "description": "True when the reply holds less than matched.",
                              "title": "Truncated",
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "request_id",
                            "cost_usd"
                          ],
                          "title": "CallMeta",
                          "type": "object"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null
                    },
                    "note": {
                      "title": "Note",
                      "type": "string"
                    }
                  },
                  "required": [
                    "meta",
                    "note"
                  ],
                  "title": "FeedbackReceived",
                  "type": "object"
                }
              }
            },
            "description": "The reply, with the call's `meta`."
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request can't be run as sent (`invalid_request`)."
          },
          "401": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "No valid MAIA key (`unauthorized`)."
          },
          "402": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The workspace has no credits left (`out_of_credits`)."
          },
          "403": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "This call isn't open to the caller (`forbidden`)."
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "MAIA has nothing by that name (`not_found`)."
          },
          "409": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "A call with this Idempotency-Key is still running (`request_in_progress`)."
          },
          "422": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The Idempotency-Key was used for another request (`idempotency_key_reused`)."
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Too many calls (`limit_reached`)."
          },
          "500": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "MAIA failed (`internal`)."
          },
          "503": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "MAIA is at capacity or paused (`at_capacity`); MAIA is temporarily unavailable (`unavailable`)."
          },
          "504": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request could not finish in its time limit (`timed_out`)."
          }
        },
        "summary": "Tell the MAIA team about a wrong result, an error, or something MAIA can't do."
      }
    },
    "/geocode": {
      "post": {
        "description": "Send `rows`: 1 to 100, each `{\"address\": \"...\"}` or\n`{\"point\": {\"lat\", \"lon\"}}`. Each row is answered on its own, in order,\nwith a `status`: `matched` (one `place`), `ambiguous` (every candidate,\nnone picked), `not_held`, or `refused` with its `code` and `field`. A\nplace carries MAIA's `id`, which Inspect and search take, its `county`,\nthe address MAIA holds, a point on the parcel and how it `match`ed.\n`coverage` names the counties a row can match in. Every value comes from\nrecords MAIA holds. A request it will not run is refused with\n`invalid_request` naming its `field`.\n\nA call runs no model. Its rows are counted against the workspace's rows a\nminute. While the workspace's charge is on, each `matched` or `ambiguous`\nrow is charged from its credits (`not_held` and `refused` rows are not)\nand `meta.cost_usd` states what.\nSend `Idempotency-Key` to retry a call without paying for it twice.",
        "operationId": "geocode",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "description": "Up to ``MAX_ROWS`` addresses or points, each answered on its own.",
                "properties": {
                  "rows": {
                    "description": "1 to 100 rows, each `{\"address\": ...}` or `{\"point\": {\"lat\", \"lon\"}}`.",
                    "items": {
                      "additionalProperties": false,
                      "description": "One address or one point: exactly one of them.",
                      "properties": {
                        "address": {
                          "anyOf": [
                            {
                              "maxLength": 300,
                              "minLength": 1,
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "default": null,
                          "description": "A street address: house number and street, optionally unit, city, state and ZIP.",
                          "title": "Address"
                        },
                        "point": {
                          "anyOf": [
                            {
                              "additionalProperties": false,
                              "description": "A point, in degrees on WGS 84.",
                              "properties": {
                                "lat": {
                                  "maximum": 90.0,
                                  "minimum": -90.0,
                                  "title": "Lat",
                                  "type": "number"
                                },
                                "lon": {
                                  "maximum": 180.0,
                                  "minimum": -180.0,
                                  "title": "Lon",
                                  "type": "number"
                                }
                              },
                              "required": [
                                "lat",
                                "lon"
                              ],
                              "title": "Point",
                              "type": "object"
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "default": null,
                          "description": "A point (`lat`, `lon`) to find the parcel with an address at, or nearest it."
                        }
                      },
                      "title": "GeocodeRow",
                      "type": "object"
                    },
                    "maxItems": 100,
                    "minItems": 1,
                    "title": "Rows",
                    "type": "array"
                  }
                },
                "required": [
                  "rows"
                ],
                "title": "GeocodeRequest",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "description": "Each row's answer, and the counties a row can be matched in.",
                  "properties": {
                    "coverage": {
                      "items": {
                        "description": "A county whose parcel addresses MAIA holds.",
                        "properties": {
                          "county": {
                            "title": "County",
                            "type": "string"
                          },
                          "name": {
                            "title": "Name",
                            "type": "string"
                          },
                          "state": {
                            "title": "State",
                            "type": "string"
                          }
                        },
                        "required": [
                          "county",
                          "name",
                          "state"
                        ],
                        "title": "CoveredCounty",
                        "type": "object"
                      },
                      "title": "Coverage",
                      "type": "array"
                    },
                    "rows": {
                      "items": {
                        "description": "One row's answer, in the order asked: ``place`` when matched,\n``candidates`` when ambiguous, ``code``, ``field`` and ``reason`` when\nrefused, ``reason`` when not held.",
                        "properties": {
                          "candidates": {
                            "anyOf": [
                              {
                                "items": {
                                  "description": "A parcel the index holds and how it met the row: ``exact`` or ``close``\nfor an address (``differs`` names the street type, direction or unit that\ndiffer; ``unchecked`` the city or ZIP the records cannot confirm),\n``within`` or ``nearest`` for a point, with ``distance_m``.",
                                  "properties": {
                                    "address": {
                                      "title": "Address",
                                      "type": "string"
                                    },
                                    "county": {
                                      "title": "County",
                                      "type": "string"
                                    },
                                    "differs": {
                                      "items": {
                                        "enum": [
                                          "street_type",
                                          "direction",
                                          "unit"
                                        ],
                                        "type": "string"
                                      },
                                      "title": "Differs",
                                      "type": "array"
                                    },
                                    "distance_m": {
                                      "anyOf": [
                                        {
                                          "type": "number"
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ],
                                      "default": null,
                                      "title": "Distance M"
                                    },
                                    "id": {
                                      "title": "Id",
                                      "type": "string"
                                    },
                                    "kind": {
                                      "const": "parcel",
                                      "default": "parcel",
                                      "title": "Kind",
                                      "type": "string"
                                    },
                                    "match": {
                                      "enum": [
                                        "exact",
                                        "close",
                                        "within",
                                        "nearest"
                                      ],
                                      "title": "Match",
                                      "type": "string"
                                    },
                                    "point": {
                                      "additionalProperties": false,
                                      "description": "A point, in degrees on WGS 84.",
                                      "properties": {
                                        "lat": {
                                          "maximum": 90.0,
                                          "minimum": -90.0,
                                          "title": "Lat",
                                          "type": "number"
                                        },
                                        "lon": {
                                          "maximum": 180.0,
                                          "minimum": -180.0,
                                          "title": "Lon",
                                          "type": "number"
                                        }
                                      },
                                      "required": [
                                        "lat",
                                        "lon"
                                      ],
                                      "title": "Point",
                                      "type": "object"
                                    },
                                    "unchecked": {
                                      "items": {
                                        "enum": [
                                          "city",
                                          "zip"
                                        ],
                                        "type": "string"
                                      },
                                      "title": "Unchecked",
                                      "type": "array"
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "county",
                                    "address",
                                    "point",
                                    "match"
                                  ],
                                  "title": "GeocodedPlace",
                                  "type": "object"
                                },
                                "type": "array"
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "default": null,
                            "title": "Candidates"
                          },
                          "code": {
                            "anyOf": [
                              {
                                "const": "invalid_request",
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "The call contract's code for a refused row, as a refused call\nhas; ``None`` for a row that was answered.",
                            "readOnly": true,
                            "title": "Code"
                          },
                          "field": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "default": null,
                            "title": "Field"
                          },
                          "index": {
                            "title": "Index",
                            "type": "integer"
                          },
                          "place": {
                            "anyOf": [
                              {
                                "description": "A parcel the index holds and how it met the row: ``exact`` or ``close``\nfor an address (``differs`` names the street type, direction or unit that\ndiffer; ``unchecked`` the city or ZIP the records cannot confirm),\n``within`` or ``nearest`` for a point, with ``distance_m``.",
                                "properties": {
                                  "address": {
                                    "title": "Address",
                                    "type": "string"
                                  },
                                  "county": {
                                    "title": "County",
                                    "type": "string"
                                  },
                                  "differs": {
                                    "items": {
                                      "enum": [
                                        "street_type",
                                        "direction",
                                        "unit"
                                      ],
                                      "type": "string"
                                    },
                                    "title": "Differs",
                                    "type": "array"
                                  },
                                  "distance_m": {
                                    "anyOf": [
                                      {
                                        "type": "number"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ],
                                    "default": null,
                                    "title": "Distance M"
                                  },
                                  "id": {
                                    "title": "Id",
                                    "type": "string"
                                  },
                                  "kind": {
                                    "const": "parcel",
                                    "default": "parcel",
                                    "title": "Kind",
                                    "type": "string"
                                  },
                                  "match": {
                                    "enum": [
                                      "exact",
                                      "close",
                                      "within",
                                      "nearest"
                                    ],
                                    "title": "Match",
                                    "type": "string"
                                  },
                                  "point": {
                                    "additionalProperties": false,
                                    "description": "A point, in degrees on WGS 84.",
                                    "properties": {
                                      "lat": {
                                        "maximum": 90.0,
                                        "minimum": -90.0,
                                        "title": "Lat",
                                        "type": "number"
                                      },
                                      "lon": {
                                        "maximum": 180.0,
                                        "minimum": -180.0,
                                        "title": "Lon",
                                        "type": "number"
                                      }
                                    },
                                    "required": [
                                      "lat",
                                      "lon"
                                    ],
                                    "title": "Point",
                                    "type": "object"
                                  },
                                  "unchecked": {
                                    "items": {
                                      "enum": [
                                        "city",
                                        "zip"
                                      ],
                                      "type": "string"
                                    },
                                    "title": "Unchecked",
                                    "type": "array"
                                  }
                                },
                                "required": [
                                  "id",
                                  "county",
                                  "address",
                                  "point",
                                  "match"
                                ],
                                "title": "GeocodedPlace",
                                "type": "object"
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "default": null
                          },
                          "reason": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "default": null,
                            "title": "Reason"
                          },
                          "status": {
                            "enum": [
                              "matched",
                              "ambiguous",
                              "not_held",
                              "refused"
                            ],
                            "title": "Status",
                            "type": "string"
                          },
                          "tied": {
                            "anyOf": [
                              {
                                "type": "integer"
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "default": null,
                            "description": "How many parcels hold the address equally; at most 10 are listed in candidates.",
                            "title": "Tied"
                          }
                        },
                        "required": [
                          "index",
                          "status",
                          "code"
                        ],
                        "title": "GeocodedRow",
                        "type": "object"
                      },
                      "title": "Rows",
                      "type": "array"
                    }
                  },
                  "required": [
                    "coverage",
                    "meta",
                    "rows"
                  ],
                  "title": "GeocodeReply",
                  "type": "object"
                }
              }
            },
            "description": "The reply, with the call's `meta`."
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request can't be run as sent (`invalid_request`)."
          },
          "401": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "No valid MAIA key (`unauthorized`)."
          },
          "402": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The workspace has no credits left (`out_of_credits`)."
          },
          "403": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "This call isn't open to the caller (`forbidden`)."
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "MAIA has nothing by that name (`not_found`)."
          },
          "409": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "A call with this Idempotency-Key is still running (`request_in_progress`)."
          },
          "422": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The Idempotency-Key was used for another request (`idempotency_key_reused`)."
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Too many calls (`limit_reached`)."
          },
          "500": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "MAIA failed (`internal`)."
          },
          "503": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "MAIA is at capacity or paused (`at_capacity`); MAIA is temporarily unavailable (`unavailable`)."
          },
          "504": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request could not finish in its time limit (`timed_out`)."
          }
        },
        "summary": "Find the parcels MAIA holds at addresses, or nearest to points."
      }
    },
    "/lookup": {
      "post": {
        "description": "The body is the request the connector's `maia_lookup` tool takes:\n`location` (`{\"id\": ...}` of a search result, or `{\"point\": {\"lat\",\n\"lon\"}}`), and optionally `kind` (`parcel` or `place`), `time` and\n`questions` (1 to 10, in plain words). Without questions the reply holds\nevery fact linked to it. The reply is that tool's reply with `meta`. A\nrequest it will not run is refused with `invalid_request` naming its\n`field`.\n\nA call runs no model. It counts toward the workspace's searches a\nminute. While the workspace's charge is on, a place the lookup finds is\ncharged from its credits (a location that matches nothing is not) and\n`meta.cost_usd` states what. Send `Idempotency-Key` to retry a call\nwithout paying for it twice.\n\nA parcel may also be named by its street address, `{\"address\": \"...\"}`, matched to MAIA's own records only.",
        "operationId": "lookup",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "kind": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null,
                    "description": "What the location names: 'parcel' (the default) or 'place', a business or point of interest. An id must be of this kind."
                  },
                  "location": {
                    "additionalProperties": true,
                    "description": "The parcel or place, as exactly one of: {\"id\": \"<id of a maia_search result>\"}, {\"point\": {\"lat\": 37.7793, \"lon\": -122.4193}} or {\"address\": \"1 Dr Carlton B Goodlett Pl, San Francisco, CA\"}. A point resolves to the parcel it lies in, or the nearest within 25 m; for a place, the nearest place within 30 m. An address resolves to the parcel whose record holds it, from MAIA's own records only; one several parcels hold is refused, naming them.",
                    "type": "object"
                  },
                  "questions": {
                    "description": "Optional: 1 to 10 questions about it, in plain words, such as 'what is the zoning and height limit?' or 'is it in a flood zone?'. Each gets only the facts relevant to it. Left out, the reply holds every fact linked to it.",
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  },
                  "time": {
                    "anyOf": [
                      {
                        "additionalProperties": true,
                        "type": "object"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null,
                    "description": "When the facts must be true, as in maia_search: {\"from\": \"2023-01-01\", \"to\": \"2023-12-31\", \"match\": \"any\"}, whole days in UTC. Leave it out for today."
                  }
                },
                "required": [
                  "location"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "description": "What the index holds about one parcel or place.",
                  "properties": {
                    "disagreements": {
                      "anyOf": [
                        {
                          "items": {
                            "additionalProperties": true,
                            "type": "object"
                          },
                          "type": "array"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "Where sources state the same thing differently, each with what each says and when."
                    },
                    "flags": {
                      "description": "What to know about the match or the reply, each with what it means.",
                      "items": {
                        "additionalProperties": {
                          "type": "string"
                        },
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "anyOf": [
                        {
                          "description": "What every reply says about the call itself.",
                          "properties": {
                            "cost_usd": {
                              "description": "What the request was charged, in US dollars; 0.00 when it was not charged.",
                              "type": "string"
                            },
                            "limit": {
                              "anyOf": [
                                {
                                  "description": "What is left of one allowance.",
                                  "properties": {
                                    "limit": {
                                      "description": "Calls the allowance holds.",
                                      "type": "integer"
                                    },
                                    "remaining": {
                                      "description": "Calls left in it.",
                                      "type": "integer"
                                    },
                                    "resets_in_seconds": {
                                      "description": "Seconds until it starts again.",
                                      "type": "integer"
                                    }
                                  },
                                  "required": [
                                    "limit",
                                    "remaining",
                                    "resets_in_seconds"
                                  ],
                                  "type": "object"
                                },
                                {
                                  "type": "null"
                                }
                              ],
                              "default": null,
                              "description": "The caller's per-minute calls left."
                            },
                            "narrow": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ],
                              "default": null,
                              "description": "How to get the rest, when truncated."
                            },
                            "replayed": {
                              "default": false,
                              "description": "True when this is the stored reply to an earlier request with the same Idempotency-Key, not charged again.",
                              "type": "boolean"
                            },
                            "request_id": {
                              "description": "Names the request to MAIA; quote it in a feedback report.",
                              "type": "string"
                            },
                            "truncated": {
                              "default": false,
                              "description": "True when the reply holds less than matched.",
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "request_id",
                            "cost_usd"
                          ],
                          "type": "object"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "What every reply says about the call itself."
                    },
                    "questions": {
                      "anyOf": [
                        {
                          "items": {
                            "additionalProperties": true,
                            "type": "object"
                          },
                          "type": "array"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "With questions: each in order, with status found or nothing_relevant and only the facts relevant to it, by subject; cut when a reply too large to send lost its facts."
                    },
                    "reason": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "Why it is not held."
                    },
                    "result": {
                      "anyOf": [
                        {
                          "description": "What the location resolved to.",
                          "properties": {
                            "candidates": {
                              "description": "The ids of other parcels or places that also fit the location.",
                              "items": {
                                "type": "string"
                              },
                              "type": "array"
                            },
                            "differs": {
                              "anyOf": [
                                {
                                  "items": {
                                    "type": "string"
                                  },
                                  "type": "array"
                                },
                                {
                                  "type": "null"
                                }
                              ],
                              "default": null,
                              "description": "For close: what the held address states differently (street_type, direction, unit)."
                            },
                            "distance_m": {
                              "anyOf": [
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "null"
                                }
                              ],
                              "default": null,
                              "description": "How far the point is from it, for nearest."
                            },
                            "id": {
                              "description": "Its MAIA id, the id a maia_search result names.",
                              "type": "string"
                            },
                            "kind": {
                              "description": "parcel or place.",
                              "type": "string"
                            },
                            "label": {
                              "additionalProperties": {
                                "type": "string"
                              },
                              "description": "What to call it, as a maia_search result's label.",
                              "type": "object"
                            },
                            "matched_by": {
                              "description": "exact for an id or an address held as asked; close for an address held with what differs, or with what could not be checked; within for a point inside a parcel; nearest for a point on none, with distance_m.",
                              "type": "string"
                            },
                            "point": {
                              "additionalProperties": {
                                "type": "number"
                              },
                              "description": "A point on it: lat and lon.",
                              "type": "object"
                            },
                            "unchecked": {
                              "anyOf": [
                                {
                                  "items": {
                                    "type": "string"
                                  },
                                  "type": "array"
                                },
                                {
                                  "type": "null"
                                }
                              ],
                              "default": null,
                              "description": "For close: what the records hold no value to check (city, zip)."
                            }
                          },
                          "required": [
                            "kind",
                            "id",
                            "point",
                            "matched_by"
                          ],
                          "type": "object"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null
                    },
                    "sources": {
                      "additionalProperties": {
                        "additionalProperties": true,
                        "type": "object"
                      },
                      "description": "Each source a fact names, by key: its dataset, publisher and licence.",
                      "type": "object"
                    },
                    "status": {
                      "description": "resolved, or not_held when no parcel or place fits the location, with the reason.",
                      "type": "string"
                    },
                    "subjects": {
                      "anyOf": [
                        {
                          "items": {
                            "additionalProperties": true,
                            "type": "object"
                          },
                          "type": "array"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "Without questions: every fact by subject. A fact has its field and value, its description where held, the sources it rests on by key into sources, and true: the days it holds."
                    },
                    "time": {
                      "anyOf": [
                        {
                          "additionalProperties": true,
                          "type": "object"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The days the facts hold for."
                    }
                  },
                  "required": [
                    "meta",
                    "status"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The reply, with the call's `meta`."
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request can't be run as sent (`invalid_request`)."
          },
          "401": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "No valid MAIA key (`unauthorized`)."
          },
          "402": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The workspace has no credits left (`out_of_credits`)."
          },
          "403": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "This call isn't open to the caller (`forbidden`)."
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "MAIA has nothing by that name (`not_found`)."
          },
          "409": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "A call with this Idempotency-Key is still running (`request_in_progress`)."
          },
          "422": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The Idempotency-Key was used for another request (`idempotency_key_reused`)."
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Too many calls (`limit_reached`)."
          },
          "500": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "MAIA failed (`internal`)."
          },
          "503": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "MAIA is at capacity or paused (`at_capacity`); MAIA is temporarily unavailable (`unavailable`)."
          },
          "504": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request could not finish in its time limit (`timed_out`)."
          }
        },
        "summary": "What MAIA's index holds about one parcel or place."
      }
    },
    "/search": {
      "post": {
        "description": "The body is the request the connector's `maia_search` tool takes, field\nfor field: `query` (text, or `{\"all\": [...], \"not\": [...]}`), and\noptionally `kind`, `region`, `time`, `filters`, `output`, `sort`, `limit`\nand `cursor`. The reply is that tool's reply with `meta`. A request the\nsearch will not run is refused with `invalid_request` naming its `field`.\n\nA call runs no model. While the workspace's charge is on, a search\nis charged from its credits (a list that finds nothing is not) and\n`meta.cost_usd` states what. Send `Idempotency-Key` to retry a call\nwithout paying for it twice.",
        "operationId": "search",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "cursor": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null,
                    "description": "A reply's cursor, exactly as given, with the same request, to read the next page. It is good for 60 minutes. Leave it out for a new search."
                  },
                  "filters": {
                    "anyOf": [
                      {
                        "additionalProperties": true,
                        "type": "object"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null,
                    "description": "Narrows the results. A parcel search takes numbers each parcel holds, each with a min, a max or both: {\"acres\": {\"min\": 0.5}}. A result with no recorded value for a filter is left out. Columns: acres (the parcel's lot area, in acres); year_built (the year the parcel's building was built); total_value (the parcel's total assessed value (land and improvements), in US dollars); nearest_substation_m (straight-line distance from the parcel to the nearest electric substation, in metres (none recorded beyond 80 km)); nearest_transmission_line_m (straight-line distance from the parcel to the nearest high-voltage transmission line (69 kV and up), in metres (none recorded beyond 80 km)); nearest_highway_m (straight-line distance from the parcel to the nearest highway (a motorway or trunk road), in metres (none recorded beyond 80 km)); nearest_highway_ramp_m (straight-line distance from the parcel to the nearest highway on- or off-ramp, in metres (none recorded beyond 80 km)); nearest_rail_transit_station_m (straight-line distance from the parcel to the nearest rail transit station (subway, light rail, streetcar or monorail), in metres (none recorded beyond 80 km)); nearest_school_m (straight-line distance from the parcel to the nearest K-12 school, in metres (none recorded beyond 80 km)). A place search returns open places unless status says otherwise, and takes: status: {\"is\": \"open\" | \"temporarily_closed\" | \"permanently_closed\" | \"any\"}: the place's operating status. Left out, \"open\". open_on: {\"day\": \"mon\"..\"sun\"}: it has opening hours that day. open_after: {\"hour\": \"HH:MM\", \"day\": optional}: still open after that time, on that day or any. A time before 05:00 is the night after that day. open_24_hours: {\"is\": true}: recorded as open the whole of every day."
                  },
                  "kind": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null,
                    "description": "The kind of result wanted: 'parcel' (the default) or 'place', a business or point of interest. sort and stats are for parcels only."
                  },
                  "limit": {
                    "anyOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null,
                    "description": "How many results a page holds, 1 to 100 (default 10)."
                  },
                  "output": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null,
                    "description": "'list' (the default) returns the results; 'count' how many there are, with a few examples (a flag says when they were left out); 'stats' the count with the minimum, median, mean and maximum of every column over them. Neither count nor stats takes sort or cursor."
                  },
                  "query": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "additionalProperties": true,
                        "type": "object"
                      }
                    ],
                    "description": "What to find. Either text, searched as one part, or the query's parts: {\"all\": [...], \"not\": [...]}. Every item of all must hold for a result; an item is one part (a few words naming one thing, such as 'vacant lot', 'M-1' or 'Noe Valley') or a list of alternatives, any one of which counts, e.g. [\"M-1\", \"PDR-1-G\"]. Each part of not takes away everything it matches, so name the narrowest thing: 'flood zone AE', not 'flood zone'. A place's opening hours and status are filters, never words in a part: 'pharmacy' with the filter open_24_hours, not 'pharmacy open 24 hours'. With nothing in all, the not parts are taken away from every result in the region, which must then be named. At most 8 parts. Nothing is read out of the text: write 'or' and 'not' as the structure, not as words. Example: {\"all\": [\"vacant lot\", [\"M-1\", \"PDR-1-G\"]], \"not\": [\"flood zone AE\"]}."
                  },
                  "region": {
                    "additionalProperties": true,
                    "description": "Required. The broad place searched, as one region type with one place or a list: {\"county\": [\"San Francisco County, CA\"]} or {\"state\": \"CA\"}. A place is its name or its FIPS code. Types: state, county. A county region also sees that county's own codes, such as its zoning districts; a state region sees only records that mean the same everywhere. Name a neighbourhood inside a county as a part of the query; a flag says when the version searched cannot search by neighbourhood.",
                    "type": "object"
                  },
                  "sort": {
                    "anyOf": [
                      {
                        "additionalProperties": true,
                        "type": "object"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null,
                    "description": "Orders a list by one column: {\"by\": \"acres\", \"order\": \"desc\"}; order is 'asc' (the default) or 'desc', and results with no value come last. Left out, results come best match first. Takes the columns filters does."
                  },
                  "time": {
                    "anyOf": [
                      {
                        "additionalProperties": true,
                        "type": "object"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null,
                    "description": "When the facts must be true: {\"from\": \"2023-01-01\", \"to\": \"2023-12-31\", \"match\": \"any\"}, whole days in UTC, both included. Leave one side out for a range open on that side, or leave time out for today in UTC. match is 'any' (true at any point in the range, the default) or 'whole' (true for all of it). Most records carry no dates and count as true at every time, so a range narrows only the facts whose records are dated; a flag says when a part's records start after the range."
                  }
                },
                "required": [
                  "query",
                  "region"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "description": "What a search found, each result naming itself.",
                  "properties": {
                    "count": {
                      "description": "How many results fit, over all pages.",
                      "type": "integer"
                    },
                    "cursor": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "Set when more results fit than the page holds. Send it back with the same request for the next page."
                    },
                    "examples": {
                      "anyOf": [
                        {
                          "items": {
                            "additionalProperties": true,
                            "type": "object"
                          },
                          "type": "array"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "For count: a few of the results counted, as in results; left out, with a flag saying so, when too slow to read."
                    },
                    "flags": {
                      "description": "What found nothing, was cut or was left out, each naming its part of the query and saying what happened and what to do.",
                      "items": {
                        "additionalProperties": true,
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "anyOf": [
                        {
                          "description": "What every reply says about the call itself.",
                          "properties": {
                            "cost_usd": {
                              "description": "What the request was charged, in US dollars; 0.00 when it was not charged.",
                              "type": "string"
                            },
                            "limit": {
                              "anyOf": [
                                {
                                  "description": "What is left of one allowance.",
                                  "properties": {
                                    "limit": {
                                      "description": "Calls the allowance holds.",
                                      "type": "integer"
                                    },
                                    "remaining": {
                                      "description": "Calls left in it.",
                                      "type": "integer"
                                    },
                                    "resets_in_seconds": {
                                      "description": "Seconds until it starts again.",
                                      "type": "integer"
                                    }
                                  },
                                  "required": [
                                    "limit",
                                    "remaining",
                                    "resets_in_seconds"
                                  ],
                                  "type": "object"
                                },
                                {
                                  "type": "null"
                                }
                              ],
                              "default": null,
                              "description": "The caller's per-minute calls left."
                            },
                            "narrow": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ],
                              "default": null,
                              "description": "How to get the rest, when truncated."
                            },
                            "replayed": {
                              "default": false,
                              "description": "True when this is the stored reply to an earlier request with the same Idempotency-Key, not charged again.",
                              "type": "boolean"
                            },
                            "request_id": {
                              "description": "Names the request to MAIA; quote it in a feedback report.",
                              "type": "string"
                            },
                            "truncated": {
                              "default": false,
                              "description": "True when the reply holds less than matched.",
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "request_id",
                            "cost_usd"
                          ],
                          "type": "object"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "What every reply says about the call itself."
                    },
                    "output": {
                      "description": "list, count or stats, as asked.",
                      "type": "string"
                    },
                    "results": {
                      "anyOf": [
                        {
                          "items": {
                            "additionalProperties": true,
                            "type": "object"
                          },
                          "type": "array"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "A list's page. Each result has its kind and id; its label (a parcel's parcel_number, address, neighborhood, use; a place's name, address, category, status, hours, hours_source; a field not on record is left out); its values for the columns filtered or sorted by; and matched: the facts about it that matched the query, each naming its sources by their keys in sources."
                    },
                    "sources": {
                      "anyOf": [
                        {
                          "additionalProperties": {
                            "additionalProperties": true,
                            "type": "object"
                          },
                          "type": "object"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "Each source a matched fact names, by key: its dataset and, where on record, its publisher, licence and date."
                    },
                    "stats": {
                      "anyOf": [
                        {
                          "additionalProperties": true,
                          "type": "object"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "For stats: each column's n, min, median, mean and max."
                    }
                  },
                  "required": [
                    "count",
                    "flags",
                    "meta",
                    "output"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The reply, with the call's `meta`."
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request can't be run as sent (`invalid_request`)."
          },
          "401": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "No valid MAIA key (`unauthorized`)."
          },
          "402": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The workspace has no credits left (`out_of_credits`)."
          },
          "403": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "This call isn't open to the caller (`forbidden`)."
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "MAIA has nothing by that name (`not_found`)."
          },
          "409": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "A call with this Idempotency-Key is still running (`request_in_progress`)."
          },
          "422": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The Idempotency-Key was used for another request (`idempotency_key_reused`)."
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Too many calls (`limit_reached`)."
          },
          "500": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "MAIA failed (`internal`)."
          },
          "503": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "MAIA is at capacity or paused (`at_capacity`); MAIA is temporarily unavailable (`unavailable`)."
          },
          "504": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "The request could not finish in its time limit (`timed_out`)."
          }
        },
        "summary": "Search MAIA's index by the query's parts."
      }
    }
  },
  "security": [
    {
      "key": []
    }
  ],
  "servers": [
    {
      "url": "https://api.maia-analytics.com/api/v1"
    }
  ]
}
