If you have the extended warranty, you can get your key fob replaced for free for the duration of your warranty (usually three years or 36,000 miles). After this point, key fob replacement will be on you, the buyer.
It’s also possible that the problems you’re experiencing are with your car, not your key fob. If this is the case, the repairs may actually be covered under warranty. You won’t know for sure until you visit your dealership.