How to get Quote usage/ X-RATELIMIT in JS

I am new to all this. I have directions working but I cannot find how to get ORS to return how much of my quota has been used.
I am using code copied from the API documentation but I cannot see the X-Ratelimit in the response. I found that if you are using curl you need to use -d option but I cannot find what you need to do if using JavaScript.
any help gratefully received
My code follows

let request = new XMLHttpRequest();'POST', "");

request.setRequestHeader('Accept', 'application/json, application/geo+json, application/gpx+xml, img/png; charset=utf-8');
request.setRequestHeader('Content-Type', 'application/json');
request.setRequestHeader('Authorization', 'xxxxxxxxxxxxxxxxxx');

request.onreadystatechange = function () {
    if (this.readyState === 4) {
        console.log('Status:', this.status);
        console.log('Headers:', this.getAllResponseHeaders());
        console.log('Body:', this.responseText);
        if (this.status === 200) {
            var data = JSON.parse(this.responseText);
            var geometry = data.features[0].geometry;
            var latlngs = ragetLatlngs(geometry.coordinates);

            var l = new L.Polyline(latlngs, {
                color: '#782327',
                weight: 3,
                opacity: 1
  'upload:addline', {line: l});

var body = {};
body.instructions = false;
body.coordinates = [];
body.geometry_simplify = true;
var i = 0;
var len = latlngs.length;
for (i = 0; i < len; i++) {
    // change to long/lat rather than lat/long
    body.coordinates[i] = [];
    body.coordinates[i][0] = latlngs[i].lng;
    body.coordinates[i][1] = latlngs[i].lat;
var search = JSON.stringify(body);


Hi @chrisvaughan,

the Quota headers are now exposed, so JS should be able to pick them up.

Best regards

That’s great , thanks for the quick response, sorry I took awhile.