For the first 20 floors, the key spawn requirements are fixed. While floor 20 has the final boss, the key can still spawn for the purposes of completing all tasks.
Floor |Condition 1 |Kill a certain number of regular enemies. 2 |Kill the blue or green rat. 3-5 |Kill a certain number of regular enemies. 6 |Kill the blue or green rat. 7 |Kill a certain number of regular enemies. 8 |Kill the black knight. 9 |Kill a certain number of regular enemies. 10 |Kill the smallest purple slime to activate the key in the same room. 11 |Kill a certain number of regular enemies. 12 |Kill the black knight holding the key. 13 |Kill the smallest purple slime to activate the key in the same room. 14 |Kill a certain number of regular enemies. 15 |Kill the red knight. 16 |Kill the smallest purple slime to activate the key in the same room. 17 |Kill the black knight holding the key. 18 |Kill the tiny golem to activate the key, found in a random room. 19 |Kill the red knight. 20 |Kill a certain number of regular enemies.