What the keys do in Slay the Spire can be confusing when you start your new playthrough. After you complete your first run of Slay the Spire with the Ironclad, the Defect, and the Silent you have the opportunity to replay the game again, but this time you can collect three keys and enter the additional Act 4. The three keys which are the Ruby, Emerald, and Sapphire key are all obtained by doing optional challenges during a run. If the player defeats the Act 3 boss with all three of the keys in their position they will move onto Act 4.
How to get the Ruby key?
The Ruby key can be acquired at rest sites throughout the game. When the player enters the rest site they are given the option to forgo healing or upgrading a card in order to receive the ruby key.
The Ruby key can be acquired at any time you enter a rest site, and during runs, I recommend only going for this key if you feel comfortable in the strength of your deck and player health. This can be very tricky to get if you are in a difficult seed, or have a weaker deck to play around with.
How to get the Emerald key?
The Emerald key can only be obtained once in each act. The Emerald key is obtained by killing a buffed version of an elite encounter. In the map screen, the player will be able to know which encounter this is by an animated flame surrounding the elite character icon.
This is the hardest key to get, and a run can realistically end on this encounter as the difficulty of these buffed elite encounters can be rather high. However, because you know which encounter this is in the beginning I would suggest routing a plan that lets you get this key earlier. Elite encounters are harder in acts 2 and 3 unless you luck out, and have a very powerful build.
How to get the Sapphire key?
When entering a treasure room the player will be given an option of picking a relic or picking the sapphire key. The sapphire key will appear to be locked to a relic and to obtain it all you have to do is just select the key. This key will show up in every treasure room until it is selected.
The sapphire key is the easiest key to obtain, as it can be collected very passively during a run. The choice can be easy to make depending on the relic that you will miss out on. Forgo picking up the key if you are being offered a very high powered relic, but if you are offered a low-quality relic than picking up the key is a no brainer.
What the keys do in Slay the Spire?
If you end a run with all three of the keys, and defeat the boss at the end of Act 3 then you will automatically move onto Act 4. Act 4 is a very challenging final section, and you should prepare accordingly for the next set of battles.
If you are interested in more games like Slay the Spire I would suggest reading this article on games that are similar to Slay the Spire.