Wondering why the community search did not reveal this.
Nevertheless getting the ID and TOKEN via a rest call would be helpful, or if you don't want to go the way of manually getting the installation parameters and copying the tokens from there.
Ideally I want to call the server management API, search for environments (tenants by name) and then get the tokens from there.
Well token is rather something static that you pre-configure to use it in your automation scripts. TENANT_ID for all environments probably could be retrieved automatically if that helps you.