Skip to content
GET /v1/cost

Charge cost including losses

Try it live

10 free calls per day — no sign-up, no API key. Goes through the oanor gateway.

Custom headers (optional)
api.oanor.com/evcharging-api

It works. Grab an API key and use it in your project.

Get an API key

Code snippets

curl "https://api.oanor.com/evcharging-api/v1/cost" \
  -H "x-oanor-key: oanor_test_..."
await fetch("https://api.oanor.com/evcharging-api/v1/cost", {
  headers: { "x-oanor-key": "oanor_test_..." }
});
$ch = curl_init("https://api.oanor.com/evcharging-api/v1/cost");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["x-oanor-key: oanor_test_..."]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$out = curl_exec($ch);
import requests
requests.get(
    "https://api.oanor.com/evcharging-api/v1/cost",
    headers={"x-oanor-key": "oanor_test_..."}
)

Example response

A real response from this endpoint, captured by the latest health check.

{
    "data": {
        "note": "You pay for the energy drawn from the grid, which is the energy to the battery ÷ the charging efficiency (~85–95 %), times the price. Home overnight rates make EV miles very cheap; DC fast chargers cost several times more per kWh, so charge at home when you can and use fast charging for trips.",
        "inputs": {
            "price_per_kwh": 0.15,
            "charge_efficiency_pct": 90,
            "energy_to_battery_kwh": 36
        },
        "grid_kwh": 40,
        "charge_cost": 6,
        "cost_per_kwh_to_battery": 0.167
    },
    "meta": {
        "timestamp": "2026-06-06T23:53:56.277Z",
        "request_id": "b1f28584-c787-400d-ae64-9dc4055546ee"
    },
    "status": "ok",
    "message": "Charge cost",
    "success": true
}