{"openapi":"3.1.0","info":{"title":"Energy Cost API","version":"1.0.0","description":"Electricity cost maths as an API, computed locally and deterministically and entirely currency-agnostic. The cost endpoint works out an appliance's energy use and running cost from its power (watts or kilowatts), the hours used per day and a per-kilowatt-hour tariff — returning the kilowatt-hours and the cost per day, week, month and year, with an optional quantity of identical devices. The compare endpoint pits two appliances against each other: it computes each one's annual energy cost, the saving from the more efficient one, and — given the extra purchase price of the better model — the payback period in years and months. The convert endpoint relates watts, hours and kilowatt-hours: give any two and it returns the third, plus the cost at a tariff. Everything is computed locally and deterministically, so it is instant and private. Kilowatt-hours equal power in kilowatts times hours, and cost equals kilowatt-hours times the rate; months use 365/12 days. Ideal for energy-saving and smart-home apps, appliance comparison and retail tools, sustainability dashboards, and budgeting software. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is energy-cost maths; for battery capacity and runtime use a battery API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/energycost-api","description":"oanor gateway"}],"tags":[{"name":"Energy"},{"name":"Meta"}],"components":{"securitySchemes":{"oanorKey":{"type":"apiKey","in":"header","name":"x-oanor-key","description":"Get your key at https://www.oanor.com/developer/keys"}}},"security":[{"oanorKey":[]}],"paths":{"/v1/compare":{"get":{"operationId":"get_v1_compare","tags":["Energy"],"summary":"Compare two appliances + payback","description":"","parameters":[{"name":"power_a","in":"query","required":true,"description":"Device A power","schema":{"type":"string"},"example":"100"},{"name":"hours_a","in":"query","required":true,"description":"A hours/day","schema":{"type":"string"},"example":"5"},{"name":"power_b","in":"query","required":true,"description":"Device B power","schema":{"type":"string"},"example":"60"},{"name":"hours_b","in":"query","required":true,"description":"B hours/day","schema":{"type":"string"},"example":"5"},{"name":"rate","in":"query","required":true,"description":"Tariff per kWh","schema":{"type":"string"},"example":"0.30"},{"name":"extra_cost","in":"query","required":false,"description":"Extra price of B (for payback)","schema":{"type":"string"}},{"name":"days","in":"query","required":false,"description":"Days/year (default 365)","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Positive annual_saving_with_b means device B costs less to run. Payback uses the extra purchase cost of B ÷ annual saving.","input":{"days":365,"extra_cost":0,"rate_per_kwh":0.3},"cheaper":"b","device_a":{"power_kw":0.1,"annual_kwh":182.5,"annual_cost":54.75,"hours_per_day":5},"device_b":{"power_kw":0.06,"annual_kwh":109.5,"annual_cost":32.85,"hours_per_day":5},"annual_saving_with_b":21.9},"meta":{"timestamp":"2026-06-04T01:59:20.495Z","request_id":"bd09315c-e754-4b95-8118-5b10c1f3009b"},"status":"ok","message":"Compare appliances","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/convert":{"get":{"operationId":"get_v1_convert","tags":["Energy"],"summary":"Watts / hours / kWh / cost","description":"","parameters":[{"name":"watts","in":"query","required":false,"description":"Power (W)","schema":{"type":"string"},"example":"1500"},{"name":"hours","in":"query","required":false,"description":"Hours","schema":{"type":"string"},"example":"2"},{"name":"kwh","in":"query","required":false,"description":"Or kWh","schema":{"type":"string"}},{"name":"rate","in":"query","required":false,"description":"Tariff per kWh (for cost)","schema":{"type":"string"},"example":"0.25"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"kwh":3,"cost":0.75,"note":"kWh = watts ÷ 1000 × hours. Cost = kWh × rate.","hours":2,"watts":1500,"rate_per_kwh":0.25},"meta":{"timestamp":"2026-06-04T01:59:20.593Z","request_id":"8716eb9e-e174-45ed-8dbe-7496e92f53ff"},"status":"ok","message":"Watts / hours / kWh","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/cost":{"get":{"operationId":"get_v1_cost","tags":["Energy"],"summary":"Appliance running cost","description":"","parameters":[{"name":"power","in":"query","required":true,"description":"Power","schema":{"type":"string"},"example":"100"},{"name":"power_unit","in":"query","required":false,"description":"w|kw (default w)","schema":{"type":"string"},"example":"w"},{"name":"hours_per_day","in":"query","required":true,"description":"Hours used per day","schema":{"type":"string"},"example":"5"},{"name":"rate","in":"query","required":true,"description":"Tariff per kWh","schema":{"type":"string"},"example":"0.30"},{"name":"quantity","in":"query","required":false,"description":"Number of devices","schema":{"type":"string"},"example":"1"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"kwh":{"per_day":0.5,"per_week":3.5,"per_year":182.5,"per_month":15.208},"cost":{"per_day":0.15,"per_week":1.05,"per_year":54.75,"per_month":4.56},"note":"kWh = power (kW) × hours. Cost = kWh × rate. Months use 365/12 days.","input":{"power_kw":0.1,"quantity":1,"rate_per_kwh":0.3,"hours_per_day":5}},"meta":{"timestamp":"2026-06-04T01:59:20.694Z","request_id":"28b82b39-0a8a-46f7-bf1d-7ce27af0f845"},"status":"ok","message":"Running cost","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/meta":{"get":{"operationId":"get_v1_meta","tags":["Meta"],"summary":"Spec","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Currency-agnostic. kWh = power (kW) × hours; cost = kWh × rate. Months use 365/12 days.","service":"energycost","endpoints":{"/v1/cost":"Running cost (per day/week/month/year) from power, hours per day and a per-kWh rate.","/v1/compare":"Compare two appliances' running cost and the payback of a more efficient one.","/v1/convert":"Convert between watts, hours and kWh, with optional cost at a tariff."},"description":"Energy cost maths: appliance running cost, appliance comparison with payback, and energy/power/cost conversion."},"meta":{"timestamp":"2026-06-04T01:59:20.793Z","request_id":"a61bf85c-00fc-492a-8700-7c9da0c56d9a"},"status":"ok","message":"Meta","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}}},"x-oanor-pricing":[{"slug":"free","name":"Free","price_cents_month":0,"monthly_call_quota":10635,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":1215,"monthly_call_quota":20250,"rps_limit":8,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":3205,"monthly_call_quota":252500,"rps_limit":20,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":7005,"monthly_call_quota":1305000,"rps_limit":50,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/energycost-api"}