Based on this documentation, you likely need to use defineSecret in your backend code instead of defineString. The latter is used for non-secret values stored in a .env file or provided in the CLI when you deploy. See this part of the docs for how to retrieve secret values.
My guess is that you have the live key in a .env file that’s being picked up by defineString. Also since you’ve already hardcoded the secret and deployed, I’d recommend rotating your key once you’ve resolved the issue, even though it’s just a test key.