Question related to premium of an option contract

How is the premium of a option contract is decided ? Is it based on supply and demand or OI (open interest) or is there any predefined algorithm which decides options price ?