Skip to main content
A 401 Unauthorized error means authentication failed. Check that:
  1. Your API key is correct
  2. The header format is Authorization: Bearer your-api-key
  3. Your key has not been deactivated or rotated
A 429 Too Many Requests error means you’re sending requests too frequently. Solutions:
  1. Reduce your request frequency
  2. Implement exponential backoff retry logic (see example below)
  3. Contact support if you need higher rate limits
A 500 Internal Server Error indicates a server-side issue. Steps to take:
  1. Wait a moment and retry the request
  2. Verify your request parameters are valid
  3. If the error persists, contact support with your request details
Use exponential backoff with random jitter to avoid overwhelming the server:
import time
import random

def api_call_with_retry(func, max_retries=3):
    for attempt in range(max_retries):
        try:
            return func()
        except Exception as e:
            if attempt == max_retries - 1:
                raise e

            # Exponential backoff + random jitter
            wait_time = (2 ** attempt) + random.uniform(0, 1)
            time.sleep(wait_time)
For more advanced retry strategies, see Error Handling and Retry Mechanisms.