There is no product key you can use on this one. The key is for the OEM version and you don't have that dvd. I don't think it's necessary to go over how this works. Windows 8 should have a reset option in the menu. I didn't see any change from 8 to 8.1 so no need to correct this here.
See Remove everything and install Windows 8.1 at https://support.microsoft.com/en-us/help/17085/windows-8-restore-refresh-reset-pc
If you proceed with what you propose, you will be very upset at having to order HP's recovery media.
I aquired an hp desktop computer from the family of my neighbor whom passed away!
The os is windows 8.1! I have windows 8 recovery disk for the same model computer but they are not for this particluar computer.
I would like to downgrade to windows 8 from 8.1 because of all files that are there from the now deceased neighbor. My concern is the product key. I can locate the product key but now sure it will work with an 8 reinstall.