{
 "openapi": "3.1.0",
 "info": {
  "title": "CIMC telecom diesel-to-gas calculator API",
  "version": "1.0",
  "summary": "Indicative diesel genset vs LNG (CIMC virtual pipeline) economics for telecom base-station clusters.",
  "description": "Read-only, no authentication. Same formulas and numbers as the calculator at https://cimcenergysystem.com/tools/telecom-diesel-to-gas-calculator. Indicative, preliminary estimate; not a quotation. Errors are returned as HTTP 200 with ok=false and an errors list. The response body is JSON; the server labels it text/html, so parse the body as JSON.",
  "contact": {
   "name": "CIMC ENRIC Energy Systems",
   "url": "https://cimcenergysystem.com/contactus"
  }
 },
 "servers": [
  {
   "url": "https://cimcenergysystem.com"
  }
 ],
 "externalDocs": {
  "description": "Model specification (inputs, parameters, formulas, worked example, test vectors)",
  "url": "https://cimcenergysystem.com/api/tools/telecom-d2g/model.json"
 },
 "paths": {
  "/api/tools/telecom-d2g": {
   "get": {
    "operationId": "computeTelecomDieselToGas",
    "summary": "Compute fuel cost per kWh, logistics, saving, investment and payback for a telecom site cluster",
    "parameters": [
     {
      "name": "sites",
      "in": "query",
      "required": false,
      "description": "Number of sites (10-2000). Default 500.",
      "schema": {
       "type": "integer",
       "minimum": 10,
       "maximum": 2000,
       "default": 500
      }
     },
     {
      "name": "lng_supply",
      "in": "query",
      "required": false,
      "description": "existing = Existing LNG source; new_plant = New regional liquefaction plant. Both options are always returned; this selects the 'selected' block.",
      "schema": {
       "type": "string",
       "enum": [
        "existing",
        "new_plant"
       ],
       "default": "existing"
      }
     },
     {
      "name": "night_load_kw",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number",
       "minimum": 5,
       "maximum": 80,
       "default": 22
      },
      "description": "Night genset load, kW."
     },
     {
      "name": "night_hours",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number",
       "minimum": 1,
       "maximum": 24,
       "default": 12
      },
      "description": "Night hours on genset, h/night."
     },
     {
      "name": "diesel_usd_per_l",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number",
       "minimum": 0.4,
       "maximum": 4.0,
       "default": 1.5255721176513255
      },
      "description": "Delivered diesel price at the site, USD/L. Default is the Brazil example (shown as 1.53)."
     },
     {
      "name": "gas_usd_per_mmbtu",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number",
       "minimum": 4,
       "maximum": 30,
       "default": 12
      },
      "description": "Your own gas price, USD/MMBtu."
     }
    ],
    "responses": {
     "200": {
      "description": "Result (ok=true) or validation errors (ok=false).",
      "content": {
       "application/json": {
        "schema": {
         "oneOf": [
          {
           "$ref": "#/components/schemas/Result"
          },
          {
           "$ref": "#/components/schemas/Error"
          }
         ]
        },
        "example": {
         "ok": true,
         "inputs": {
          "sites": 500,
          "lng_supply": "existing",
          "night_load_kw": 22.0,
          "night_hours": 12.0,
          "diesel_usd_per_l": 1.5255721176513255,
          "gas_usd_per_mmbtu": 12.0
         },
         "fuel_cost_per_kwh": {
          "diesel_genset_usd_per_kwh": 0.4576716352953976,
          "lng_cimc_virtual_pipeline_usd_per_kwh": 0.20322538186425307,
          "lng_breakdown_usd_per_kwh": {
           "gas_molecule": 0.16353473684210526,
           "liquefaction_electricity": 0.022955465587044536,
           "road_freight": 0.016735179435103272
          },
          "diesel_genset_us_cents_per_kwh": 45.767163529539765,
          "lng_cimc_virtual_pipeline_us_cents_per_kwh": 20.322538186425305
         },
         "lng_supply_options": {
          "existing": {
           "label": "Existing LNG source",
           "net_annual_saving_usd": 12259220.490312546,
           "total_investment_usd": 20675000,
           "simple_payback_years": 1.6864856959166166
          },
          "new_plant": {
           "label": "New regional liquefaction plant",
           "net_annual_saving_usd": 11634220.490312546,
           "total_investment_usd": 45675000,
           "simple_payback_years": 3.9259183748522
          }
         },
         "selected": {
          "lng_supply": "existing",
          "net_annual_saving_usd": 12259220.490312546,
          "total_investment_usd": 20675000,
          "simple_payback_years": 1.6864856959166166
         }
        }
       }
      }
     }
    }
   }
  }
 },
 "components": {
  "schemas": {
   "Option": {
    "type": "object",
    "properties": {
     "label": {
      "type": "string"
     },
     "net_annual_saving_usd": {
      "type": "number"
     },
     "total_investment_usd": {
      "type": "number"
     },
     "simple_payback_years": {
      "type": [
       "number",
       "null"
      ],
      "description": "null when the net annual saving is zero or negative"
     }
    }
   },
   "Result": {
    "type": "object",
    "required": [
     "ok",
     "inputs",
     "fuel_cost_per_kwh",
     "lng_supply_options",
     "selected"
    ],
    "properties": {
     "ok": {
      "const": true
     },
     "inputs": {
      "type": "object"
     },
     "fuel_cost_per_kwh": {
      "type": "object",
      "properties": {
       "diesel_genset_usd_per_kwh": {
        "type": "number"
       },
       "lng_cimc_virtual_pipeline_usd_per_kwh": {
        "type": "number"
       },
       "lng_breakdown_usd_per_kwh": {
        "type": "object"
       },
       "diesel_genset_us_cents_per_kwh": {
        "type": "number"
       },
       "lng_cimc_virtual_pipeline_us_cents_per_kwh": {
        "type": "number"
       }
      }
     },
     "energy": {
      "type": "object"
     },
     "logistics": {
      "type": "object"
     },
     "annual_costs_usd": {
      "type": "object"
     },
     "capex_usd": {
      "type": "object"
     },
     "lng_supply_options": {
      "type": "object",
      "properties": {
       "existing": {
        "$ref": "#/components/schemas/Option"
       },
       "new_plant": {
        "$ref": "#/components/schemas/Option"
       }
      }
     },
     "selected": {
      "type": "object"
     },
     "disclaimer": {
      "type": "string"
     }
    }
   },
   "Error": {
    "type": "object",
    "properties": {
     "ok": {
      "const": false
     },
     "errors": {
      "type": "array",
      "items": {
       "type": "string"
      }
     }
    }
   }
  }
 }
}