How to save the last API key?