Is there a way to check if an API key does not have a payment method?

Having a lot of issues because people insert their API key and claim my services don’t work. Have no way of finding this information via the docs.

1 Like

“Check your plan” is a good message string to match. The API key works, but there’s no funding or available spending allowance behind it.

RateLimitError: Error code: 429 - {‘error’: {‘message’: ‘You exceeded your current quota, please check your plan and billing details.’, ‘type’: ‘insufficient_quota’, ‘param’: None, ‘code’: ‘insufficient_quota’}}

1 Like

You can just send a “hi” message to check the response when user set the api key.
And just show user the error if it does not return status 200.

1 Like

The issue is this doesn’t happen unless you’ve exceeded the quota already. The alternative is to attempt and exceed the quota for the user yourself, which doesn’t seem like a good solutiion.

Is this regarding testing if a coded solution works? Certainly you can find a way to register another account and not fund it…