Consensual sex is legal. But as soon as one party offers cash to another in exchange for sex and that money is voluntarily accepted, it’s considered prostitution, and that is illegal.