The notable difference is that the base Huggingface library is open source, so you could in theory build something similar or more custom to the OpenAI API internally (which then falls into the typical cost/benefit analysis of doing so).
So its like Github vs Gitlab which makes more sense. I can see huggingface have a hosted version because now you can share your models on their platform.