Demand flexibility has emerged as an innovative approach to address the challenges faced by electricity customers and utilities in recent times. Demand response (DR) programmes are effectively used to enable load flexibility, flatten the load pattern and reduce electricity bills. This paper proposes an optimal price-based DR framework using a time-of-use pricing model tailored to different customer classes. The problem aims at minimizing peak-to-valley ratios and energy consumption costs and is solved using the chaos-embedded Monarch Butterfly algorithm. Furthermore, a fuzzy k-medoids clustering algorithm is applied to segment a day into three distinct periods, i.e. peak, flat, and valley. Numerical simulations are performed on a modified IEEE 30 bus system with industrial, residential, and commercial zones. The results demonstrate the effectiveness of class-based DR programmes in optimizing costs and bill savings. It also reduces peak demand and power losses by 138.14 and 15.72 MW, respectively, during peak periods.