Skip to main content

Response Headers

HeaderDescription
X-RateLimit-LimitMax requests per window
X-RateLimit-RemainingRequests left
X-RateLimit-ResetWindow reset timestamp

Monitoring Usage

response = client.with_raw_response.calls.list()

print(f"Limit: {response.headers['X-RateLimit-Limit']}")
print(f"Remaining: {response.headers['X-RateLimit-Remaining']}")

Best Practices

  • Implement exponential backoff
  • Monitor remaining quota
  • Batch operations where possible
  • Use webhooks instead of polling