{
  "openapi": "3.1.0",
  "info": {
    "title": "CalculateEnergySavings.com Public Calculator API",
    "version": "1.0.0",
    "description": "Versioned, read-only calculator catalog and credentialed stateless energy screening calculations. Calculation use is governed by the CES API Usage Terms at https://calculateenergysavings.com/api-terms/. The public API does not expose CES Pro, Synkronos maintenance, customer, billing, or utility-bill data.",
    "termsOfService": "https://calculateenergysavings.com/api-terms/"
  },
  "x-ces-provider": {
    "name": "CalculateEnergySavings.com",
    "source_url": "https://calculateenergysavings.com/",
    "terms_url": "https://calculateenergysavings.com/api-terms/",
    "terms_version": "2026-08-25"
  },
  "servers": [
    {
      "url": "https://calculateenergysavings.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "CesApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-CES-API-Key",
        "description": "A CES-issued API key with current terms acceptance and an active attribution or white-label license."
      }
    }
  },
  "paths": {
    "/api/v1/calculators": {
      "get": {
        "operationId": "listCalculators",
        "summary": "List published CES calculators",
        "responses": {
          "200": {
            "description": "Calculator catalog"
          }
        }
      }
    },
    "/api/v1/calculators/{calculatorId}": {
      "get": {
        "operationId": "getCalculator",
        "summary": "Get calculator metadata, inputs, examples, and methodology links",
        "parameters": [
          {
            "name": "calculatorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Calculator definition"
          },
          "404": {
            "description": "Unknown calculator"
          }
        }
      }
    },
    "/api/v1/calculators/{calculatorId}/calculate": {
      "post": {
        "operationId": "calculateEnergySavings",
        "summary": "Run a stateless screening calculation",
        "security": [
          {
            "CesApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "calculatorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "inputs": {
                    "type": "object",
                    "additionalProperties": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Structured screening results with source, version, citation, and attribution requirements"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "403": {
            "description": "Current API terms have not been accepted"
          },
          "404": {
            "description": "Unknown calculator"
          },
          "409": {
            "description": "Calculator is not callable"
          },
          "429": {
            "description": "Per-minute rate limit or monthly quota exceeded"
          }
        }
      }
    }
  }
}