invalid_api_key (401)
The key is not in a valid format, or no account has it. A key only exists in its own environment:
a _test_ key is looked up in the sandbox and a _live_ key in the live database, so a key sent
to the wrong environment is simply unknown.
Fix: check for typos and use a key from the right environment. Your keys are listed on the account's keys pages in the portal, by their last four characters; make a new one there if you no longer have it.