Class RateLimitException

All Implemented Interfaces:
Serializable

public class RateLimitException extends SendByteException
rate_limit_exceeded (429): the per-key request rate was exceeded.

getRetryAfterSeconds() exposes the value of the Retry-After response header when present, so you can back off before retrying.

See Also:
  • Constructor Details

    • RateLimitException

      public RateLimitException(String message, String code, int status, String docsUrl, String requestId, Integer retryAfterSeconds)
  • Method Details

    • getRetryAfterSeconds

      public Integer getRetryAfterSeconds()
      Seconds to wait before retrying, from the Retry-After header, or null.