Firebase API key in deployment

If I set proper rules on my firebase database, does it make sense to leave the API key in the app?

Thank you

What do you mean by proper rule?

I mean, I see I have to put my API key in the project in order to access the database.
However, if I set proper access rules in firebase where I limit authenticated users to a certain chunk of the database - does that make it safe? Or it doesn’t even make sense?