the tags can be assigned on the fly. At any point in time, a new datapoint with never seen tag keys and values might be stored. So there is no definition of legal or available tag keys and values. That's part of how you design your metrics and can only be controlled in your monitoring setup or application, respectively.
Currently the most direct way to get all tags stored is probably via the tree API, which requires, however, that you have enabled it and have trees defined. And direct means in this case you have to traverse the complete tree and collect the information you require on your way.
But again you would need to iterate over all timeseries to find out what tags are available. But that's easier than using the tree API.