A trainer to the stars who boasts of giving women a leg up in life fired a loyal employee after she got hurt on the job, according to a lawsuit.

Beloved by Shakira, Kelly Ripa and models Karlie Kloss and Ashley Graham, Anna Kaiser heads a growing chain of gyms with dance-inspired workouts.

“I want to make every woman feel stronger and more confident in her skin,” Kaiser wrote in a recent Instagram post. “If I can give each woman even a single moment where she is able to let go and fly, that is true success for me.”

But Ariel Hoffman, a longtime trainer with Kaiser’s AKT in Motion, claims her boss turned on her when Hoffman needed surgery for an injured hip, according to her Manhattan Supreme Court suit.

Hoffman, 39, says she got hurt pushing her body “to the limit” at the gym, where she handled private clients, worked up classes and created a curriculum for other trainers for the chain, which has locations on the Upper East Side, downtown Manhattan, the Hamptons, California and Connecticut.

The result was a “devastating” diagnosis in 2015: a labral tear in her hip, which required an operation to repair, the suit says.

Kaiser was less than sympathetic, her ex-employee claims.

The owner fired off “demeaning, belittling and accusatory e-mails and text messages” — and told other workers that Hoffman’s surgery was “elective,” according to the suit. She also slashed her pay, it says.

Hoffman, who claims she “gave her life” to AKT, says she put off the operation for nearly two years.

She was so panicked about missing work she “lost sleep, she couldn’t eat and she worried about her future as she relied on her ability to perform extremely physical tasks,” Hoffman’s court papers recount.

When the trainer told Kaiser of her “extreme pain” and asked for a less demanding workload, the boss replied, “I guess we’ll figure it out,” Hoffman claims.

She ultimately opted for a less invasive arthroscopic procedure with a six-week recovery.

Two months later, Kaiser canned her, her filing states.

Hoffman’s lawyer, Megan Goddard, called her client a fighter who “does not accept her rights being trampled upon, and neither do I. Ariel and I look forward to obtaining justice in this matter.”

Reps for Kaiser and AKT called Hoffman’s claims “baseless.”