Toothless swallowed metals, but it is not good for him. When Hiccup was trapped in the log cage in Berserker Island, he met Excellinor the Witch and she performed a surgery on Toothless by removing metals from the stomach. One of the items is a key. When Excellinor attempted to kill Hiccup, he escaped by unlocking the cage with the key.
The key opens all locks made by Hysterics, with this ability Hiccup escaped out of traps many times.
The key allows someone to become King of the Wilderwest with the other lost things.