402 response with payment_required means your account has used all of its available credits. All requests that would consume credits return 402 until you have credits again.
Confirm your credit balance
Check thex-totallimit-remaining response header or the Usage tab in the API Dashboard. See Check your credit usage.
Restore access
- Free and Pro plans: Upgrade from the API Dashboard. See Compare plans and upgrade.
- Enterprise plan: Contact your Customer Success Manager to increase your limit.
Avoid running out unexpectedly
Set up usage alerts
Usage alerts email you when your credit usage for a product reaches a percentage threshold that you set.- Open the Usage Reports tab in your API Dashboard settings.
- Under Usage Alerts, select a product or All products.
- Enter a threshold from 1 to 100 percent, then click Add alert. Repeat to add more thresholds.
- On the Notifications tab, opt in to API usage report emails.
Free plans can set one usage alert for All products. To set multiple or product-specific alerts, upgrade to Pro.
Monitor usage in your code
- Monitor
x-totallimit-remainingin your code and stop or alert before it reaches zero. - For Search APIs, set
sizeto the number of records you need. Each returned record costs one credit.
