Almost everything on Netlify works using APIs, so this is possible as well (just undocumented - thus subject to change).
The URL to call is:
https://app.netlify.com/access-control/bb-api/api/v1/oauth/applications/create_token
with POST
method and data as: {"name":"key-name","administrator_id":null}
.
You’ll get the token as response in response.token.id
.
Check out: