We all know how to do it right, but particularly early on in a project it's easy to test something with a hardcoded API key, then forget and commit it.
Picking a framework that makes this a less obvious choice (e.g using a .env file that's already in gitignore by default) helps a lot here.