{
  "openapi": "3.1.0",
  "info": {
    "title": "bauzertifikate API",
    "version": "1.3.0",
    "summary": "The DIN/TS 18599 calculation kernel and the building data of Germany's 3D building models.",
    "description": "Every request needs an API key: `Authorization: Bearer eak_…` (or `X-API-Key`). Keys belong to a Büro: an admin of the Büro activates the API in the portal (app.bauzertifikate.de, Apps und Lizenzen), accepting the beta's terms there, and makes its keys there. The Büro's API licence sets the calculations and building lookups a month for all its keys, and the terms must be accepted before a key works. The beta activated in the portal is for calculations; building data (`lod2`) and more allowance are on request. A key has scopes: `lod2` (building data), `kernel` (the kernel), `bzf` (BZF, to come).\n\nThe kernel endpoints take the kernel's own input, published as it is and versioned with the kernel. Every key of an input and an answer is camelCase, and an input's objects are closed: a field the method doesn't know is refused (400 `request`, its path in `field`). Every answer names the kernel version, the tags it rests on (law, norm editions, scope, status), its deviations and the choices taken, and the input's hash (`basis`). A call counts as one calculation against the allowance when its answer holds an energy balance of a building: `din18599.run` with a result, `din18599.provisional`, `din18599.losses` and `calc.compute`. The U-values (`iso6946.component_u_value`, `iso10077.assembly_u_value`) and the limits (`limits.anlage7`, `limits.beg_em`) never count by themselves and are answered also when the month's allowance is used up; errors and checks are free, all of them within the month's free calls. `GET /v1/kernel` lists how each method counts (`counts`). The same calculation repeated within a calendar month (Europe/Berlin) counts once: the same method, input (by its hash), law, kernel version and choices. Calls that run in the kernel without counting are free up to ten times the licence's monthly calculations; beyond that every call that runs in the kernel counts as one calculation. (The beta: 1,000 calculations, so 10,000 free calls a month; `GET /v1/kernel` and `GET /v1/usage` show `freeCalls`.) Nothing of a request is stored but its hash.\n\nA request names the law its results are rated under (`law`), each with the edition of DIN 18599 it names: `gmodg-2027`, the GModG as in force from 1 January 2027, with DIN/TS 18599:2025-10 (the default, as before); or `geg-2024`, the GEG as in force until 31 December 2026, with DIN V 18599:2018-09 within that edition's scope (a residential building of one zone with window ventilation and one gas, LPG or oil boiler; the rest is refused). Every answer's tags name the law and the edition it was calculated under. Non-residential buildings are refused (`scope`) under both until that part of the kernel is validated. `status:pilot` is the kernel's status tag during the beta: the API is usable now, the kernel's independent validation is still running, apart from the versions, and whoever issues a certificate with a result remains responsible for it.\n\nThe building lookup (`/v1/gebaeude`) answers the building with German field names, as the Länder's data name them; a lookup counts against the allowance only when it finds a building. Thüringen is not included.\n\nEvery endpoint answers an error alike: `{\"error\": {\"kind\", \"message\", …}, \"requestId\", \"warnings\"}`, the message in English, the kind the machine code to act on, and the request's id also in the `X-Request-Id` header of every answer, which we need to look into a request. A request without a valid key is 401 with `WWW-Authenticate: Bearer realm=\"bauzertifikate\"`; a 429 carries `Retry-After`.\n\nThe same APIs serve an agent as a remote MCP server at `POST /v1/mcp` (Streamable HTTP, stateless, JSON answers), with the same key, scopes, limits, allowance and metering: the tools `kernel_info`, `kernel_schema`, `kernel_example`, `kernel_check`, `kernel_calculate`, `building_lookup` and `usage`. Its tools' errors are tool results with the error of these endpoints (`isError`).",
    "contact": {
      "email": "service@mail.bauzertifikate.de"
    }
  },
  "servers": [
    {
      "url": "https://api.bauzertifikate.de"
    }
  ],
  "security": [
    {
      "bearer": []
    },
    {
      "apiKey": []
    }
  ],
  "tags": [
    {
      "name": "kernel",
      "description": "The calculation kernel (scope kernel)"
    },
    {
      "name": "versions",
      "description": "Kernel versions and what they rest on"
    },
    {
      "name": "usage",
      "description": "The month's use and the allowance (any key)"
    },
    {
      "name": "gebaeude",
      "description": "Building data from the Länder's LoD2 models (scope lod2)"
    },
    {
      "name": "mcp",
      "description": "The APIs as an MCP server for agents (the key's scopes)"
    }
  ],
  "paths": {
    "/v1/kernel": {
      "get": {
        "tags": [
          "kernel"
        ],
        "operationId": "kernelInfo",
        "summary": "The kernel versions on offer, the default, the methods this key may call, and what is refused",
        "responses": {
          "200": {
            "description": "What the key may do",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KernelInfo"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "401": {
            "description": "No valid key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KernelReply"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: too many requests a second from this key or address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KernelReply"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "500": {
            "description": "`internal`: please send us the request id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KernelReply"
                }
              }
            }
          }
        }
      }
    },
    "/v1/versions": {
      "get": {
        "tags": [
          "versions"
        ],
        "operationId": "listVersions",
        "summary": "Every callable kernel version with its tags, deviations, choices and dates (release, deprecation, sunset)",
        "responses": {
          "200": {
            "description": "The versions, newest first",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "default",
                    "versions",
                    "requestId"
                  ],
                  "properties": {
                    "default": {
                      "type": "string",
                      "examples": [
                        "1.3.0"
                      ]
                    },
                    "versions": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Version"
                      }
                    },
                    "requestId": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "401": {
            "description": "No valid key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KernelReply"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: too many requests a second from this key or address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KernelReply"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "500": {
            "description": "`internal`: please send us the request id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KernelReply"
                }
              }
            }
          }
        }
      }
    },
    "/v1/versions/{version}": {
      "get": {
        "tags": [
          "versions"
        ],
        "operationId": "getVersion",
        "summary": "One version, with its methods, the paths of their schemas and the changelog",
        "parameters": [
          {
            "name": "version",
            "in": "path",
            "required": true,
            "description": "Exact (`1.3.0`) or a minor (`1.3`: its newest patch)",
            "schema": {
              "type": "string",
              "pattern": "^\\d+\\.\\d+(\\.\\d+)?$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The version",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionDetail"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              },
              "Link": {
                "$ref": "#/components/headers/Link"
              }
            }
          },
          "400": {
            "description": "`request`: not a version",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KernelReply"
                }
              }
            }
          },
          "401": {
            "description": "No valid key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KernelReply"
                }
              }
            }
          },
          "404": {
            "description": "`unknown_version`: never on offer (newer than any, or a version we never had); `versions` lists those that are",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KernelReply"
                }
              }
            }
          },
          "410": {
            "description": "`version_gone`: was on offer and is no longer (past its sunset); `versions` lists those that are",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KernelReply"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: too many requests a second from this key or address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KernelReply"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "500": {
            "description": "`internal`: please send us the request id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KernelReply"
                }
              }
            }
          }
        }
      }
    },
    "/v1/versions/{version}/schemas/{method}": {
      "get": {
        "tags": [
          "versions"
        ],
        "summary": "The JSON Schema (2020-12) of a method's input, its result or its whole answer",
        "description": "Standalone: the schema with the definitions it reaches (`$defs`). `part=input` (the default) is the method's input and `part=output` its result, the answer's `ok`, both from the kernel itself (`kernel.schema`); `part=answer` is this API's whole answer with a result: `ok`, `basis`, `requestId` and `warnings`. An input's objects are closed (`additionalProperties: false`): a field the method doesn't know is refused. A result's objects are open, since a minor version may add a field. Kernels before 1.2.0 describe the input alone. `GET /v1/versions/{version}` lists the three paths of every method.",
        "operationId": "getSchema",
        "parameters": [
          {
            "name": "version",
            "in": "path",
            "required": true,
            "description": "Exact (`1.3.0`) or a minor (`1.3`: its newest patch)",
            "schema": {
              "type": "string",
              "pattern": "^\\d+\\.\\d+(\\.\\d+)?$"
            }
          },
          {
            "name": "method",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "examples": [
                "din18599.run"
              ]
            }
          },
          {
            "name": "part",
            "in": "query",
            "required": false,
            "description": "What the schema describes: the method's `input`, its result (`output`) or this API's whole `answer` with a result",
            "schema": {
              "type": "string",
              "enum": [
                "input",
                "output",
                "answer"
              ],
              "default": "input"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The schema",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "A JSON Schema, draft 2020-12"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              },
              "Link": {
                "$ref": "#/components/headers/Link"
              }
            }
          },
          "400": {
            "description": "`request`: not a version (`field`: `version`), or not a part (`field`: `part`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KernelReply"
                }
              }
            }
          },
          "401": {
            "description": "No valid key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KernelReply"
                }
              }
            }
          },
          "404": {
            "description": "`unknown_method`: the version offers no such method; `no_schema`: the version describes the input alone (a kernel before 1.2.0), `parts` lists what it describes; `unknown_version`: never on offer (newer than any, or a version we never had)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KernelReply"
                }
              }
            }
          },
          "410": {
            "description": "`version_gone`: was on offer and is no longer (past its sunset); `versions` lists those that are",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KernelReply"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: too many requests a second from this key or address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KernelReply"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "500": {
            "description": "`internal`: please send us the request id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KernelReply"
                }
              }
            }
          },
          "503": {
            "description": "`busy`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KernelReply"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        }
      }
    },
    "/v1/kernel/{method}": {
      "post": {
        "tags": [
          "kernel"
        ],
        "operationId": "callKernel",
        "summary": "Call a method of the kernel with its own input",
        "description": "The method must be on the version's list (`GET /v1/versions/{version}`); in 1.3.0 `calc.compute`, `din18599.losses`, `din18599.provisional`, `din18599.run`, `iso10077.assembly_u_value`, `iso6946.component_u_value`, `limits.anlage7` and `limits.beg_em` (`din18599.reference_building` calculates non-residential buildings alone, which `scope:residential` refuses, so it is not offered). The request's `law` (default `gmodg-2027`) is the kernel's `options.law` and brings its edition of DIN 18599: under `gmodg-2027` the din18599 methods run DIN/TS 18599:2025-10, under `geg-2024` DIN V 18599:2018-09, and `din18599.run`'s `rating` follows the law (under `geg-2024` on the net calorific value per m² of A_N, with `usableArea` and `specificTransmission`). An input may leave `in.edition` out or state the law's (`\"2025-10\"` or `\"2018-09\"`); the other one is a 400 `request` at `in.edition` whose reason names `options.law`, the kernel's name for this field. Under `geg-2024` a building outside the 2018 edition's scope is answered as the kernel answers it under any law: `din18599.run` with its report's `limit` (`field`, `reason` naming the edition) and without `result` (200, not counted, no calculated values), `din18599.provisional` with that report under `report` (200, counted, as its every answer), `din18599.losses` with 422 `scope`. Each input's JSON Schema is at `GET /v1/versions/{version}/schemas/{method}`, its result's at `?part=output` and the whole answer's at `?part=answer`. Every key is camelCase: `din18599.run`'s rating rows give a factor as `{\"value\", \"source\"}`, and `calc.compute`'s climate answers take `detail` as `{\"factor\", \"windowStart\", \"windowEnd\", \"postcode\", \"source\", \"notes\"}` (until 1.1.0 these were `Value`, `Source`, `Factor`, `WindowStart`, … as the Go port had them). An input's objects are closed: a field the method doesn't know is a 400 `request` whose `field` is its path, e.g. `b.zones[0].colour`, and `reason` names it; inside an object tagged by its `kind` (a layer's material, a component's outside, a fastener method) the path stops at that object. The scope is the server's; a request cannot set it.\n\nWhat counts: `din18599.run` only when its report holds a `result`; every answer of `din18599.provisional`, `din18599.losses` and `calc.compute`; never `iso6946.component_u_value`, `iso10077.assembly_u_value`, `limits.anlage7` and `limits.beg_em` (`GET /v1/kernel`'s `counts`). Errors and checks never count. The same calculation repeated within the month (Europe/Berlin) counts once: the same method, input hash, law, kernel version and choices (the detail asked, `summary`, is not part of it); a changed input, law, version or choice is another calculation. With the month's allowance used up, a method that never counts, a check and a calculation already counted this month are still answered; a new calculation of a method that counts is 429 `quota_exceeded`.\n\nFree calls: Calls that run in the kernel without counting are free up to ten times the licence's monthly calculations; beyond that every call that runs in the kernel counts as one calculation. A call runs in the kernel when the kernel answers it: a result, a report, a check, or its own refusal of the input (400 `request` at an input field, 422); refusals before the kernel (the request's form, an unknown method or version, `version_mismatch`, the key, rate and quota) and `busy`, `timeout` and `internal` use nothing. Beyond the free calls each such call counts by itself, whatever it answers (a repeated check each time); with the calculations used up too, every call that would run in the kernel is 429 `quota_exceeded`, checks and methods that never count included.\n\nNo figures without a count: a `din18599.run` whose report has no `result` (it stopped at gaps, a limit or an invalid value) is not counted and carries no calculated values. Its `ok` keeps `gaps` (each field and why), `limit` and `invalid` (field and reason) and `assumptions` (the values taken from tables, as text with their source), and nothing else (the kernel's `demand` is left out), the shape of a check's answer; `warnings` gets `{\"id\": \"no-result\", \"message\": …}` saying why, and after gaps alone that `din18599.provisional` answers the gaps its rules cover with stated values and calculates (counted).\n\nStatus codes: 200 a result, a check, or `din18599.run`'s report with `gaps` or `limit` and without `result` (not counted, no calculated values); 400 `request` (not JSON, an unknown field of the request or of the input, the input does not fit the method, a `law` that is neither `gmodg-2027` nor `geg-2024`, an `in.edition` against the law); 401 no valid key; 403 the key lacks the scope `kernel` (`forbidden`) or its Büro has no licence with accepted terms (`no_licence`); 404 `unknown_method`, `unknown_version`; 410 `version_gone`; 413 `too_large` (input over 1 MB); 422 `invalid`, `missing`, `unsupported` (also a `law` the version does not offer, with the version's `laws`), `input`, `gaps`, `scope`, `message`, `validation`, `climate`, `climate_needed`, `version_mismatch`; 429 `rate_limited`, `quota_exceeded`; 500 `internal` (send us the request id); 503 `busy` (no kernel free in time, retry after a second) or `timeout` (the call took longer than 10 s).\n\nAn answer from a version a newer minor or major replaces carries `Deprecation` (RFC 9745), `Sunset` (RFC 8594) and a `Link` to its successor; from the sunset on, the version answers 410 `version_gone`.",
        "parameters": [
          {
            "name": "method",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "examples": [
                "din18599.run"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KernelRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The kernel's answer: a result, a check, or din18599.run's report with gaps or a limit and without a result, which is not counted and carries no calculated values (only gaps, limit, invalid and assumptions, and the warning no-result). A method that never counts (the U-values, the limits) is answered also when the month's allowance is used up",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KernelReply"
                }
              }
            },
            "headers": {
              "X-Quota-Limit": {
                "$ref": "#/components/headers/X-Quota-Limit"
              },
              "X-Quota-Remaining": {
                "$ref": "#/components/headers/X-Quota-Remaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              },
              "Link": {
                "$ref": "#/components/headers/Link"
              }
            }
          },
          "400": {
            "description": "`request`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KernelReply"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KernelReply"
                }
              }
            }
          },
          "403": {
            "description": "`forbidden`, `no_licence`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KernelReply"
                }
              }
            }
          },
          "404": {
            "description": "`unknown_method`; `unknown_version`: never on offer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KernelReply"
                }
              }
            }
          },
          "410": {
            "description": "`version_gone`: was on offer and is no longer (past its sunset)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KernelReply"
                }
              }
            }
          },
          "413": {
            "description": "`too_large`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KernelReply"
                }
              }
            }
          },
          "422": {
            "description": "The kernel's refusal (`invalid`, `missing`, `unsupported`, `input`, `scope`, `message`, `validation`, `climate`, `climate_needed`) or `version_mismatch`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KernelReply"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: too many requests a second from this key or address, or the Büro has as many calls running as may run at once (`inFlight`, 1: one call of a Büro at a time), whichever of its keys sent them; `quota_exceeded`: this month's calculations are used up and the call would be a new one (a method that never counts, a check and a calculation already counted this month are still answered while the month's free calls last; beyond them, with the calculations used up, every call that would run in the kernel)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KernelReply"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "500": {
            "description": "`internal`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KernelReply"
                }
              }
            }
          },
          "503": {
            "description": "`busy`, `timeout`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KernelReply"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        }
      }
    },
    "/v1/usage": {
      "get": {
        "tags": [
          "usage"
        ],
        "operationId": "usage",
        "summary": "This month's use of the API: calls per method, errors by kind, distinct inputs, building lookups and the allowance",
        "description": "Any valid key; never counted. A Büro's key answers for its Büro, all its keys together. A key from before Büros had keys answers its own building lookups, as `/v1/gebaeude` counts them. `lookups` gives the month's lookups that found a building, in total and per day. The month is counted in Europe/Berlin; the allowance starts afresh at `period.end`.",
        "responses": {
          "200": {
            "description": "The month's use",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Usage"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "401": {
            "description": "No valid key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KernelReply"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: too many requests a second from this key or address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KernelReply"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "500": {
            "description": "`internal`: please send us the request id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KernelReply"
                }
              }
            }
          }
        }
      }
    },
    "/v1/gebaeude": {
      "get": {
        "tags": [
          "gebaeude"
        ],
        "operationId": "gebaeude",
        "summary": "Das Gebäude an einer Adresse oder einem Punkt, mit seinen Kennzahlen",
        "description": "Eine Abfrage zählt nur, wenn ein Gebäude gefunden wird. Thüringen ist nicht enthalten.",
        "parameters": [
          {
            "name": "adresse",
            "in": "query",
            "description": "Straße, Hausnummer, PLZ und Ort",
            "schema": {
              "type": "string",
              "minLength": 5,
              "maxLength": 200
            },
            "examples": {
              "muenster": {
                "value": "Buschkamp 12, 48161 Münster"
              }
            }
          },
          {
            "name": "lon",
            "in": "query",
            "description": "WGS84, ohne adresse",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "lat",
            "in": "query",
            "description": "WGS84, ohne adresse",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "geometrie",
            "in": "query",
            "description": "1: mit Grundriss und Flächen",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Das Gebäude",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Gebaeude"
                }
              }
            },
            "headers": {
              "X-Quota-Limit": {
                "$ref": "#/components/headers/X-Quota-Limit"
              },
              "X-Quota-Remaining": {
                "$ref": "#/components/headers/X-Quota-Remaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "400": {
            "description": "`bad_query`: neither `adresse` nor `lon` and `lat` within Germany, an `adresse` shorter than 5 or longer than 200 characters, or a query the address search refused",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KernelReply"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Quota-Limit": {
                "$ref": "#/components/headers/X-Quota-Limit"
              },
              "X-Quota-Remaining": {
                "$ref": "#/components/headers/X-Quota-Remaining"
              }
            }
          },
          "401": {
            "description": "`unauthorized`: no valid key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KernelReply"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "`forbidden`: the key lacks the scope `lod2` (with the key's `scopes`); `no_licence`: the key's Büro has no API licence in force with accepted terms",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KernelReply"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "description": "`address_not_found`: no address with this house number; `no_data`: no 3D building data for this address (Thüringen among them); `no_building`: no building at the address or point. Not counted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KernelReply"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Quota-Limit": {
                "$ref": "#/components/headers/X-Quota-Limit"
              },
              "X-Quota-Remaining": {
                "$ref": "#/components/headers/X-Quota-Remaining"
              }
            }
          },
          "422": {
            "description": "`ambiguous_address`: several addresses match, listed in `addresses`; add the postcode and town. Not counted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KernelReply"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Quota-Limit": {
                "$ref": "#/components/headers/X-Quota-Limit"
              },
              "X-Quota-Remaining": {
                "$ref": "#/components/headers/X-Quota-Remaining"
              }
            }
          },
          "429": {
            "description": "`rate_limited`: too many requests a second from this key or address; `quota_exceeded`: this month's lookups are used up",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KernelReply"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Quota-Limit": {
                "$ref": "#/components/headers/X-Quota-Limit"
              },
              "X-Quota-Remaining": {
                "$ref": "#/components/headers/X-Quota-Remaining"
              }
            }
          },
          "500": {
            "description": "`internal`: please send us the request id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KernelReply"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "502": {
            "description": "`upstream`: the address search or the building data could not be reached; please try again. Not counted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KernelReply"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        }
      }
    },
    "/v1/openapi.json": {
      "get": {
        "operationId": "openapi",
        "summary": "This description",
        "security": [],
        "responses": {
          "200": {
            "description": "OpenAPI 3.1",
            "content": {
              "application/json": {}
            }
          },
          "429": {
            "description": "`rate_limited`: too many requests from this address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KernelReply"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        }
      }
    },
    "/v1/mcp": {
      "post": {
        "tags": [
          "mcp"
        ],
        "operationId": "mcp",
        "summary": "The MCP server of the kernel and the building lookup, for agents",
        "description": "A remote MCP server (Model Context Protocol, revision 2026-07-28; older clients negotiate 2025-11-25): JSON-RPC 2.0 over stateless Streamable HTTP, answered as `application/json`, no sessions, `GET` and `DELETE` 405. Authenticate every request with the key, as on the other endpoints. `tools/list` lists the tools the key's scopes allow: `kernel_info`, `kernel_schema`, `kernel_example`, `kernel_check` and `kernel_calculate` with `kernel`, `building_lookup` with `lod2`, `usage` with any key. Each tool call is limited, counted and metered as the endpoint it stands for: `kernel_calculate` counts as one calculation where `POST /v1/kernel/{method}` would (`din18599.run` with a result, `din18599.provisional`, `din18599.losses`, `calc.compute`; never the U-values and the limits; beyond the month's free calls every call that runs in the kernel, `kernel_check` too), `building_lookup` as one lookup when it finds a building, every other tool is free. A refusal of the API (unknown method, invalid input, quota, rate, no licence, no building, …) is a tool result with `isError: true` and this API's error (`kind`, `message`, the kind's fields, `retryAfter` in seconds where a 429 or 503 has `Retry-After`). A browser's request from another origin is 403. To try it: `claude mcp add --transport http bauzertifikate https://api.bauzertifikate.de/v1/mcp --header \"Authorization: Bearer $BZ_API_KEY\"`.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "A JSON-RPC 2.0 request or notification of MCP (`initialize`, `tools/list`, `tools/call`, …).",
                "required": [
                  "jsonrpc",
                  "method"
                ],
                "properties": {
                  "jsonrpc": {
                    "const": "2.0"
                  },
                  "id": {
                    "type": [
                      "string",
                      "integer"
                    ]
                  },
                  "method": {
                    "type": "string"
                  },
                  "params": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The JSON-RPC response: a tool's result, or a JSON-RPC error for a fault of the protocol",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "A JSON-RPC 2.0 response of MCP."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "202": {
            "description": "A notification, accepted"
          },
          "400": {
            "description": "Not a JSON-RPC request MCP takes, or a protocol version the server does not speak",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "No valid key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KernelReply"
                }
              }
            },
            "headers": {
              "WWW-Authenticate": {
                "description": "`Bearer realm=\"bauzertifikate\"`",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "description": "`forbidden`: a browser's request from another origin",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KernelReply"
                }
              }
            }
          },
          "413": {
            "description": "The request is larger than 2 MB",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: too many requests from this address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KernelReply"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "500": {
            "description": "`internal`: please send us the request id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KernelReply"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "eak_…"
      },
      "apiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      }
    },
    "headers": {
      "X-Quota-Limit": {
        "description": "This month's allowance (the Büro's, or the key's own cap where tighter): calculations on the kernel's routes, lookups on /v1/gebaeude",
        "schema": {
          "type": "integer"
        }
      },
      "X-Quota-Remaining": {
        "description": "What remains of it after this request; on the kernel's routes the distinct calculations left (a repeat of a calculation counted this month uses none)",
        "schema": {
          "type": "integer"
        }
      },
      "X-Request-Id": {
        "description": "The request's id; name it when you write to us",
        "schema": {
          "type": "string"
        }
      },
      "Deprecation": {
        "description": "RFC 9745: the version that answered is deprecated, since the date given as @<unix seconds>. Sent only by a version a newer minor or major replaces.",
        "schema": {
          "type": "string",
          "examples": [
            "@1799020800"
          ]
        }
      },
      "Sunset": {
        "description": "RFC 8594: from this HTTP date on the version is no longer on offer (410 version_gone).",
        "schema": {
          "type": "string",
          "examples": [
            "Thu, 04 Jan 2029 00:00:00 GMT"
          ]
        }
      },
      "Link": {
        "description": "`</v1/versions/{successor}>; rel=\"successor-version\"` beside Deprecation.",
        "schema": {
          "type": "string"
        }
      },
      "Retry-After": {
        "description": "Seconds to wait before trying again",
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      }
    },
    "schemas": {
      "KernelRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "input": {
            "description": "The method's input, as the version's schema describes it (format kernel-1). At most 1 MB. Its objects are closed: a field the method doesn't know is a 400 `request` with its path in `field`."
          },
          "version": {
            "type": "string",
            "description": "Exact (1.3.0) or a minor (1.3: its newest patch); default the newest",
            "pattern": "^\\d+\\.\\d+(\\.\\d+)?$"
          },
          "law": {
            "type": "string",
            "enum": [
              "gmodg-2027",
              "geg-2024"
            ],
            "default": "gmodg-2027",
            "description": "The law the results are rated under, with its edition of DIN 18599 (the kernel's options.law): `gmodg-2027` the GModG as in force from 1 January 2027 with DIN/TS 18599:2025-10, `geg-2024` the GEG as in force until 31 December 2026 with DIN V 18599:2018-09 (from 1.3.0, within that edition's scope). A law the version does not offer is 422 `unsupported` with its `laws`."
          },
          "require": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Tags the version must carry under the request's law, e.g. law:gmodg-2027 or norm:din-v-18599:2018-09; else 422 version_mismatch",
            "examples": [
              [
                "law:gmodg-2027"
              ]
            ]
          },
          "check": {
            "type": "boolean",
            "default": false,
            "description": "din18599.run only: the report (gaps, refusals, assumptions) without the result; not counted"
          },
          "summary": {
            "type": "boolean",
            "default": false,
            "description": "Leave out the monthly values"
          },
          "choices": {
            "type": "object",
            "additionalProperties": true,
            "description": "Choices the norm leaves open, by id, among those of the request's law: one of the choice's options. Another value than the version's for a choice that is not settable is refused (422 `unsupported`)."
          }
        }
      },
      "KernelReply": {
        "type": "object",
        "required": [
          "requestId",
          "warnings"
        ],
        "properties": {
          "ok": {
            "description": "The kernel's result"
          },
          "error": {
            "$ref": "#/components/schemas/KernelError"
          },
          "basis": {
            "$ref": "#/components/schemas/Basis"
          },
          "requestId": {
            "type": "string"
          },
          "warnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Warning"
            }
          }
        }
      },
      "KernelError": {
        "type": "object",
        "required": [
          "kind",
          "message"
        ],
        "additionalProperties": true,
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "request",
              "invalid",
              "missing",
              "input",
              "gaps",
              "scope",
              "unsupported",
              "validation",
              "climate_needed",
              "climate",
              "message",
              "internal",
              "unauthorized",
              "forbidden",
              "no_licence",
              "rate_limited",
              "quota_exceeded",
              "too_large",
              "unknown_method",
              "unknown_version",
              "no_schema",
              "version_gone",
              "version_mismatch",
              "busy",
              "timeout",
              "bad_query",
              "address_not_found",
              "no_data",
              "no_building",
              "ambiguous_address",
              "upstream"
            ],
            "description": "The kernel's kinds: `request` (400); `invalid`, `missing`, `unsupported`, `input`, `gaps`, `scope`, `message`, `validation`, `climate`, `climate_needed` (422; `climate_needed` names the `postcode` and `start` whose climate factors calc.compute needs); `internal` (500). The server's: the others. The building lookup's (`/v1/gebaeude`): `bad_query` (400), `address_not_found`, `no_data`, `no_building` (404), `ambiguous_address` (422), `upstream` (502), besides `unauthorized`, `forbidden`, `no_licence`, `rate_limited`, `quota_exceeded` and `internal`."
          },
          "message": {
            "type": "string"
          },
          "field": {
            "type": "string",
            "description": "The field the error is about: for `request` and the kernel's 422 kinds its path in the input, e.g. `b.zones[0].colour` for a field the method doesn't know; the request's own field (`version`, `law`, `check`, `choices.<id>`, `part`) for the server's"
          },
          "reason": {
            "type": "string",
            "description": "Why, e.g. serde's \"unknown field `colour`, expected one of …\""
          },
          "gaps": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "versions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "methods": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "missing": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "problems": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "`validation`: calc's problems, each with `code`, `message`, `period`"
          },
          "postcode": {
            "type": "string",
            "description": "`climate_needed`"
          },
          "start": {
            "type": "string",
            "description": "`climate_needed`"
          },
          "inFlight": {
            "type": "integer",
            "description": "`rate_limited` by the calls running: how many of a Büro's calls may run at once"
          },
          "parts": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "`no_schema`: the parts the version describes"
          },
          "laws": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "`request` or `unsupported` at `law`: the laws the API knows, or those the version offers"
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "`forbidden`: the key's scopes"
          },
          "addresses": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "`ambiguous_address`: the addresses that match",
            "examples": [
              [
                "Hauptstraße 1, 48161 Münster",
                "Hauptstraße 1, 48167 Münster"
              ]
            ]
          }
        }
      },
      "Basis": {
        "type": "object",
        "required": [
          "version",
          "tags",
          "deviations",
          "choices"
        ],
        "properties": {
          "version": {
            "type": "string",
            "examples": [
              "1.3.0"
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "examples": [
              [
                "law:gmodg-2027",
                "norm:din-ts-18599:2025-10",
                "norm:din-en-iso-6946:2018-03",
                "norm:din-en-iso-10077-1:2020-10",
                "climate:potsdam",
                "scope:residential",
                "status:pilot"
              ]
            ],
            "description": "The tags of the request's law: they name the law and the norm edition the answer was calculated under"
          },
          "released": {
            "type": "string",
            "format": "date",
            "description": "The version's date in the kernel's changelog"
          },
          "deviations": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Ids; the texts are in /v1/versions"
          },
          "choices": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "value"
              ],
              "properties": {
                "id": {
                  "type": "string"
                },
                "value": {}
              }
            }
          },
          "input": {
            "type": "object",
            "required": [
              "format",
              "hash"
            ],
            "properties": {
              "format": {
                "const": "kernel-1"
              },
              "hash": {
                "type": "string",
                "pattern": "^sha256:[0-9a-f]{64}$",
                "description": "SHA-256 of the input as compact JSON, keys sorted, numbers as written, no HTML escapes"
              }
            }
          }
        }
      },
      "Warning": {
        "type": "object",
        "required": [
          "id",
          "message"
        ],
        "properties": {
          "id": {
            "type": "string",
            "examples": [
              "not-converged",
              "no-result"
            ]
          },
          "message": {
            "type": "string"
          }
        },
        "description": "A remark on the answer: the kernel's (e.g. `not-converged`, `not-rated`), or this API's `no-result` on a din18599.run report without a result, which is not counted and carries no calculated values"
      },
      "Deviation": {
        "type": "object",
        "required": [
          "id",
          "text"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "text": {
            "type": "string"
          }
        }
      },
      "Choice": {
        "type": "object",
        "required": [
          "id",
          "value",
          "settable"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "value": {},
          "options": {
            "type": "array"
          },
          "settable": {
            "type": "boolean",
            "description": "Whether a request may set another option. A choice that is not settable may still be sent with its value; another value is `unsupported` (422)."
          },
          "text": {
            "type": "string"
          }
        },
        "description": "A point the norm leaves open, with the version's value. 1.3.0 takes ten, none settable: `partial-heating`, `standard-boiler-mixer`, `cooling-losses-feedback`, `fossil-room-heaters`, `convergence-measure`, `stove-direct-heat-months`, and since 1.2.0 listed, though the code took them before: `heat-pump-lowest-bin`, `heat-pump-heating-limit-bin`, `pump-management-further-boilers`, `solar-yield-expenditure`. Under `geg-2024` 1.3.0 takes one more, `final-energy-calorific-value` (`net`: the final energy and the class on the net calorific value), and `partial-heating` with its 2018 text."
      },
      "Law": {
        "type": "object",
        "required": [
          "law",
          "tags",
          "deviations",
          "choices"
        ],
        "description": "A law a version offers, with what an answer under it rests on.",
        "properties": {
          "law": {
            "type": "string",
            "examples": [
              "geg-2024"
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "examples": [
              [
                "law:geg-2024",
                "norm:din-v-18599:2018-09",
                "norm:din-en-iso-6946:2018-03",
                "norm:din-en-iso-10077-1:2020-10",
                "climate:potsdam",
                "scope:residential",
                "status:pilot"
              ]
            ]
          },
          "deviations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Deviation"
            }
          },
          "choices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Choice"
            }
          }
        }
      },
      "Version": {
        "type": "object",
        "required": [
          "version",
          "default",
          "tags",
          "released",
          "deprecated",
          "sunset",
          "successor",
          "deviations",
          "choices",
          "laws"
        ],
        "properties": {
          "version": {
            "type": "string"
          },
          "default": {
            "type": "boolean"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The default law's tags"
          },
          "released": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "The version's date in the kernel's changelog"
          },
          "deprecated": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Deprecated since (the Deprecation header's date); null while no newer minor or major replaces it"
          },
          "sunset": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Callable until the day before; 24 months after its successor's release at the earliest; null while it is not replaced"
          },
          "successor": {
            "type": [
              "string",
              "null"
            ],
            "description": "The version that replaces it; null while none does"
          },
          "deviations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Deviation"
            },
            "description": "The default law's"
          },
          "choices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Choice"
            },
            "description": "The default law's"
          },
          "laws": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Law"
            },
            "description": "The laws the version offers, the default first, each with its own tags, deviations and choices (from 1.3.0: `gmodg-2027` and `geg-2024`; before, `gmodg-2027` alone). An answer's basis is that of its request's law."
          }
        }
      },
      "VersionDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Version"
          },
          {
            "type": "object",
            "properties": {
              "methods": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "The methods this version offers through the API. A version tagged scope:residential leaves out din18599.reference_building, which calculates non-residential buildings alone."
              },
              "check": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "The methods that take check: true"
              },
              "schemas": {
                "type": "object",
                "additionalProperties": {
                  "type": "object",
                  "required": [
                    "input"
                  ],
                  "properties": {
                    "input": {
                      "type": "string",
                      "description": "The path of the input's JSON Schema"
                    },
                    "output": {
                      "type": "string",
                      "description": "The path of the result's JSON Schema (the answer's ok); from 1.2.0 on"
                    },
                    "answer": {
                      "type": "string",
                      "description": "The path of the whole answer's JSON Schema with a result; from 1.2.0 on"
                    }
                  }
                },
                "description": "By method, the paths of its schemas (GET /v1/versions/{version}/schemas/{method}?part=)",
                "examples": [
                  {
                    "din18599.run": {
                      "input": "/v1/versions/1.3.0/schemas/din18599.run",
                      "output": "/v1/versions/1.3.0/schemas/din18599.run?part=output",
                      "answer": "/v1/versions/1.3.0/schemas/din18599.run?part=answer"
                    }
                  }
                ]
              },
              "changelog": {
                "type": "string",
                "description": "The version's section of the kernel's changelog (Markdown)"
              },
              "requestId": {
                "type": "string"
              }
            }
          }
        ]
      },
      "KernelInfo": {
        "type": "object",
        "required": [
          "default",
          "versions",
          "law",
          "laws",
          "scope",
          "methods",
          "counts",
          "scopes",
          "licence"
        ],
        "properties": {
          "default": {
            "type": "string"
          },
          "versions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "law": {
            "type": "string",
            "examples": [
              "gmodg-2027"
            ],
            "description": "The default law, which a request without `law` is rated under"
          },
          "laws": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The laws the default version offers, the default first",
            "examples": [
              [
                "gmodg-2027",
                "geg-2024"
              ]
            ]
          },
          "scope": {
            "type": "string",
            "examples": [
              "residential"
            ]
          },
          "refused": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "methods": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "What this key may call; empty without the scope or a licence"
          },
          "counts": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "enum": [
                "result",
                "answer",
                "never"
              ]
            },
            "description": "How each method in `methods` counts against the allowance of calculations: `result` only when its report holds a result (`din18599.run`), `answer` with every answer (a 200), `never` (free, answered also when the allowance is used up). Empty when `methods` is",
            "examples": [
              {
                "calc.compute": "answer",
                "din18599.losses": "answer",
                "din18599.provisional": "answer",
                "din18599.run": "result",
                "iso10077.assembly_u_value": "never",
                "iso6946.component_u_value": "never",
                "limits.anlage7": "never",
                "limits.beg_em": "never"
              }
            ]
          },
          "check": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "lod2",
                "kernel",
                "bzf"
              ]
            }
          },
          "licence": {
            "type": "boolean"
          },
          "licenceValidUntil": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "With a licence in force: when it ends (the self-service beta's at 2027-01-01T00:00:00+01:00, so 31 December 2026 is its last day); null: no end. Absent without a licence"
          },
          "allowance": {
            "type": "object",
            "properties": {
              "limit": {
                "type": "integer"
              },
              "used": {
                "type": "integer"
              },
              "remaining": {
                "type": "integer"
              }
            }
          },
          "requestId": {
            "type": "string"
          },
          "freeCalls": {
            "type": "object",
            "required": [
              "limit",
              "used",
              "remaining"
            ],
            "description": "The month's free calls, with a licence in force: Calls that run in the kernel without counting are free up to ten times the licence's monthly calculations; beyond that every call that runs in the kernel counts as one calculation. Absent without a licence",
            "properties": {
              "limit": {
                "type": "integer",
                "examples": [
                  10000
                ]
              },
              "used": {
                "type": "integer"
              },
              "remaining": {
                "type": "integer"
              }
            }
          }
        }
      },
      "Gebaeude": {
        "type": "object",
        "required": [
          "gebaeudeId",
          "land",
          "adresse",
          "abstandM",
          "metrics",
          "attribution"
        ],
        "properties": {
          "gebaeudeId": {
            "type": "string",
            "examples": [
              "DENW36AL1000abcd"
            ]
          },
          "land": {
            "type": "string",
            "examples": [
              "NW"
            ]
          },
          "adresse": {
            "type": "object",
            "properties": {
              "label": {
                "type": "string"
              },
              "lon": {
                "type": "number"
              },
              "lat": {
                "type": "number"
              },
              "quelle": {
                "type": "string",
                "enum": [
                  "amtlich",
                  "osm"
                ]
              }
            }
          },
          "abstandM": {
            "type": "number",
            "description": "Abstand vom Adresspunkt zur Mitte des Grundrisses"
          },
          "lagebezeichnung": {
            "type": [
              "string",
              "null"
            ]
          },
          "funktion": {
            "type": [
              "string",
              "null"
            ]
          },
          "nurWohnzwecke": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "metrics": {
            "type": "object",
            "description": "Kennzahlen aus dem 3D-Modell (footprintArea, height, volume, roofArea, avRatio, …)",
            "additionalProperties": true
          },
          "geometrie": {
            "type": "object",
            "description": "Mit geometrie=1",
            "properties": {
              "ursprung": {
                "type": "object",
                "properties": {
                  "lon": {
                    "type": "number"
                  },
                  "lat": {
                    "type": "number"
                  }
                }
              },
              "bodenhoehe": {
                "type": "number"
              },
              "grundriss": {
                "type": "array"
              },
              "flaechen": {
                "type": "array"
              }
            }
          },
          "attribution": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "text": {
                  "type": "string"
                },
                "holder": {
                  "type": "string"
                },
                "license": {
                  "type": "string"
                },
                "licenseUrl": {
                  "type": "string"
                },
                "datasets": {
                  "type": "array"
                }
              }
            }
          }
        }
      },
      "Usage": {
        "type": "object",
        "required": [
          "period",
          "office",
          "licence",
          "allowance",
          "lookups",
          "methods",
          "inputs",
          "requestId"
        ],
        "properties": {
          "period": {
            "type": "object",
            "required": [
              "start",
              "end"
            ],
            "description": "This month, Europe/Berlin",
            "properties": {
              "start": {
                "type": "string",
                "format": "date-time"
              },
              "end": {
                "type": "string",
                "format": "date-time",
                "description": "When the allowance starts afresh"
              }
            }
          },
          "office": {
            "type": "boolean",
            "description": "true: the use of the key's Büro, all its keys; false: the key's own (a key from before Büros had keys)"
          },
          "licence": {
            "type": [
              "object",
              "null"
            ],
            "description": "The Büro's API licence; null without one",
            "properties": {
              "plan": {
                "type": "string",
                "examples": [
                  "Beta"
                ]
              },
              "validUntil": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time",
                "description": "When the licence ends, the first moment it no longer runs (the self-service beta's: 2027-01-01T00:00:00+01:00); null: no end. From then on the keys answer `no_licence`"
              },
              "termsVersion": {
                "type": "string"
              },
              "termsAccepted": {
                "type": "boolean"
              },
              "usable": {
                "type": "boolean",
                "description": "In force with the terms accepted, so the Büro's keys work"
              }
            }
          },
          "allowance": {
            "type": "object",
            "required": [
              "calculations",
              "freeCalls",
              "lookups"
            ],
            "properties": {
              "calculations": {
                "type": [
                  "object",
                  "null"
                ],
                "required": [
                  "limit",
                  "used",
                  "remaining"
                ],
                "description": "Calculations a month: distinct calculations among the counted answers of /v1/kernel/{method} (the same method, input, law, version and choices count once a month); null without an allowance of this kind: no licence in force with accepted terms, or a key from before Büros had keys",
                "properties": {
                  "limit": {
                    "type": "integer"
                  },
                  "used": {
                    "type": "integer"
                  },
                  "remaining": {
                    "type": "integer"
                  }
                }
              },
              "freeCalls": {
                "type": [
                  "object",
                  "null"
                ],
                "required": [
                  "limit",
                  "used",
                  "remaining"
                ],
                "description": "The month's free calls: Calls that run in the kernel without counting are free up to ten times the licence's monthly calculations; beyond that every call that runs in the kernel counts as one calculation. `used` are the calls that ran in the kernel without counting; null as `calculations`",
                "properties": {
                  "limit": {
                    "type": "integer",
                    "examples": [
                      10000
                    ]
                  },
                  "used": {
                    "type": "integer"
                  },
                  "remaining": {
                    "type": "integer"
                  }
                }
              },
              "lookups": {
                "type": [
                  "object",
                  "null"
                ],
                "required": [
                  "limit",
                  "used",
                  "remaining"
                ],
                "description": "Building lookups a month (/v1/gebaeude that found a building); null without an allowance of this kind: a Büro's key whose Büro has no licence in force with accepted terms (a key from before Büros had keys has its own)",
                "properties": {
                  "limit": {
                    "type": "integer"
                  },
                  "used": {
                    "type": "integer"
                  },
                  "remaining": {
                    "type": "integer"
                  }
                }
              }
            }
          },
          "lookups": {
            "type": "object",
            "required": [
              "total",
              "perDay"
            ],
            "description": "This month's building lookups that found a building (those that count against the allowance of lookups): the Büro's, all its keys together, or a key's own from before Büros had keys",
            "properties": {
              "total": {
                "type": "integer"
              },
              "perDay": {
                "type": "array",
                "description": "Days with lookups, the oldest first (Europe/Berlin)",
                "items": {
                  "type": "object",
                  "required": [
                    "day",
                    "lookups"
                  ],
                  "properties": {
                    "day": {
                      "type": "string",
                      "format": "date",
                      "examples": [
                        "2026-11-15"
                      ]
                    },
                    "lookups": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "methods": {
            "type": "array",
            "description": "The month's calls per endpoint and method, the most first; empty for a key from before Büros had keys",
            "items": {
              "type": "object",
              "required": [
                "endpoint",
                "method",
                "calls",
                "counted",
                "calculations",
                "free",
                "notCounted",
                "errors"
              ],
              "properties": {
                "endpoint": {
                  "type": "string",
                  "examples": [
                    "kernel"
                  ]
                },
                "method": {
                  "type": "string",
                  "examples": [
                    "din18599.run"
                  ]
                },
                "calls": {
                  "type": "integer"
                },
                "counted": {
                  "type": "integer",
                  "description": "Calls that counted: an answer with an energy balance of a building, or beyond the month's free calls any call that ran in the kernel"
                },
                "calculations": {
                  "type": "integer",
                  "description": "The distinct calculations among the counted calls: what they used of the allowance. The same calculation repeated in the month is one"
                },
                "free": {
                  "type": "integer",
                  "description": "Calls that ran in the kernel without counting: what they used of the month's free calls"
                },
                "notCounted": {
                  "type": "integer",
                  "description": "Checks, methods that never count, reports without a result, and errors"
                },
                "errors": {
                  "type": "array",
                  "description": "The errors by kind and HTTP status, the most first",
                  "items": {
                    "type": "object",
                    "required": [
                      "kind",
                      "status",
                      "calls"
                    ],
                    "properties": {
                      "kind": {
                        "type": "string",
                        "examples": [
                          "gaps"
                        ]
                      },
                      "status": {
                        "type": "integer",
                        "examples": [
                          422
                        ]
                      },
                      "calls": {
                        "type": "integer"
                      }
                    }
                  }
                }
              }
            }
          },
          "inputs": {
            "type": "object",
            "required": [
              "distinct",
              "withResult"
            ],
            "description": "Distinct inputs (buildings, by the input's hash)",
            "properties": {
              "distinct": {
                "type": "integer"
              },
              "withResult": {
                "type": "integer",
                "description": "Of them, those that had a result"
              }
            }
          },
          "requestId": {
            "type": "string"
          }
        }
      }
    }
  }
}
