Interesting! Someone help us out and tell us how to do it!
Don't initially store/ship the API keys with your application.
What if you take and create a text file containing the API keys and url endpoints.
Don't initially store/ship the API keys/URL endpoints with your application.
Don't store/ship the password(s) with your application.
Initially, when the application is run for the first time, have a user authenticate via username/password over the internet (or your local network). Upon successful authentication, provide your user's application with the API keys and URL endpoints that they are allowed to have access to (and only those that they should have access to). You can save the API keys/URL endpoints on the device. The only time you have an issue here is
1) Device gets lost/stolen. Have policies/training in place for informing you (or whoever is in charge of security) as quickly as possible so as to invalidate the API key(s). Once the API key(s) are invalid, no more access is granted. One could still be in possession of the URL endpoints, but without valid API key(s), that is not an issue.
Edit: Use keystore(s) (comment below) for tokens and possibly URL endpoints.
2) User is known for hacking and like's to fool with your application. Don't give them a username/password to access your system and retrieve API keys/URL endpoints.
Oh yeah, make sure all URL access is via HTTPS or all this is mute.