You can test the function in staging just pass the /staging flag on your test.
https://TLD/SDK41/api/v2/efx/staging/C001/CostFunctions/GeneratePOEstRevenue
Where are you hard coding your API key? In your application?
You should do your work / changes in your development environment and then push / move / publish that to production. So it shouldn’t break anything in production except for the split second of you installing the latest version. Don’t correct functions in live