Skip to main content
POST
routes.compute-electric

Authorizations

Authorization
string
header
required

API key: sk_live_…

Headers

Idempotency-Key
string

Optional. A retry with the same key returns the stored result.

Maximum string length: 255
Pramaan-Max-Price-Micro
string

Optional. The most this request may be priced at, in micro-USD (a whole number above 0). It replaces the capability's own price ceiling for this request, lower or higher. Sources that could cost more are left out; when none is left the answer is 400 with the lowest limit that would work.

Pattern: ^[1-9]\d{0,14}$

Body

application/json
origin
object
required

Route origin.

destination
object
required

Route destination.

currentChargeKwh
number
required

Battery energy available at departure, in kilowatt-hours.

Required range: 0 <= x <= 100000
maxChargeKwh
number
required

Usable battery capacity in kilowatt-hours.

Required range: x <= 100000
consumption
object[]
required

Speed-dependent consumption curve with unique speeds.

Required array length: 2 - 25 elements
chargingConnectors
object[]
required

Connectors the vehicle can use.

Required array length: 1 - 20 elements
chargingCurve
object[]
required

Increasing battery energy and power points, starting at zero.

Required array length: 2 - 20 elements
via
object[]

Waypoints visited in order, up to 98.

Maximum array length: 98
minArrivalChargeKwh
number
default:0

Minimum battery energy at the destination.

Required range: x >= 0
minStopChargeKwh
number
default:0

Minimum battery energy on arrival at a charging stop.

Required range: x >= 0
departureAt
string<date-time>

Departure time, including timezone.

Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
arrivalAt
string<date-time>

Desired arrival time, including timezone; excludes departureAt.

Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
alternatives
integer
default:0

Alternative routes, up to 5; default none.

Required range: 0 <= x <= 5
avoid
enum<string>[]

Road types to avoid.

Maximum array length: 4
Available options:
tolls,
motorways,
ferries,
unpaved-roads
vehicleType
enum<string>
default:car

Vehicle type; default car.

Available options:
car,
truck,
bus,
van,
motorcycle
vehicleHeightMeters
number

Vehicle height in meters.

vehicleWidthMeters
number

Vehicle width in meters.

vehicleLengthMeters
number

Vehicle length in meters.

vehicleWeightKg
integer

Vehicle weight in kilograms.

Required range: x <= 9007199254740991
auxiliaryPowerKw
number

Auxiliary systems power in kilowatts.

Required range: x >= 0

Response

The result

routes
object[]
required

Main route and optional alternatives.

Required array length: 1 - 6 elements