The city charges the taxi company or the private owner, for a special medallion that looks sort of like an oversized police badge.
If you have the medallion on your car, it is legal to operate as a taxi cab. No medallion = not a licensed taxi.
Due to NYC having a population of about 8 million and only about 12,000 taxis, city council has found out that they can charge about $350K per new medallion issued. This guy saved $180K per car, for 18 cars.