mw.api.getToken uses api.php?action=tokens
api.php?action=tokens generates
"warnings": { "tokens": { "*": "action=tokens has been deprecated. Please use action=query&meta=tokens instead." } }
api.php?action=query&meta=tokens has different token types. A simple change of the URL does not work because this changes the JavaScript API. mw.api.getToken has to implement a mapping from the current token types to the corresponding new token type.