If this API key never changes, the best way to package it is to use protected custom metadata. Then, you can add the custom metadata record with your key to your package.
If customers can set the key, create a custom LWC where customers can enter the key. Store the key in a protected hierarchical custom setting at the org level. You could use custom metadata as well but that's much more complicated than using a custom setting. In case uou want to go for custom metadata, you need to use Apex Metadata, but a custom setting you can simple save using DML.
Just so you know, the LWC shouldn't show any saved values. Even obfuscating the key through a password field won't pass security review. Your LWC should check if the key is valid, store the key, and then let the user know the key has been successfully stored but not show it 'back' to the user.
In any case, the essence is that the key should be stored in a protected way and not in the open.